aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/User.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/User.h b/include/llvm/User.h
index 535dd1e88a..6b1ece4dc2 100644
--- a/include/llvm/User.h
+++ b/include/llvm/User.h
@@ -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