diff options
author | Chris Lattner <sabre@nondot.org> | 2002-08-23 18:30:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-08-23 18:30:58 +0000 |
commit | 615cdb92ee442cbfac75e3602df857e06ab9aee6 (patch) | |
tree | b8c3f40cd5aac9164e7167468e57c11b4d67f7a1 /include | |
parent | ed0f1c5285804839395695b617e5a32cab57f2f7 (diff) | |
download | external_llvm-615cdb92ee442cbfac75e3602df857e06ab9aee6.zip external_llvm-615cdb92ee442cbfac75e3602df857e06ab9aee6.tar.gz external_llvm-615cdb92ee442cbfac75e3602df857e06ab9aee6.tar.bz2 |
Implement classof for SetCondInst so that instcombine doesn't break on dyn_cast<SetCondInst>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3493 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/iOperators.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/iOperators.h b/include/llvm/iOperators.h index 3bdb13d..730906a 100644 --- a/include/llvm/iOperators.h +++ b/include/llvm/iOperators.h @@ -34,6 +34,17 @@ public: // For example seteq -> setne, setgt -> setle, setlt -> setge, etc... // BinaryOps getInverseCondition() const; + + // Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const SetCondInst *) { return true; } + static inline bool classof(const Instruction *I) { + return I->getOpcode() == SetEQ || I->getOpcode() == SetNE || + I->getOpcode() == SetLE || I->getOpcode() == SetGE || + I->getOpcode() == SetLT || I->getOpcode() == SetGT; + } + static inline bool classof(const Value *V) { + return isa<Instruction>(V) && classof(cast<Instruction>(V)); + } }; #endif |