[llvm-commits] CVS: llvm/include/llvm/Support/CallSite.h

Reid Spencer reid at x10sys.com
Sun May 15 09:13:24 PDT 2005



Changes in directory llvm/include/llvm/Support:

CallSite.h updated: 1.19 -> 1.20
---
Log message:

Some cleanups for compilation with GCC 4.0.0 to remove warnings:
* Use C++ style casts, not C style casts
* Abstract base classes should have virtual destructor.


---
Diffs of the changes:  (+4 -4)

 CallSite.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)


Index: llvm/include/llvm/Support/CallSite.h
diff -u llvm/include/llvm/Support/CallSite.h:1.19 llvm/include/llvm/Support/CallSite.h:1.20
--- llvm/include/llvm/Support/CallSite.h:1.19	Fri May  6 15:26:26 2005
+++ llvm/include/llvm/Support/CallSite.h	Sun May 15 11:13:11 2005
@@ -32,8 +32,8 @@
   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; }
 
@@ -45,9 +45,9 @@
   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();
   }






More information about the llvm-commits mailing list