Modernize naming convention for class members.
[oota-llvm.git] / include / llvm / DerivedTypes.h
index f28c3747a1bfd1e630a2bc0d2cc1e6cdd3f52294..da5ad27b1f1c81e114200b60c87eec587ff970d7 100644 (file)
@@ -195,9 +195,10 @@ class StructType : public CompositeType {
     // This is the contents of the SubClassData field.
     SCDB_HasBody = 1,
     SCDB_Packed = 2,
-    SCDB_IsLiteral = 4
+    SCDB_IsLiteral = 4,
+    SCDB_IsSized = 8
   };
-  
+
   /// SymbolTableEntry - For a named struct that actually has a name, this is a
   /// pointer to the symbol table entry (maintained by LLVMContext) for the
   /// struct.  This is null if the type is an literal struct or if it is
@@ -224,20 +225,6 @@ public:
   static StructType *create(LLVMContext &Context, ArrayRef<Type*> Elements);
   static StructType *create(StringRef Name, Type *elt1, ...) END_WITH_NULL;
 
-#if 1
-  // FIXME: Remove these.
-  bool isAnonymous() const {return (getSubclassData() & SCDB_IsLiteral) != 0;}
-  static StructType *createNamed(LLVMContext &Context,
-                                 StringRef Name);
-  
-  static StructType *createNamed(StringRef Name, ArrayRef<Type*> Elements,
-                                 bool isPacked = false);
-  static StructType *createNamed(LLVMContext &Context, StringRef Name,
-                                 ArrayRef<Type*> Elements,
-                                 bool isPacked = false);
-  static StructType *createNamed(StringRef Name, Type *elt1, ...) END_WITH_NULL;
-#endif
-  
   /// StructType::get - This static method is the primary way to create a
   /// literal StructType.
   static StructType *get(LLVMContext &Context, ArrayRef<Type*> Elements,
@@ -262,6 +249,9 @@ public:
   /// isOpaque - Return true if this is a type with an identity that has no body
   /// specified yet.  These prints as 'opaque' in .ll files.
   bool isOpaque() const { return (getSubclassData() & SCDB_HasBody) == 0; }
+
+  /// isSized - Return true if this is a sized type.
+  bool isSized() const;
   
   /// hasName - Return true if this is a named struct that has a non-empty name.
   bool hasName() const { return SymbolTableEntry != 0; }
@@ -388,6 +378,7 @@ public:
   ///
   static VectorType *getInteger(VectorType *VTy) {
     unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits();
+    assert(EltBits && "Element size must be of a non-zero size");
     Type *EltTy = IntegerType::get(VTy->getContext(), EltBits);
     return VectorType::get(EltTy, VTy->getNumElements());
   }
@@ -422,6 +413,7 @@ public:
   unsigned getNumElements() const { return NumElements; }
 
   /// @brief Return the number of bits in the Vector type.
+  /// Returns zero when the vector is a vector of pointers.
   unsigned getBitWidth() const {
     return NumElements * getElementType()->getPrimitiveSizeInBits();
   }