diff options
author | Dan Gohman <gohman@apple.com> | 2008-05-30 22:40:06 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-05-30 22:40:06 +0000 |
commit | bc9a81d4c4e79426ee5649ad9fbddd98ca245bd5 (patch) | |
tree | c4d0abee020739b8cd42444689ecf8ea6524d7e4 /include | |
parent | 2e04590644fca2f233cef951ccfb12cb0d78f59a (diff) | |
download | external_llvm-bc9a81d4c4e79426ee5649ad9fbddd98ca245bd5.zip external_llvm-bc9a81d4c4e79426ee5649ad9fbddd98ca245bd5.tar.gz external_llvm-bc9a81d4c4e79426ee5649ad9fbddd98ca245bd5.tar.bz2 |
Add an isAggregateType predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51794 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Type.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/Type.h b/include/llvm/Type.h index c19e34b..fe3c392 100644 --- a/include/llvm/Type.h +++ b/include/llvm/Type.h @@ -230,6 +230,15 @@ public: ID == IntegerTyID || ID == PointerTyID || ID == VectorTyID; } + /// isAggregateType - Return true if the type is an aggregate type. This + /// means it is valid as the first operand of an insertvalue or + /// extractvalue instruction. This includes struct and array types, but + /// does not include vector types. + /// + inline bool isAggregateType() const { + return ID == StructTyID || ID == ArrayTyID; + } + /// isSized - Return true if it makes sense to take the size of this type. To /// get the actual size for a particular target, it is reasonable to use the /// TargetData subsystem to do this. |