summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-09-22 22:35:39 +0000
committerChris Lattner <sabre@nondot.org>2003-09-22 22:35:39 +0000
commitd6002b8e15e87610169e8c3988a3b0e6fa5d3850 (patch)
tree17cedb89303850a712d5eab613f99fc3e8f5129e /llvm/lib/Transforms/Utils/InlineFunction.cpp
parent8f36a47acc12897201c69974cfa1461b76244f88 (diff)
downloadbcm5719-llvm-d6002b8e15e87610169e8c3988a3b0e6fa5d3850.tar.gz
bcm5719-llvm-d6002b8e15e87610169e8c3988a3b0e6fa5d3850.zip
Fix bug: Inline/2003-09-22-PHINodesInNormalInvokeDest.ll
llvm-svn: 8666
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index 72f02e2d84f..8f69c1ee161 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud