aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/iMemory.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/iMemory.h b/include/llvm/iMemory.h
index ec04b281db..7d919196de 100644
--- a/include/llvm/iMemory.h
+++ b/include/llvm/iMemory.h
@@ -58,6 +58,16 @@ public:
}
virtual Instruction *clone() const = 0;
+
+ // Methods for support type inquiry through isa, cast, and dyn_cast:
+ static inline bool classof(const AllocationInst *) { return true; }
+ static inline bool classof(const Instruction *I) {
+ return I->getOpcode() == Instruction::Alloca ||
+ I->getOpcode() == Instruction::Malloc;
+ }
+ static inline bool classof(const Value *V) {
+ return isa<Instruction>(V) && classof(cast<Instruction>(V));
+ }
};