Consider anything with a ValueType that is >= Instruction to be an instruction
authorChris Lattner <sabre@nondot.org>
Sat, 26 Jun 2004 20:51:50 +0000 (20:51 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 26 Jun 2004 20:51:50 +0000 (20:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14429 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Instruction.h
include/llvm/User.h

index 86f2a056cb975df4055ed6213d559536375f174a..d2f61965dddc07121a575d93d61bfcccf4c8e4e5 100644 (file)
@@ -138,7 +138,7 @@ public:
   /// Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const Instruction *I) { return true; }
   static inline bool classof(const Value *V) {
-    return V->getValueType() == Value::InstructionVal;
+    return V->getValueType() >= Value::InstructionVal;
   }
   
   //----------------------------------------------------------------------
index 0482189b6d8d63cd6ccc61279a0a2adf1f14c2d9..e45afdca68f7fad170340cb937398cb585813970 100644 (file)
@@ -86,9 +86,8 @@ public:
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const User *) { return true; }
   static inline bool classof(const Value *V) {
-    return V->getValueType() == Value::GlobalVariableVal ||
-           V->getValueType() == Value::ConstantVal ||
-           V->getValueType() == Value::InstructionVal;
+    return isa<Instruction>(V) || isa<GlobalVariable>(V) ||
+           isa<Constant>(V);
   }
 };