summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-05-30 22:40:06 +0000
committerDan Gohman <gohman@apple.com>2008-05-30 22:40:06 +0000
commit82c85c8435581f1e65e6329decc0d4df00e1a45e (patch)
tree79c10170f5150644f0240917a5d8126b5cea4b75 /llvm
parentfe3ec48bc4003db761846aae353517dd1d6f378e (diff)
downloadbcm5719-llvm-82c85c8435581f1e65e6329decc0d4df00e1a45e.tar.gz
bcm5719-llvm-82c85c8435581f1e65e6329decc0d4df00e1a45e.zip
Add an isAggregateType predicate.
llvm-svn: 51794
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Type.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/include/llvm/Type.h b/llvm/include/llvm/Type.h
index c19e34b35dd..fe3c392c7c6 100644
--- a/llvm/include/llvm/Type.h
+++ b/llvm/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.
OpenPOWER on IntegriCloud