Add classof implementations for User

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@739 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2001-10-13 06:18:05 +00:00
parent 067238d5d9
commit 26e129e64f

View File

@ -64,6 +64,14 @@ public:
//
void replaceUsesOfWith(Value *From, Value *To);
// 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;
}
// addOperand - This is a special purpose API that should not be used in most
// cases. It adds an empty (null) operand to the instruction specified. This
// is currently used by the back end as part of the "lowering" process... most