aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-10-17 21:42:45 +0000
committerDan Gohman <gohman@apple.com>2008-10-17 21:42:45 +0000
commitfbee0f637727d8f46999b8e43fd6d4cf24dcb42e (patch)
tree046cfe3a0f1515db76eb9c66c973ac4805bb30fb
parentcb747c558ce0e36edbcd7655e24281845e61de43 (diff)
downloadexternal_llvm-fbee0f637727d8f46999b8e43fd6d4cf24dcb42e.tar.gz
external_llvm-fbee0f637727d8f46999b8e43fd6d4cf24dcb42e.tar.bz2
external_llvm-fbee0f637727d8f46999b8e43fd6d4cf24dcb42e.zip
Use the opcode predicates, instead of duplicating the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57735 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/InstrTypes.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h
index 5393982312..23aca6ab13 100644
--- a/include/llvm/InstrTypes.h
+++ b/include/llvm/InstrTypes.h
@@ -73,7 +73,7 @@ public:
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const TerminatorInst *) { return true; }
static inline bool classof(const Instruction *I) {
- return I->getOpcode() >= TermOpsBegin && I->getOpcode() < TermOpsEnd;
+ return I->isTerminator();
}
static inline bool classof(const Value *V) {
return isa<Instruction>(V) && classof(cast<Instruction>(V));
@@ -237,7 +237,7 @@ public:
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const BinaryOperator *) { return true; }
static inline bool classof(const Instruction *I) {
- return I->getOpcode() >= BinaryOpsBegin && I->getOpcode() < BinaryOpsEnd;
+ return I->isBinaryOp();
}
static inline bool classof(const Value *V) {
return isa<Instruction>(V) && classof(cast<Instruction>(V));
@@ -483,7 +483,7 @@ public:
/// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const CastInst *) { return true; }
static inline bool classof(const Instruction *I) {
- return I->getOpcode() >= CastOpsBegin && I->getOpcode() < CastOpsEnd;
+ return I->isCast();
}
static inline bool classof(const Value *V) {
return isa<Instruction>(V) && classof(cast<Instruction>(V));