From: Chris Lattner Date: Sat, 26 Jun 2004 20:51:50 +0000 (+0000) Subject: Consider anything with a ValueType that is >= Instruction to be an instruction X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0b0863778fd5e9e8ef8e9858906a6c2e1f302d5a;p=oota-llvm.git Consider anything with a ValueType that is >= Instruction to be an instruction git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14429 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Instruction.h b/include/llvm/Instruction.h index 86f2a056cb9..d2f61965ddd 100644 --- a/include/llvm/Instruction.h +++ b/include/llvm/Instruction.h @@ -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; } //---------------------------------------------------------------------- diff --git a/include/llvm/User.h b/include/llvm/User.h index 0482189b6d8..e45afdca68f 100644 --- a/include/llvm/User.h +++ b/include/llvm/User.h @@ -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(V) || isa(V) || + isa(V); } };