Add isa,cast,dyncast support for AllocationInst.

llvm-svn: 1915
This commit is contained in:
Chris Lattner 2002-03-18 05:00:51 +00:00
parent 8280198b62
commit 6a19d49f51
1 changed files with 10 additions and 0 deletions

View File

@ -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));
}
};