Initial implementation of 'fence' instruction, the new C++0x-style replacement for...
[oota-llvm.git] / include / llvm / DerivedTypes.h
index 0f1e99f13499b9b64b9f905f1ee146eb9d1bdd24..f90eb4258123920183b21c17bad80869d50b4649 100644 (file)
@@ -96,26 +96,26 @@ public:
 class FunctionType : public Type {
   FunctionType(const FunctionType &);                   // Do not implement
   const FunctionType &operator=(const FunctionType &);  // Do not implement
-  FunctionType(const Type *Result, ArrayRef<Type*> Params, bool IsVarArgs);
+  FunctionType(Type *Result, ArrayRef<Type*> Params, bool IsVarArgs);
 
 public:
   /// FunctionType::get - This static method is the primary way of constructing
   /// a FunctionType.
   ///
-  static FunctionType *get(const Type *Result,
+  static FunctionType *get(Type *Result,
                            ArrayRef<Type*> Params, bool isVarArg);
 
   /// FunctionType::get - Create a FunctionType taking no parameters.
   ///
-  static FunctionType *get(const Type *Result, bool isVarArg);
+  static FunctionType *get(Type *Result, bool isVarArg);
   
   /// isValidReturnType - Return true if the specified type is valid as a return
   /// type.
-  static bool isValidReturnType(const Type *RetTy);
+  static bool isValidReturnType(Type *RetTy);
 
   /// isValidArgumentType - Return true if the specified type is valid as an
   /// argument type.
-  static bool isValidArgumentType(const Type *ArgTy);
+  static bool isValidArgumentType(Type *ArgTy);
 
   bool isVarArg() const { return getSubclassData(); }
   Type *getReturnType() const { return ContainedTys[0]; }
@@ -150,8 +150,8 @@ public:
   /// getTypeAtIndex - Given an index value into the type, return the type of
   /// the element.
   ///
-  Type *getTypeAtIndex(const Value *V) const;
-  Type *getTypeAtIndex(unsigned Idx) const;
+  Type *getTypeAtIndex(const Value *V);
+  Type *getTypeAtIndex(unsigned Idx);
   bool indexValid(const Value *V) const;
   bool indexValid(unsigned Idx) const;
 
@@ -190,6 +190,10 @@ class StructType : public CompositeType {
   /// 
   void *SymbolTableEntry;
 public:
+  ~StructType() {
+    delete [] ContainedTys; // Delete the body.
+  }
+
   /// StructType::createNamed - This creates a named struct with no body
   /// specified.  If the name is empty, it creates an unnamed struct, which has
   /// a unique identity but no actual name.
@@ -246,7 +250,7 @@ public:
   
   /// isValidElementType - Return true if the specified type is valid as a
   /// element type.
-  static bool isValidElementType(const Type *ElemTy);
+  static bool isValidElementType(Type *ElemTy);
   
 
   // Iterator access to the elements.
@@ -256,7 +260,7 @@ public:
 
   /// isLayoutIdentical - Return true if this is layout identical to the
   /// specified struct.
-  bool isLayoutIdentical(const StructType *Other) const;  
+  bool isLayoutIdentical(StructType *Other) const;  
   
   // Random access to the elements
   unsigned getNumElements() const { return NumContainedTys; }
@@ -317,11 +321,11 @@ public:
   /// ArrayType::get - This static method is the primary way to construct an
   /// ArrayType
   ///
-  static ArrayType *get(const Type *ElementType, uint64_t NumElements);
+  static ArrayType *get(Type *ElementType, uint64_t NumElements);
 
   /// isValidElementType - Return true if the specified type is valid as a
   /// element type.
-  static bool isValidElementType(const Type *ElemTy);
+  static bool isValidElementType(Type *ElemTy);
 
   uint64_t getNumElements() const { return NumElements; }
 
@@ -344,13 +348,13 @@ public:
   /// VectorType::get - This static method is the primary way to construct an
   /// VectorType.
   ///
-  static VectorType *get(const Type *ElementType, unsigned NumElements);
+  static VectorType *get(Type *ElementType, unsigned NumElements);
 
   /// VectorType::getInteger - This static method gets a VectorType with the
   /// same number of elements as the input type, and the element type is an
   /// integer type of the same width as the input element type.
   ///
-  static VectorType *getInteger(const VectorType *VTy) {
+  static VectorType *getInteger(VectorType *VTy) {
     unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits();
     Type *EltTy = IntegerType::get(VTy->getContext(), EltBits);
     return VectorType::get(EltTy, VTy->getNumElements());
@@ -360,7 +364,7 @@ public:
   /// getInteger except that the element types are twice as wide as the
   /// elements in the input type.
   ///
-  static VectorType *getExtendedElementVectorType(const VectorType *VTy) {
+  static VectorType *getExtendedElementVectorType(VectorType *VTy) {
     unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits();
     Type *EltTy = IntegerType::get(VTy->getContext(), EltBits * 2);
     return VectorType::get(EltTy, VTy->getNumElements());
@@ -370,7 +374,7 @@ public:
   /// getInteger except that the element types are half as wide as the
   /// elements in the input type.
   ///
-  static VectorType *getTruncatedElementVectorType(const VectorType *VTy) {
+  static VectorType *getTruncatedElementVectorType(VectorType *VTy) {
     unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits();
     assert((EltBits & 1) == 0 &&
            "Cannot truncate vector element with odd bit-width");
@@ -380,7 +384,7 @@ public:
 
   /// isValidElementType - Return true if the specified type is valid as a
   /// element type.
-  static bool isValidElementType(const Type *ElemTy);
+  static bool isValidElementType(Type *ElemTy);
 
   /// @brief Return the number of elements in the Vector type.
   unsigned getNumElements() const { return NumElements; }
@@ -407,17 +411,17 @@ class PointerType : public SequentialType {
 public:
   /// PointerType::get - This constructs a pointer to an object of the specified
   /// type in a numbered address space.
-  static PointerType *get(const Type *ElementType, unsigned AddressSpace);
+  static PointerType *get(Type *ElementType, unsigned AddressSpace);
 
   /// PointerType::getUnqual - This constructs a pointer to an object of the
   /// specified type in the generic address space (address space zero).
-  static PointerType *getUnqual(const Type *ElementType) {
+  static PointerType *getUnqual(Type *ElementType) {
     return PointerType::get(ElementType, 0);
   }
 
   /// isValidElementType - Return true if the specified type is valid as a
   /// element type.
-  static bool isValidElementType(const Type *ElemTy);
+  static bool isValidElementType(Type *ElemTy);
 
   /// @brief Return the address space of the Pointer type.
   inline unsigned getAddressSpace() const { return getSubclassData(); }