#include "llvm/Instruction.h"
+namespace llvm {
+
//===----------------------------------------------------------------------===//
// TerminatorInst Class
//===----------------------------------------------------------------------===//
const std::string &Name = "", Instruction *InsertBefore = 0)
: Instruction(Ty, iType, Name, InsertBefore) {
}
+ TerminatorInst(Instruction::TermOps iType, BasicBlock *InsertAtEnd);
public:
/// Terminators must implement the methods required by Instruction...
virtual void setSuccessor(unsigned idx, BasicBlock *B) = 0;
inline BasicBlock *getSuccessor(unsigned idx) {
- return (BasicBlock*)((const TerminatorInst *)this)->getSuccessor(idx);
+ const TerminatorInst *TI = this;
+ return const_cast<BasicBlock*>(TI->getSuccessor(idx));
}
// Methods for support type inquiry through isa, cast, and dyn_cast:
static Value* getNotArgument( BinaryOperator* Bop);
BinaryOps getOpcode() const {
- return (BinaryOps)Instruction::getOpcode();
+ return static_cast<BinaryOps>(Instruction::getOpcode());
}
virtual Instruction *clone() const {
}
};
+} // End llvm namespace
+
#endif