diff options
Diffstat (limited to 'bindings/go/llvm/ir.go')
-rw-r--r-- | bindings/go/llvm/ir.go | 6 |
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 |