File tree Expand file tree Collapse file tree 8 files changed +18
-12
lines changed Expand file tree Collapse file tree 8 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ class FindUsedTypes : public ModulePass {
60
60
61
61
// Make sure that any clients of this file link in PostDominators.cpp
62
62
static IncludeFile
63
- FIND_USED_TYPES_INCLUDE_FILE (( void *) &FindUsedTypes::stub);
63
+ FIND_USED_TYPES_INCLUDE_FILE (reinterpret_cast < void *>( &FindUsedTypes::stub) );
64
64
65
65
} // End llvm namespace
66
66
Original file line number Diff line number Diff line change @@ -230,7 +230,8 @@ class LoopInfo : public FunctionPass {
230
230
// / block is in no loop (for example the entry node), null is returned.
231
231
// /
232
232
Loop *getLoopFor (const BasicBlock *BB) const {
233
- std::map<BasicBlock *, Loop*>::const_iterator I=BBMap.find ((BasicBlock*)BB);
233
+ std::map<BasicBlock *, Loop*>::const_iterator I=
234
+ BBMap.find (const_cast <BasicBlock*>(BB));
234
235
return I != BBMap.end () ? I->second : 0 ;
235
236
}
236
237
@@ -300,7 +301,7 @@ class LoopInfo : public FunctionPass {
300
301
301
302
// Make sure that any clients of this file link in LoopInfo.cpp
302
303
static IncludeFile
303
- LOOP_INFO_INCLUDE_FILE (( void *) &LoopInfo::stub);
304
+ LOOP_INFO_INCLUDE_FILE (reinterpret_cast < void *>( &LoopInfo::stub) );
304
305
305
306
// Allow clients to walk the list of nested loops...
306
307
template <> struct GraphTraits <const Loop*> {
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ class Instruction;
27
27
28
28
struct AssemblyAnnotationWriter {
29
29
30
+ virtual ~AssemblyAnnotationWriter ();
31
+
30
32
// emitFunctionAnnot - This may be implemented to emit a string right before
31
33
// the start of a function.
32
34
virtual void emitFunctionAnnot (const Function *F, std::ostream &OS) {}
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ class FunctionType : public DerivedType {
141
141
// / getNumParams - Return the number of fixed parameters this function type
142
142
// / requires. This does not consider varargs.
143
143
// /
144
- unsigned getNumParams () const { return ( unsigned ) ContainedTys.size ()-1 ; }
144
+ unsigned getNumParams () const { return unsigned ( ContainedTys.size ()-1 ) ; }
145
145
146
146
// Implement the AbstractTypeUser interface.
147
147
virtual void refineAbstractType (const DerivedType *OldTy, const Type *NewTy);
@@ -207,7 +207,7 @@ class StructType : public CompositeType {
207
207
element_iterator element_end () const { return ContainedTys.end (); }
208
208
209
209
// Random access to the elements
210
- unsigned getNumElements () const { return ( unsigned ) ContainedTys.size (); }
210
+ unsigned getNumElements () const { return unsigned ( ContainedTys.size () ); }
211
211
const Type *getElementType (unsigned N) const {
212
212
assert (N < ContainedTys.size () && " Element number out of range!" );
213
213
return ContainedTys[N];
Original file line number Diff line number Diff line change @@ -519,7 +519,7 @@ class CallInst : public Instruction {
519
519
// / if it is a direct call. If it is a call through a function pointer,
520
520
// / return null.
521
521
Function *getCalledFunction () const {
522
- return ( Function*) dyn_cast<Function>(getOperand (0 ));
522
+ return static_cast < Function*>( dyn_cast<Function>(getOperand (0 ) ));
523
523
}
524
524
525
525
// getCalledValue - Get a pointer to a method that is invoked by this inst.
@@ -1153,7 +1153,7 @@ class SwitchInst : public TerminatorInst {
1153
1153
// successor.
1154
1154
inline ConstantInt *getSuccessorValue (unsigned idx) const {
1155
1155
assert (idx < getNumSuccessors () && " Successor # out of range!" );
1156
- return ( ConstantInt*) getOperand (idx*2 );
1156
+ return reinterpret_cast < ConstantInt*>( getOperand (idx*2 ) );
1157
1157
}
1158
1158
1159
1159
// Methods for support type inquiry through isa, cast, and dyn_cast:
Original file line number Diff line number Diff line change @@ -32,8 +32,8 @@ class CallSite {
32
32
Instruction *I;
33
33
public:
34
34
CallSite () : I(0 ) {}
35
- CallSite (CallInst *CI) : I(( Instruction*)CI ) {}
36
- CallSite (InvokeInst *II) : I(( Instruction*)II ) {}
35
+ CallSite (CallInst *CI) : I(reinterpret_cast < Instruction*>(CI) ) {}
36
+ CallSite (InvokeInst *II) : I(reinterpret_cast < Instruction*>(II) ) {}
37
37
CallSite (const CallSite &CS) : I(CS.I) {}
38
38
CallSite &operator =(const CallSite &CS) { I = CS.I ; return *this ; }
39
39
@@ -45,9 +45,9 @@ class CallSite {
45
45
static CallSite get (Value *V) {
46
46
if (Instruction *I = dyn_cast<Instruction>(V)) {
47
47
if (I->getOpcode () == Instruction::Call)
48
- return CallSite (( CallInst*)I );
48
+ return CallSite (reinterpret_cast < CallInst*>(I) );
49
49
else if (I->getOpcode () == Instruction::Invoke)
50
- return CallSite (( InvokeInst*)I );
50
+ return CallSite (reinterpret_cast < InvokeInst*>(I) );
51
51
}
52
52
return CallSite ();
53
53
}
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ class SymbolTable : public AbstractTypeUser {
108
108
inline bool isEmpty () const { return pmap.empty () && tmap.empty (); }
109
109
110
110
// / @brief The number of name/type pairs is returned.
111
- inline unsigned num_types () const { return ( unsigned ) tmap.size (); }
111
+ inline unsigned num_types () const { return unsigned ( tmap.size () ); }
112
112
113
113
// / Given a base name, return a string that is either equal to it or
114
114
// / derived from it that does not already occur in the symbol table
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ using namespace llvm;
34
34
35
35
namespace llvm {
36
36
37
+ // Make virtual table appear in this compilation unit.
38
+ AssemblyAnnotationWriter::~AssemblyAnnotationWriter () {}
39
+
37
40
// / This class provides computation of slot numbers for LLVM Assembly writing.
38
41
// / @brief LLVM Assembly Writing Slot Computation.
39
42
class SlotMachine {
You can’t perform that action at this time.
0 commit comments