mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-21 18:31:36 +00:00
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
This commit is contained in:
parent
cb747c558c
commit
fbee0f6377
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user