[llvm-commits] CVS: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp LowerSwitch.cpp
Chris Lattner
sabre at nondot.org
Tue Apr 17 11:10:05 PDT 2007
Changes in directory llvm/lib/Transforms/Utils:
BreakCriticalEdges.cpp updated: 1.43 -> 1.44
LowerSwitch.cpp updated: 1.37 -> 1.38
---
Log message:
remove use of BasicBlock::getNext
---
Diffs of the changes: (+6 -3)
BreakCriticalEdges.cpp | 3 ++-
LowerSwitch.cpp | 6 ++++--
2 files changed, 6 insertions(+), 3 deletions(-)
Index: llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
diff -u llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.43 llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.44
--- llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp:1.43 Sun Apr 15 03:47:27 2007
+++ llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp Tue Apr 17 13:09:47 2007
@@ -129,7 +129,8 @@
// Insert the block into the function... right after the block TI lives in.
Function &F = *TIBB->getParent();
- F.getBasicBlockList().insert(TIBB->getNext(), NewBB);
+ Function::iterator FBBI = TIBB;
+ F.getBasicBlockList().insert(++FBBI, NewBB);
// If there are any PHI nodes in DestBB, we need to update them so that they
// merge incoming values from NewBB instead of from TIBB.
Index: llvm/lib/Transforms/Utils/LowerSwitch.cpp
diff -u llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.37 llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.38
--- llvm/lib/Transforms/Utils/LowerSwitch.cpp:1.37 Mon Apr 16 13:10:23 2007
+++ llvm/lib/Transforms/Utils/LowerSwitch.cpp Tue Apr 17 13:09:47 2007
@@ -155,7 +155,8 @@
// left branch if it is and right branch if not.
Function* F = OrigBlock->getParent();
BasicBlock* NewNode = new BasicBlock("NodeBlock");
- F->getBasicBlockList().insert(OrigBlock->getNext(), NewNode);
+ Function::iterator FI = OrigBlock;
+ F->getBasicBlockList().insert(++FI, NewNode);
ICmpInst* Comp = new ICmpInst(ICmpInst::ICMP_SLT, Val, Pivot.Low, "Pivot");
NewNode->getInstList().push_back(Comp);
@@ -175,7 +176,8 @@
{
Function* F = OrigBlock->getParent();
BasicBlock* NewLeaf = new BasicBlock("LeafBlock");
- F->getBasicBlockList().insert(OrigBlock->getNext(), NewLeaf);
+ Function::iterator FI = OrigBlock;
+ F->getBasicBlockList().insert(++FI, NewLeaf);
// Emit comparison
ICmpInst* Comp = NULL;
More information about the llvm-commits
mailing list