mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-27 14:34:58 +00:00
use ArgOperand API; introduce downcasted pointers into scope to facilitate this
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106734 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
aee5dc1939
commit
3ccbb22eaf
@ -123,14 +123,15 @@ static Value *getPointerOperand(Instruction *I) {
|
||||
if (StoreInst *SI = dyn_cast<StoreInst>(I))
|
||||
return SI->getPointerOperand();
|
||||
if (MemIntrinsic *MI = dyn_cast<MemIntrinsic>(I))
|
||||
return MI->getOperand(1);
|
||||
|
||||
switch (cast<IntrinsicInst>(I)->getIntrinsicID()) {
|
||||
return MI->getArgOperand(0);
|
||||
|
||||
IntrinsicInst *II = cast<IntrinsicInst>(I);
|
||||
switch (II->getIntrinsicID()) {
|
||||
default: assert(false && "Unexpected intrinsic!");
|
||||
case Intrinsic::init_trampoline:
|
||||
return I->getOperand(1);
|
||||
return II->getArgOperand(0);
|
||||
case Intrinsic::lifetime_end:
|
||||
return I->getOperand(2);
|
||||
return II->getArgOperand(1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -147,12 +148,13 @@ static unsigned getStoreSize(Instruction *I, const TargetData *TD) {
|
||||
if (MemIntrinsic *MI = dyn_cast<MemIntrinsic>(I)) {
|
||||
Len = MI->getLength();
|
||||
} else {
|
||||
switch (cast<IntrinsicInst>(I)->getIntrinsicID()) {
|
||||
IntrinsicInst *II = cast<IntrinsicInst>(I);
|
||||
switch (II->getIntrinsicID()) {
|
||||
default: assert(false && "Unexpected intrinsic!");
|
||||
case Intrinsic::init_trampoline:
|
||||
return -1u;
|
||||
case Intrinsic::lifetime_end:
|
||||
Len = I->getOperand(1);
|
||||
Len = II->getArgOperand(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user