-//===-- llvm/InstrTypes.h - Important Instruction subclasses -----*- C++ -*--=//
+//===-- llvm/InstrTypes.h - Important Instruction subclasses ----*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
//
// This file defines various meta classes of instructions that exist in the VM
// representation. Specific concrete subclasses of these may be found in the
#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 {
/// swapOperands - Exchange the two operands to this instruction.
/// This instruction is safe to use on any binary instruction and
/// does not modify the semantics of the instruction. If the
- /// instruction is order dependant (SetLT f.e.) the opcode is
+ /// instruction is order dependent (SetLT f.e.) the opcode is
/// changed. If the instruction cannot be reversed (ie, it's a Div),
/// then return true.
///
}
};
+} // End llvm namespace
+
#endif