Add support for casting operators
[oota-llvm.git] / lib / VMCore / Type.cpp
index 0b272f0bb57e48370a6b140fee6e2f291caa194c..2e0bee55e55f6d9b599fc0d42a6ad5bbc569bfe8 100644 (file)
@@ -70,6 +70,9 @@ public:
 
   // isSigned - Return whether a numeric type is signed.
   virtual bool isSigned() const { return 1; }
+  
+  // isIntegral - Return whether this is one of the integer types
+  virtual bool isIntegral() const { return 1; }
 };
 
 class UnsignedIntType : public Type {
@@ -81,6 +84,9 @@ public:
 
   // isUnsigned - Return whether a numeric type is signed.
   virtual bool isUnsigned() const { return 1; }
+  
+  // isIntegral - Return whether this is one of the integer types
+  virtual bool isIntegral() const { return 1; }
 };
 
 static struct TypeType : public Type {
@@ -143,7 +149,11 @@ ArrayType::ArrayType(const Type *ElType, int NumEl, const string &Name)
 }
 
 StructType::StructType(const vector<const Type*> &Types, const string &Name) 
-  : Type(Name, StructTyID), ETypes(Types) {
+  : Type(Name, StructTyID),
+    ETypes(Types),
+    layoutCache(new StructSizeAndOffsetInfo) 
+{
+  ResetCachedInfo();
 }
 
 PointerType::PointerType(const Type *E)