Small simplification. Use the iterator already present as the insertion point.

llvm-svn: 59008
This commit is contained in:
Bill Wendling
2008-11-10 23:38:59 +00:00
parent b172c66af3
commit cfa3e287bb

View File

@@ -148,16 +148,15 @@ bool StackProtector::InsertStackProtectors() {
FailBB = CreateFailBB();
}
Function::iterator InsPt = BB; ++InsPt; // Insertion point for new BB.
++I; // Skip to the next block so that we don't resplit the return block.
// Split the basic block before the return instruction.
BasicBlock *NewBB = BB->splitBasicBlock(RI, "SP_return");
// Move the newly created basic block to the point right after the old basic
// block so that it's in the "fall through" position.
// Move the newly created basic block to the point right after the old
// basic block so that it's in the "fall through" position.
NewBB->removeFromParent();
F->getBasicBlockList().insert(InsPt, NewBB);
F->getBasicBlockList().insert(I, NewBB);
// Generate the stack protector instructions in the old basic block.
LoadInst *LI1 = new LoadInst(StackGuardVar, "", false, BB);