mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-25 10:38:44 +00:00
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109544 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
37032350c8
commit
a6758446b7
@ -49,13 +49,12 @@ protected:
|
|||||||
PointerIntPair<InstrTy*, 1, bool> I;
|
PointerIntPair<InstrTy*, 1, bool> I;
|
||||||
public:
|
public:
|
||||||
CallSiteBase() : I(0, false) {}
|
CallSiteBase() : I(0, false) {}
|
||||||
CallSiteBase(CallTy *CI) : I(reinterpret_cast<InstrTy*>(CI), true) {}
|
CallSiteBase(CallTy *CI) : I(CI, true) { /*assert(CI);*/ }
|
||||||
CallSiteBase(InvokeTy *II) : I(reinterpret_cast<InstrTy*>(II), false) {}
|
CallSiteBase(InvokeTy *II) : I(II, false) { /*assert(II);*/ }
|
||||||
CallSiteBase(ValTy *II) { *this = get(II); }
|
CallSiteBase(ValTy *II) { *this = get(II); }
|
||||||
CallSiteBase(InstrTy *II) {
|
CallSiteBase(InstrTy *II) {
|
||||||
assert(II && "Null instruction given?");
|
assert(II && "Null instruction given?");
|
||||||
*this = get(II);
|
*this = get(II);
|
||||||
assert(I.getPointer());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// CallSiteBase::get - This static method is sort of like a constructor. It
|
/// CallSiteBase::get - This static method is sort of like a constructor. It
|
||||||
@ -66,9 +65,9 @@ public:
|
|||||||
static CallSiteBase get(ValTy *V) {
|
static CallSiteBase get(ValTy *V) {
|
||||||
if (InstrTy *II = dyn_cast<InstrTy>(V)) {
|
if (InstrTy *II = dyn_cast<InstrTy>(V)) {
|
||||||
if (II->getOpcode() == Instruction::Call)
|
if (II->getOpcode() == Instruction::Call)
|
||||||
return CallSiteBase(reinterpret_cast<CallTy*>(II));
|
return CallSiteBase(static_cast<CallTy*>(II));
|
||||||
else if (II->getOpcode() == Instruction::Invoke)
|
else if (II->getOpcode() == Instruction::Invoke)
|
||||||
return CallSiteBase(reinterpret_cast<InvokeTy*>(II));
|
return CallSiteBase(static_cast<InvokeTy*>(II));
|
||||||
}
|
}
|
||||||
return CallSiteBase();
|
return CallSiteBase();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user