From: Chris Lattner Date: Mon, 18 Mar 2002 05:00:51 +0000 (+0000) Subject: Add isa,cast,dyncast support for AllocationInst. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4e390f61996ad67103c1c4a650ebed829d14ac13;p=oota-llvm.git Add isa,cast,dyncast support for AllocationInst. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1915 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/iMemory.h b/include/llvm/iMemory.h index ec04b281dbc..7d919196dea 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(V) && classof(cast(V)); + } };