summaryrefslogtreecommitdiffstats
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
commit83876cd9b0a48f8ed5da8b97c284b1d4f6c93c57 (patch)
tree64815add3e36c16b3801e70e6fc36e84a8c4d47e
parent209fc264624efef46b89666a5e1f856f3418627d (diff)
downloadbcm5719-llvm-83876cd9b0a48f8ed5da8b97c284b1d4f6c93c57.tar.gz
bcm5719-llvm-83876cd9b0a48f8ed5da8b97c284b1d4f6c93c57.zip
Use the opcode predicates, instead of duplicating the code.
llvm-svn: 57735
-rw-r--r--llvm/include/llvm/InstrTypes.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/include/llvm/InstrTypes.h b/llvm/include/llvm/InstrTypes.h
index 53939823122..23aca6ab134 100644
--- a/llvm/include/llvm/InstrTypes.h
+++ b/llvm/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));
OpenPOWER on IntegriCloud