Skip to content

Commit

Permalink
Merge pull request #17 from tinygo-org/master
Browse files Browse the repository at this point in the history
Add getters for call site attributes
  • Loading branch information
xushiwei authored Jul 7, 2024
2 parents 4dc1174 + 3b50c76 commit 8f5ebdc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ir.go
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,17 @@ func (v Value) InstructionCallConv() CallConv {
func (v Value) AddCallSiteAttribute(i int, a Attribute) {
C.LLVMAddCallSiteAttribute(v.C, C.LLVMAttributeIndex(i), a.C)
}
func (v Value) GetCallSiteEnumAttribute(i int, kind uint) (a Attribute) {
a.C = C.LLVMGetCallSiteEnumAttribute(v.C, C.LLVMAttributeIndex(i), C.unsigned(kind))
return
}
func (v Value) GetCallSiteStringAttribute(i int, kind string) (a Attribute) {
ckind := C.CString(kind)
defer C.free(unsafe.Pointer(ckind))
a.C = C.LLVMGetCallSiteStringAttribute(v.C, C.LLVMAttributeIndex(i),
ckind, C.unsigned(len(kind)))
return
}
func (v Value) SetInstrParamAlignment(i int, align int) {
C.LLVMSetInstrParamAlignment(v.C, C.unsigned(i), C.unsigned(align))
}
Expand Down

0 comments on commit 8f5ebdc

Please sign in to comment.