[llvm-commits] CVS: llvm/lib/Transforms/Utils/InlineFunction.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Sep 22 17:36:01 PDT 2003


Changes in directory llvm/lib/Transforms/Utils:

InlineFunction.cpp updated: 1.9 -> 1.10

---
Log message:

Fix bug: Inline/2003-09-22-PHINodesInNormalInvokeDest.ll


---
Diffs of the changes:

Index: llvm/lib/Transforms/Utils/InlineFunction.cpp
diff -u llvm/lib/Transforms/Utils/InlineFunction.cpp:1.9 llvm/lib/Transforms/Utils/InlineFunction.cpp:1.10
--- llvm/lib/Transforms/Utils/InlineFunction.cpp:1.9	Mon Sep 22 16:59:27 2003
+++ llvm/lib/Transforms/Utils/InlineFunction.cpp	Mon Sep 22 17:35:39 2003
@@ -51,11 +51,16 @@
   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





More information about the llvm-commits mailing list