[llvm-commits] [llvm] r109544 - /llvm/trunk/include/llvm/Support/CallSite.h
Gabor Greif
ggreif at gmail.com
Tue Jul 27 14:46:11 PDT 2010
Author: ggreif
Date: Tue Jul 27 16:46:11 2010
New Revision: 109544
URL: http://llvm.org/viewvc/llvm-project?rev=109544&view=rev
Log:
remove bogus assert, use static_cast for additional checking
left two new asserts commented out, because they would fire in clang, have to hunt those down first
Modified:
llvm/trunk/include/llvm/Support/CallSite.h
Modified: llvm/trunk/include/llvm/Support/CallSite.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CallSite.h?rev=109544&r1=109543&r2=109544&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/CallSite.h (original)
+++ llvm/trunk/include/llvm/Support/CallSite.h Tue Jul 27 16:46:11 2010
@@ -49,13 +49,12 @@
PointerIntPair<InstrTy*, 1, bool> I;
public:
CallSiteBase() : I(0, false) {}
- CallSiteBase(CallTy *CI) : I(reinterpret_cast<InstrTy*>(CI), true) {}
- CallSiteBase(InvokeTy *II) : I(reinterpret_cast<InstrTy*>(II), false) {}
+ CallSiteBase(CallTy *CI) : I(CI, true) { /*assert(CI);*/ }
+ CallSiteBase(InvokeTy *II) : I(II, false) { /*assert(II);*/ }
CallSiteBase(ValTy *II) { *this = get(II); }
CallSiteBase(InstrTy *II) {
assert(II && "Null instruction given?");
*this = get(II);
- assert(I.getPointer());
}
/// CallSiteBase::get - This static method is sort of like a constructor. It
@@ -66,9 +65,9 @@
static CallSiteBase get(ValTy *V) {
if (InstrTy *II = dyn_cast<InstrTy>(V)) {
if (II->getOpcode() == Instruction::Call)
- return CallSiteBase(reinterpret_cast<CallTy*>(II));
+ return CallSiteBase(static_cast<CallTy*>(II));
else if (II->getOpcode() == Instruction::Invoke)
- return CallSiteBase(reinterpret_cast<InvokeTy*>(II));
+ return CallSiteBase(static_cast<InvokeTy*>(II));
}
return CallSiteBase();
}
More information about the llvm-commits
mailing list