diff options
author | Chris Lattner <sabre@nondot.org> | 2010-02-12 20:49:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-02-12 20:49:41 +0000 |
commit | fdfeb6976f07ad10d809b922ed7376ba2a3539be (patch) | |
tree | f6ba4446fc9db081e5e3386c57d2db253774c1fa /include/llvm-c/Core.h | |
parent | b3e1bf54b29354c6d332cfaffcc86cd776fd4ca8 (diff) |
Add support for a union type in LLVM IR. Patch by Talin!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96011 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm-c/Core.h')
-rw-r--r-- | include/llvm-c/Core.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h index 98358fe380..4500fccb65 100644 --- a/include/llvm-c/Core.h +++ b/include/llvm-c/Core.h @@ -193,7 +193,8 @@ typedef enum { LLVMPointerTypeKind, /**< Pointers */ LLVMOpaqueTypeKind, /**< Opaque: type with unknown structure */ LLVMVectorTypeKind, /**< SIMD 'packed' format, or other vector type */ - LLVMMetadataTypeKind /**< Metadata */ + LLVMMetadataTypeKind, /**< Metadata */ + LLVMUnionTypeKind /**< Unions */ } LLVMTypeKind; typedef enum { @@ -372,6 +373,13 @@ unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy); void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest); LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy); +/* Operations on union types */ +LLVMTypeRef LLVMUnionTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, + unsigned ElementCount); +LLVMTypeRef LLVMUnionType(LLVMTypeRef *ElementTypes, unsigned ElementCount); +unsigned LLVMCountUnionElementTypes(LLVMTypeRef UnionTy); +void LLVMGetUnionElementTypes(LLVMTypeRef UnionTy, LLVMTypeRef *Dest); + /* Operations on array, pointer, and vector types (sequence types) */ LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount); LLVMTypeRef LLVMPointerType(LLVMTypeRef ElementType, unsigned AddressSpace); |