mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
A BB that unwind_to an "unwind" inst is that same as one that doesn't unwind_to
at all. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48096 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1370,7 +1370,7 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
|
|||||||
new UnwindInst(Pred); // Use unwind.
|
new UnwindInst(Pred); // Use unwind.
|
||||||
Changed = true;
|
Changed = true;
|
||||||
}
|
}
|
||||||
} else if (InvokeInst *II = dyn_cast<InvokeInst>(Pred->getTerminator()))
|
} else if (InvokeInst *II = dyn_cast<InvokeInst>(Pred->getTerminator())) {
|
||||||
if (II->getUnwindDest() == BB) {
|
if (II->getUnwindDest() == BB) {
|
||||||
// Insert a new branch instruction before the invoke, because this
|
// Insert a new branch instruction before the invoke, because this
|
||||||
// is now a fall through...
|
// is now a fall through...
|
||||||
@@ -1388,6 +1388,9 @@ bool llvm::SimplifyCFG(BasicBlock *BB) {
|
|||||||
delete II;
|
delete II;
|
||||||
Changed = true;
|
Changed = true;
|
||||||
}
|
}
|
||||||
|
} else if (Pred->getUnwindDest() == BB) {
|
||||||
|
Pred->setUnwindDest(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
Preds.pop_back();
|
Preds.pop_back();
|
||||||
}
|
}
|
||||||
|
@@ -33,3 +33,11 @@ bb4: unwind_to %cleanup
|
|||||||
cleanup:
|
cleanup:
|
||||||
ret i32 1
|
ret i32 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
define i32 @f3() {
|
||||||
|
entry: unwind_to %cleanup
|
||||||
|
call void @g(i32 0)
|
||||||
|
ret i32 0
|
||||||
|
cleanup:
|
||||||
|
unwind
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user