Consider anything with a ValueType that is >= Instruction to be an instruction

llvm-svn: 14429
This commit is contained in:
Chris Lattner 2004-06-26 20:51:50 +00:00
parent d0b0b454e5
commit f758330347
2 changed files with 3 additions and 4 deletions

View File

@ -138,7 +138,7 @@ public:
/// Methods for support type inquiry through isa, cast, and dyn_cast: /// 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 Instruction *I) { return true; }
static inline bool classof(const Value *V) { static inline bool classof(const Value *V) {
return V->getValueType() == Value::InstructionVal; return V->getValueType() >= Value::InstructionVal;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@ -86,9 +86,8 @@ public:
// Methods for support type inquiry through isa, cast, and dyn_cast: // Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const User *) { return true; } static inline bool classof(const User *) { return true; }
static inline bool classof(const Value *V) { static inline bool classof(const Value *V) {
return V->getValueType() == Value::GlobalVariableVal || return isa<Instruction>(V) || isa<GlobalVariable>(V) ||
V->getValueType() == Value::ConstantVal || isa<Constant>(V);
V->getValueType() == Value::InstructionVal;
} }
}; };