Skip to content

Commit

Permalink
[bindings/go] Add Subprogram method
Browse files Browse the repository at this point in the history
This method allows getting the subprogram metadata object from a
function value.

Differential Revision: https://reviews.llvm.org/D71528
  • Loading branch information
aykevl committed Jan 3, 2020
1 parent 3566c75 commit 555fc92
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions llvm/bindings/go/llvm/dibuilder.go
Expand Up @@ -586,6 +586,11 @@ func (v Value) SetSubprogram(sp Metadata) {
C.LLVMSetSubprogram(v.C, sp.C)
}

func (v Value) Subprogram() (md Metadata) {
md.C = C.LLVMGetSubprogram(v.C)
return
}

func boolToCInt(v bool) C.int {
if v {
return 1
Expand Down

0 comments on commit 555fc92

Please sign in to comment.