summaryrefslogtreecommitdiff
path: root/bindings/go/llvm/ir.go
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-06-10 13:44:06 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-06-10 13:44:06 +0000
commit7ab83427af0f77b59941ceba41d509d7d097b065 (patch)
treecc41c05b1db454e3d802f34df75e636ee922ad87 /bindings/go/llvm/ir.go
parentd288ef4c1788d3a951a7558c68312c2d320612b1 (diff)
Diffstat (limited to 'bindings/go/llvm/ir.go')
-rw-r--r--bindings/go/llvm/ir.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/bindings/go/llvm/ir.go b/bindings/go/llvm/ir.go
index fe191beb3813..222097034307 100644
--- a/bindings/go/llvm/ir.go
+++ b/bindings/go/llvm/ir.go
@@ -611,6 +611,12 @@ func (t Type) StructElementTypes() []Type {
}
// Operations on array, pointer, and vector types (sequence types)
+func (t Type) Subtypes() (ret []Type) {
+ ret = make([]Type, C.LLVMGetNumContainedTypes(t.C))
+ C.LLVMGetSubtypes(t.C, llvmTypeRefPtr(&ret[0]))
+ return
+}
+
func ArrayType(elementType Type, elementCount int) (t Type) {
t.C = C.LLVMArrayType(elementType.C, C.unsigned(elementCount))
return