Commit more code over to new cast style

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@697 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2001-10-02 03:41:24 +00:00
parent 1d87bcf490
commit b00c582b6d
42 changed files with 349 additions and 233 deletions

View File

@@ -40,6 +40,15 @@ public:
inline BasicBlock *getSuccessor(unsigned idx) {
return (BasicBlock*)((const TerminatorInst *)this)->getSuccessor(idx);
}
// 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() >= FirstTermOp && I->getOpcode() < NumTermOps;
}
static inline bool classof(const Value *V) {
return isa<Instruction>(V) && classof(cast<Instruction>(V));
}
};
@@ -70,6 +79,15 @@ public:
}
virtual const char *getOpcodeName() const = 0;
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const UnaryOperator *) { return true; }
static inline bool classof(const Instruction *I) {
return I->getOpcode() >= FirstUnaryOp && I->getOpcode() < NumUnaryOps;
}
static inline bool classof(const Value *V) {
return isa<Instruction>(V) && classof(cast<Instruction>(V));
}
};
@@ -111,6 +129,15 @@ public:
void swapOperands() {
swap(Operands[0], Operands[1]);
}
// 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() >= FirstBinaryOp && I->getOpcode() < NumBinaryOps;
}
static inline bool classof(const Value *V) {
return isa<Instruction>(V) && classof(cast<Instruction>(V));
}
};
#endif