1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

[bindings/go] Add Subprogram method

This method allows getting the subprogram metadata object from a
function value.

Differential Revision: https://reviews.llvm.org/D71528
This commit is contained in:
Ayke van Laethem 2020-01-03 22:10:27 +01:00
parent d67b833b23
commit b8b1c0544c

View File

@ -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