mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
Finally land the InvokeInst operand reordering.
I have audited all getOperandNo calls now, fixing hidden assumptions. CallSite related uglyness will be eliminated successively. Note this patch has a long and griveous history, for all the back-and-forths have a look at CallSite.h's log. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99399 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -352,7 +352,7 @@ DAE::Liveness DAE::SurveyUse(Value::use_iterator U, UseVector &MaybeLiveUses,
|
||||
// argument, since if it was the function argument this would be an
|
||||
// indirect call and the we know can't be looking at a value of the
|
||||
// label type (for the invoke instruction).
|
||||
unsigned ArgNo = CS.getArgumentNo(U.getOperandNo());
|
||||
unsigned ArgNo = CS.getArgumentNo(U);
|
||||
|
||||
if (ArgNo >= F->getFunctionType()->getNumParams())
|
||||
// The value is passed in through a vararg! Must be live.
|
||||
|
@@ -168,7 +168,7 @@ bool PruneEH::SimplifyFunction(Function *F) {
|
||||
for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
|
||||
if (InvokeInst *II = dyn_cast<InvokeInst>(BB->getTerminator()))
|
||||
if (II->doesNotThrow()) {
|
||||
SmallVector<Value*, 8> Args(II->op_begin()+3, II->op_end());
|
||||
SmallVector<Value*, 8> Args(II->op_begin(), II->op_end() - 3);
|
||||
// Insert a call instruction before the invoke.
|
||||
CallInst *Call = CallInst::Create(II->getCalledValue(),
|
||||
Args.begin(), Args.end(), "", II);
|
||||
|
Reference in New Issue
Block a user