diff options
author | Chris Lattner <sabre@nondot.org> | 2007-12-08 04:37:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-12-08 04:37:52 +0000 |
commit | e5cf2ff6edba34c20e160bd35ded6fadf192eab9 (patch) | |
tree | f53f76323a85491a6eb1b76c8329443bd934f098 | |
parent | 7c7888bb2d352f631aa050ecc7c9dcb1d7808d50 (diff) | |
download | external_llvm-e5cf2ff6edba34c20e160bd35ded6fadf192eab9.zip external_llvm-e5cf2ff6edba34c20e160bd35ded6fadf192eab9.tar.gz external_llvm-e5cf2ff6edba34c20e160bd35ded6fadf192eab9.tar.bz2 |
Implement correct isa<UnaryInstruction>, problem reported by "ST".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44697 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/InstrTypes.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h index 22ad342..a6a8fff 100644 --- a/include/llvm/InstrTypes.h +++ b/include/llvm/InstrTypes.h @@ -108,6 +108,20 @@ public: Op = Val; } unsigned getNumOperands() const { return 1; } + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const UnaryInstruction *) { return true; } + static inline bool classof(const Instruction *I) { + return I->getOpcode() == Instruction::Malloc || + I->getOpcode() == Instruction::Alloca || + I->getOpcode() == Instruction::Free || + I->getOpcode() == Instruction::Load || + I->getOpcode() == Instruction::VAArg || + (I->getOpcode() >= CastOpsBegin && I->getOpcode() < CastOpsEnd); + } + static inline bool classof(const Value *V) { + return isa<Instruction>(V) && classof(cast<Instruction>(V)); + } }; //===----------------------------------------------------------------------===// |