[llvm-commits] [llvm] r51794 - /llvm/trunk/include/llvm/Type.h

Dan Gohman gohman at apple.com
Fri May 30 15:40:06 PDT 2008


Author: djg
Date: Fri May 30 17:40:06 2008
New Revision: 51794

URL: http://llvm.org/viewvc/llvm-project?rev=51794&view=rev
Log:
Add an isAggregateType predicate.

Modified:
    llvm/trunk/include/llvm/Type.h

Modified: llvm/trunk/include/llvm/Type.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Type.h?rev=51794&r1=51793&r2=51794&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Type.h (original)
+++ llvm/trunk/include/llvm/Type.h Fri May 30 17:40:06 2008
@@ -230,6 +230,15 @@
             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.





More information about the llvm-commits mailing list