mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-03 10:19:25 +00:00
Add isa,cast,dyncast support for AllocationInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1915 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fad0f52666
commit
4e390f6199
@ -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));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user