// Make sure that any clients of this file link in PostDominators.cpp
static IncludeFile
-FIND_USED_TYPES_INCLUDE_FILE((void*)&FindUsedTypes::stub);
+FIND_USED_TYPES_INCLUDE_FILE(reinterpret_cast<void*>(&FindUsedTypes::stub));
} // End llvm namespace
/// block is in no loop (for example the entry node), null is returned.
///
Loop *getLoopFor(const BasicBlock *BB) const {
- std::map<BasicBlock *, Loop*>::const_iterator I=BBMap.find((BasicBlock*)BB);
+ std::map<BasicBlock *, Loop*>::const_iterator I=
+ BBMap.find(const_cast<BasicBlock*>(BB));
return I != BBMap.end() ? I->second : 0;
}
// Make sure that any clients of this file link in LoopInfo.cpp
static IncludeFile
-LOOP_INFO_INCLUDE_FILE((void*)&LoopInfo::stub);
+LOOP_INFO_INCLUDE_FILE(reinterpret_cast<void*>(&LoopInfo::stub));
// Allow clients to walk the list of nested loops...
template <> struct GraphTraits<const Loop*> {
struct AssemblyAnnotationWriter {
+ virtual ~AssemblyAnnotationWriter();
+
// emitFunctionAnnot - This may be implemented to emit a string right before
// the start of a function.
virtual void emitFunctionAnnot(const Function *F, std::ostream &OS) {}
/// getNumParams - Return the number of fixed parameters this function type
/// requires. This does not consider varargs.
///
- unsigned getNumParams() const { return (unsigned)ContainedTys.size()-1; }
+ unsigned getNumParams() const { return unsigned(ContainedTys.size()-1); }
// Implement the AbstractTypeUser interface.
virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
element_iterator element_end() const { return ContainedTys.end(); }
// Random access to the elements
- unsigned getNumElements() const { return (unsigned)ContainedTys.size(); }
+ unsigned getNumElements() const { return unsigned(ContainedTys.size()); }
const Type *getElementType(unsigned N) const {
assert(N < ContainedTys.size() && "Element number out of range!");
return ContainedTys[N];
/// if it is a direct call. If it is a call through a function pointer,
/// return null.
Function *getCalledFunction() const {
- return (Function*)dyn_cast<Function>(getOperand(0));
+ return static_cast<Function*>(dyn_cast<Function>(getOperand(0)));
}
// getCalledValue - Get a pointer to a method that is invoked by this inst.
// successor.
inline ConstantInt *getSuccessorValue(unsigned idx) const {
assert(idx < getNumSuccessors() && "Successor # out of range!");
- return (ConstantInt*)getOperand(idx*2);
+ return reinterpret_cast<ConstantInt*>(getOperand(idx*2));
}
// Methods for support type inquiry through isa, cast, and dyn_cast:
Instruction *I;
public:
CallSite() : I(0) {}
- CallSite(CallInst *CI) : I((Instruction*)CI) {}
- CallSite(InvokeInst *II) : I((Instruction*)II) {}
+ CallSite(CallInst *CI) : I(reinterpret_cast<Instruction*>(CI)) {}
+ CallSite(InvokeInst *II) : I(reinterpret_cast<Instruction*>(II)) {}
CallSite(const CallSite &CS) : I(CS.I) {}
CallSite &operator=(const CallSite &CS) { I = CS.I; return *this; }
static CallSite get(Value *V) {
if (Instruction *I = dyn_cast<Instruction>(V)) {
if (I->getOpcode() == Instruction::Call)
- return CallSite((CallInst*)I);
+ return CallSite(reinterpret_cast<CallInst*>(I));
else if (I->getOpcode() == Instruction::Invoke)
- return CallSite((InvokeInst*)I);
+ return CallSite(reinterpret_cast<InvokeInst*>(I));
}
return CallSite();
}
inline bool isEmpty() const { return pmap.empty() && tmap.empty(); }
/// @brief The number of name/type pairs is returned.
- inline unsigned num_types() const { return (unsigned)tmap.size(); }
+ inline unsigned num_types() const { return unsigned(tmap.size()); }
/// Given a base name, return a string that is either equal to it or
/// derived from it that does not already occur in the symbol table
namespace llvm {
+// Make virtual table appear in this compilation unit.
+AssemblyAnnotationWriter::~AssemblyAnnotationWriter() {}
+
/// This class provides computation of slot numbers for LLVM Assembly writing.
/// @brief LLVM Assembly Writing Slot Computation.
class SlotMachine {