aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Type.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-12 20:49:41 +0000
committerChris Lattner <sabre@nondot.org>2010-02-12 20:49:41 +0000
commitfdfeb6976f07ad10d809b922ed7376ba2a3539be (patch)
treef6ba4446fc9db081e5e3386c57d2db253774c1fa /include/llvm/Type.h
parentb3e1bf54b29354c6d332cfaffcc86cd776fd4ca8 (diff)
downloadexternal_llvm-fdfeb6976f07ad10d809b922ed7376ba2a3539be.zip
external_llvm-fdfeb6976f07ad10d809b922ed7376ba2a3539be.tar.gz
external_llvm-fdfeb6976f07ad10d809b922ed7376ba2a3539be.tar.bz2
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/Type.h')
-rw-r--r--include/llvm/Type.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/llvm/Type.h b/include/llvm/Type.h
index bc319c6..52b2c84 100644
--- a/include/llvm/Type.h
+++ b/include/llvm/Type.h
@@ -82,10 +82,11 @@ public:
IntegerTyID, ///< 8: Arbitrary bit width integers
FunctionTyID, ///< 9: Functions
StructTyID, ///< 10: Structures
- ArrayTyID, ///< 11: Arrays
- PointerTyID, ///< 12: Pointers
- OpaqueTyID, ///< 13: Opaque: type with unknown structure
- VectorTyID, ///< 14: SIMD 'packed' format, or other vector type
+ UnionTyID, ///< 11: Unions
+ ArrayTyID, ///< 12: Arrays
+ PointerTyID, ///< 13: Pointers
+ OpaqueTyID, ///< 14: Opaque: type with unknown structure
+ VectorTyID, ///< 15: SIMD 'packed' format, or other vector type
NumTypeIDs, // Must remain as last defined ID
LastPrimitiveTyID = LabelTyID,
@@ -297,7 +298,7 @@ public:
/// does not include vector types.
///
inline bool isAggregateType() const {
- return ID == StructTyID || ID == ArrayTyID;
+ return ID == StructTyID || ID == ArrayTyID || ID == UnionTyID;
}
/// isSized - Return true if it makes sense to take the size of this type. To
@@ -310,7 +311,8 @@ public:
return true;
// If it is not something that can have a size (e.g. a function or label),
// it doesn't have a size.
- if (ID != StructTyID && ID != ArrayTyID && ID != VectorTyID)
+ if (ID != StructTyID && ID != ArrayTyID && ID != VectorTyID &&
+ ID != UnionTyID)
return false;
// If it is something that can have a size and it's concrete, it definitely
// has a size, otherwise we have to try harder to decide.