From f758330347a04cb7cb063f5ddbf0a3861ee5d6d9 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 26 Jun 2004 20:51:50 +0000 Subject: [PATCH] Consider anything with a ValueType that is >= Instruction to be an instruction llvm-svn: 14429 --- llvm/include/llvm/Instruction.h | 2 +- llvm/include/llvm/User.h | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/llvm/include/llvm/Instruction.h b/llvm/include/llvm/Instruction.h index 86f2a056cb97..d2f61965dddc 100644 --- a/llvm/include/llvm/Instruction.h +++ b/llvm/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/llvm/include/llvm/User.h b/llvm/include/llvm/User.h index 0482189b6d8d..e45afdca68f7 100644 --- a/llvm/include/llvm/User.h +++ b/llvm/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); } };