X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FType.h;h=fe3c392c7c6cd03f597aca9ead7c76c7800fcc7f;hb=a6fb5b54f3a35fdefbb03b9c7be4c6d6d53cdd35;hp=493c8345334bfaff9ae78cb7f49fa78760e1c512;hpb=ddc4ee82b51b54605253ffe0e86ce6d38e7729d9;p=oota-llvm.git diff --git a/include/llvm/Type.h b/include/llvm/Type.h index 493c8345334..fe3c392c7c6 100644 --- a/include/llvm/Type.h +++ b/include/llvm/Type.h @@ -16,7 +16,7 @@ #include "llvm/Support/DataTypes.h" #include "llvm/Support/Streams.h" #include "llvm/ADT/GraphTraits.h" -#include "llvm/ADT/iterator" +#include "llvm/ADT/iterator.h" #include #include @@ -216,8 +216,9 @@ public: /// is a valid type for a Value. /// inline bool isFirstClassType() const { - // Coming soon: first-class struct and array types... - return isSingleValueType(); + // There are more first-class kinds than non-first-class kinds, so a + // negative test is simpler than a positive one. + return ID != FunctionTyID && ID != VoidTyID && ID != OpaqueTyID; } /// isSingleValueType - Return true if the type is a valid type for a @@ -229,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.