Small simplification. Use the iterator already present as the insertion point.
authorBill Wendling <isanbard@gmail.com>
Mon, 10 Nov 2008 23:38:59 +0000 (23:38 +0000)
committerBill Wendling <isanbard@gmail.com>
Mon, 10 Nov 2008 23:38:59 +0000 (23:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59008 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/StackProtector.cpp

index 386c7cd162a157ce277e981a8962c03a95eab432..746addeba44e41d1f4c872cebcf5c39c5f396fdf 100644 (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);