[llvm-commits] CVS: llvm/include/llvm/DerivedTypes.h

LLVM llvm at cs.uiuc.edu
Sun Jul 4 05:49:01 PDT 2004


Changes in directory llvm/include/llvm:

DerivedTypes.h updated: 1.58 -> 1.59

---
Log message:

Remove all of the classof(const Value*) methods of the derived types since
the Type base class no longer derives from Value.


---
Diffs of the changes:  (+2 -36)

Index: llvm/include/llvm/DerivedTypes.h
diff -u llvm/include/llvm/DerivedTypes.h:1.58 llvm/include/llvm/DerivedTypes.h:1.59
--- llvm/include/llvm/DerivedTypes.h:1.58	Thu Jun 17 13:15:25 2004
+++ llvm/include/llvm/DerivedTypes.h	Sun Jul  4 05:48:27 2004
@@ -95,9 +95,6 @@
   static inline bool classof(const Type *T) {
     return T->isDerivedType();
   }
-  static inline bool classof(const Value *V) {
-    return isa<Type>(V) && classof(cast<Type>(V));
-  }
 };
 
 
@@ -151,9 +148,6 @@
   static inline bool classof(const Type *T) {
     return T->getTypeID() == FunctionTyID;
   }
-  static inline bool classof(const Value *V) {
-    return isa<Type>(V) && classof(cast<Type>(V));
-  }
 };
 
 
@@ -177,9 +171,6 @@
            T->getTypeID() == StructTyID ||
            T->getTypeID() == PointerTyID;
   }
-  static inline bool classof(const Value *V) {
-    return isa<Type>(V) && classof(cast<Type>(V));
-  }
 };
 
 
@@ -232,9 +223,6 @@
   static inline bool classof(const Type *T) {
     return T->getTypeID() == StructTyID;
   }
-  static inline bool classof(const Value *V) {
-    return isa<Type>(V) && classof(cast<Type>(V));
-  }
 };
 
 
@@ -256,24 +244,14 @@
 public:
   inline const Type *getElementType() const { return ContainedTys[0]; }
 
+  virtual bool indexValid(const Value *V) const;
+
   /// getTypeAtIndex - Given an index value into the type, return the type of
   /// the element.  For sequential types, there is only one subtype...
   ///
   virtual const Type *getTypeAtIndex(const Value *V) const {
     return ContainedTys[0];
   }
-  virtual bool indexValid(const Value *V) const {
-    const Type *Ty = V->getType();
-    switch (Ty->getTypeID()) {
-    case Type::IntTyID:
-    case Type::UIntTyID:
-    case Type::LongTyID:
-    case Type::ULongTyID:
-      return true;
-    default:
-      return false;
-    }
-  }
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const SequentialType *T) { return true; }
@@ -281,9 +259,6 @@
     return T->getTypeID() == ArrayTyID ||
            T->getTypeID() == PointerTyID;
   }
-  static inline bool classof(const Value *V) {
-    return isa<Type>(V) && classof(cast<Type>(V));
-  }
 };
 
 
@@ -321,9 +296,6 @@
   static inline bool classof(const Type *T) {
     return T->getTypeID() == ArrayTyID;
   }
-  static inline bool classof(const Value *V) {
-    return isa<Type>(V) && classof(cast<Type>(V));
-  }
 };
 
 
@@ -354,9 +326,6 @@
   static inline bool classof(const Type *T) {
     return T->getTypeID() == PointerTyID;
   }
-  static inline bool classof(const Value *V) {
-    return isa<Type>(V) && classof(cast<Type>(V));
-  }
 };
 
 
@@ -392,9 +361,6 @@
   static inline bool classof(const OpaqueType *T) { return true; }
   static inline bool classof(const Type *T) {
     return T->getTypeID() == OpaqueTyID;
-  }
-  static inline bool classof(const Value *V) {
-    return isa<Type>(V) && classof(cast<Type>(V));
   }
 };
 





More information about the llvm-commits mailing list