mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 16:17:17 +00:00
Fix bug: Inline/2003-09-22-PHINodesInNormalInvokeDest.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8666 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -51,11 +51,16 @@ bool InlineFunction(CallSite CS) {
|
|||||||
BasicBlock *AfterCallBB;
|
BasicBlock *AfterCallBB;
|
||||||
|
|
||||||
if (InvokeInst *II = dyn_cast<InvokeInst>(TheCall)) {
|
if (InvokeInst *II = dyn_cast<InvokeInst>(TheCall)) {
|
||||||
AfterCallBB = II->getNormalDest();
|
|
||||||
InvokeDest = II->getExceptionalDest();
|
InvokeDest = II->getExceptionalDest();
|
||||||
|
|
||||||
// Add an unconditional branch to make this look like the CallInst case...
|
// Add an unconditional branch to make this look like the CallInst case...
|
||||||
new BranchInst(AfterCallBB, TheCall);
|
BranchInst *NewBr = new BranchInst(II->getNormalDest(), TheCall);
|
||||||
|
|
||||||
|
// Split the basic block. This guarantees that no PHI nodes will have to be
|
||||||
|
// updated due to new incoming edges, and make the invoke case more
|
||||||
|
// symmetric to the call case.
|
||||||
|
AfterCallBB = OrigBB->splitBasicBlock(NewBr,
|
||||||
|
CalledFunc->getName()+".entry");
|
||||||
|
|
||||||
// If there are PHI nodes in the exceptional destination block, we need to
|
// If there are PHI nodes in the exceptional destination block, we need to
|
||||||
// keep track of which values came into them from this invoke, then remove
|
// keep track of which values came into them from this invoke, then remove
|
||||||
|
Reference in New Issue
Block a user