remove use of BasicBlock::getNext

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36205 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2007-04-17 18:09:47 +00:00
parent 97f89e688f
commit 261cdfbe5e
2 changed files with 6 additions and 3 deletions

View File

@ -129,7 +129,8 @@ bool llvm::SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P,
// Insert the block into the function... right after the block TI lives in. // Insert the block into the function... right after the block TI lives in.
Function &F = *TIBB->getParent(); 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 // 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. // merge incoming values from NewBB instead of from TIBB.

View File

@ -155,7 +155,8 @@ BasicBlock* LowerSwitch::switchConvert(CaseItr Begin, CaseItr End,
// left branch if it is and right branch if not. // left branch if it is and right branch if not.
Function* F = OrigBlock->getParent(); Function* F = OrigBlock->getParent();
BasicBlock* NewNode = new BasicBlock("NodeBlock"); 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"); ICmpInst* Comp = new ICmpInst(ICmpInst::ICMP_SLT, Val, Pivot.Low, "Pivot");
NewNode->getInstList().push_back(Comp); NewNode->getInstList().push_back(Comp);
@ -175,7 +176,8 @@ BasicBlock* LowerSwitch::newLeafBlock(CaseRange& Leaf, Value* Val,
{ {
Function* F = OrigBlock->getParent(); Function* F = OrigBlock->getParent();
BasicBlock* NewLeaf = new BasicBlock("LeafBlock"); BasicBlock* NewLeaf = new BasicBlock("LeafBlock");
F->getBasicBlockList().insert(OrigBlock->getNext(), NewLeaf); Function::iterator FI = OrigBlock;
F->getBasicBlockList().insert(++FI, NewLeaf);
// Emit comparison // Emit comparison
ICmpInst* Comp = NULL; ICmpInst* Comp = NULL;