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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22057 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2005-05-15 16:13:11 +00:00
parent 98a493c7ce
commit edd5d9ece1
8 changed files with 18 additions and 12 deletions

View File

@ -32,8 +32,8 @@ class CallSite {
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 @@ public:
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();
}