diff options
author | Chris Lattner <sabre@nondot.org> | 2003-09-22 22:35:39 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-09-22 22:35:39 +0000 |
commit | f98a08490801b8bc6e2006627d34095f5b8567c8 (patch) | |
tree | f3bc59eaf55d3db12340839b910e0d1183b7455d | |
parent | 4611f729c5051065db558737f2ee67816e9b9b2d (diff) | |
download | external_llvm-f98a08490801b8bc6e2006627d34095f5b8567c8.zip external_llvm-f98a08490801b8bc6e2006627d34095f5b8567c8.tar.gz external_llvm-f98a08490801b8bc6e2006627d34095f5b8567c8.tar.bz2 |
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
-rw-r--r-- | lib/Transforms/Utils/InlineFunction.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp index 72f02e2..8f69c1e 100644 --- a/lib/Transforms/Utils/InlineFunction.cpp +++ b/lib/Transforms/Utils/InlineFunction.cpp @@ -51,11 +51,16 @@ bool InlineFunction(CallSite CS) { BasicBlock *AfterCallBB; if (InvokeInst *II = dyn_cast<InvokeInst>(TheCall)) { - AfterCallBB = II->getNormalDest(); InvokeDest = II->getExceptionalDest(); // 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 // keep track of which values came into them from this invoke, then remove |