From 6a19d49f5153928bda42deef30360c799be28d61 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 18 Mar 2002 05:00:51 +0000 Subject: [PATCH] Add isa,cast,dyncast support for AllocationInst. llvm-svn: 1915 --- llvm/include/llvm/iMemory.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/llvm/include/llvm/iMemory.h b/llvm/include/llvm/iMemory.h index ec04b281dbc6..7d919196deaf 100644 --- a/llvm/include/llvm/iMemory.h +++ b/llvm/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(V) && classof(cast(V)); + } }; -- GitLab