[llvm-commits] [llvm] r134832 - in /llvm/trunk: include/llvm/DerivedTypes.h include/llvm/Type.h lib/Transforms/IPO/StripSymbols.cpp lib/VMCore/Type.cpp

Chris Lattner sabre at nondot.org
Sat Jul 9 10:59:15 PDT 2011


Author: lattner
Date: Sat Jul  9 12:59:15 2011
New Revision: 134832

URL: http://llvm.org/viewvc/llvm-project?rev=134832&view=rev
Log:
remove the DerivedType which isn't adding value anymore.

Modified:
    llvm/trunk/include/llvm/DerivedTypes.h
    llvm/trunk/include/llvm/Type.h
    llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp
    llvm/trunk/lib/VMCore/Type.cpp

Modified: llvm/trunk/include/llvm/DerivedTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DerivedTypes.h?rev=134832&r1=134831&r2=134832&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DerivedTypes.h (original)
+++ llvm/trunk/include/llvm/DerivedTypes.h Sat Jul  9 12:59:15 2011
@@ -29,28 +29,15 @@
 template<typename T> class ArrayRef;
 class StringRef;
 
-class DerivedType : public Type {
-protected:
-  explicit DerivedType(LLVMContext &C, TypeID id) : Type(C, id) {}
-public:
-
-  // Methods for support type inquiry through isa, cast, and dyn_cast.
-  static inline bool classof(const DerivedType *) { return true; }
-  static inline bool classof(const Type *T) {
-    return T->isDerivedType();
-  }
-};
-
 /// Class to represent integer types. Note that this class is also used to
 /// represent the built-in integer types: Int1Ty, Int8Ty, Int16Ty, Int32Ty and
 /// Int64Ty.
 /// @brief Integer representation type
-class IntegerType : public DerivedType {
+class IntegerType : public Type {
   friend class LLVMContextImpl;
   
 protected:
-  explicit IntegerType(LLVMContext &C, unsigned NumBits) : 
-      DerivedType(C, IntegerTyID) {
+  explicit IntegerType(LLVMContext &C, unsigned NumBits) : Type(C, IntegerTyID){
     setSubclassData(NumBits);
   }
 public:
@@ -106,7 +93,7 @@
 
 /// FunctionType - Class to represent function types
 ///
-class FunctionType : public DerivedType {
+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);
@@ -157,9 +144,9 @@
 
 /// CompositeType - Common super class of ArrayType, StructType, PointerType
 /// and VectorType.
-class CompositeType : public DerivedType {
+class CompositeType : public Type {
 protected:
-  explicit CompositeType(LLVMContext &C, TypeID tid) : DerivedType(C, tid) { }
+  explicit CompositeType(LLVMContext &C, TypeID tid) : Type(C, tid) { }
 public:
 
   /// getTypeAtIndex - Given an index value into the type, return the type of

Modified: llvm/trunk/include/llvm/Type.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Type.h?rev=134832&r1=134831&r2=134832&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Type.h (original)
+++ llvm/trunk/include/llvm/Type.h Sat Jul  9 12:59:15 2011
@@ -19,7 +19,6 @@
 
 namespace llvm {
 
-class DerivedType;
 class PointerType;
 class IntegerType;
 class raw_ostream;
@@ -40,7 +39,7 @@
 public:
   //===--------------------------------------------------------------------===//
   /// Definitions of all of the base types for the Type system.  Based on this
-  /// value, you can cast to a "DerivedType" subclass (see DerivedTypes.h)
+  /// value, you can cast to a class defined in DerivedTypes.h.
   /// Note: If you add an element to this, you need to add an element to the
   /// Type::getPrimitiveType function, or else things will break!
   /// Also update LLVMTypeKind and LLVMGetTypeKind () in the C binding.

Modified: llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp?rev=134832&r1=134831&r2=134832&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp Sat Jul  9 12:59:15 2011
@@ -143,8 +143,7 @@
   assert(C->use_empty() && "Constant is not dead!");
   SmallPtrSet<Constant*, 4> Operands;
   for (unsigned i = 0, e = C->getNumOperands(); i != e; ++i)
-    if (isa<DerivedType>(C->getOperand(i)->getType()) &&
-        OnlyUsedBy(C->getOperand(i), C)) 
+    if (OnlyUsedBy(C->getOperand(i), C)) 
       Operands.insert(cast<Constant>(C->getOperand(i)));
   if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C)) {
     if (!GV->hasLocalLinkage()) return;   // Don't delete non static globals.

Modified: llvm/trunk/lib/VMCore/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Type.cpp?rev=134832&r1=134831&r2=134832&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Type.cpp (original)
+++ llvm/trunk/lib/VMCore/Type.cpp Sat Jul  9 12:59:15 2011
@@ -308,7 +308,7 @@
 
 FunctionType::FunctionType(const Type *Result, ArrayRef<Type*> Params,
                            bool IsVarArgs)
-  : DerivedType(Result->getContext(), FunctionTyID) {
+  : Type(Result->getContext(), FunctionTyID) {
   Type **SubTys = reinterpret_cast<Type**>(this+1);
   assert(isValidReturnType(Result) && "invalid return type for function");
   setSubclassData(IsVarArgs);





More information about the llvm-commits mailing list