aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/StackProtector.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2008-11-10 23:38:59 +0000
committerBill Wendling <isanbard@gmail.com>2008-11-10 23:38:59 +0000
commit22511ed2feeea786dba9fb5a07c0e6431dec0e32 (patch)
treed73352f8ec98c166f090a1dcc2697777d95100f0 /lib/CodeGen/StackProtector.cpp
parente4d783d584d22d7fcb4cba2a24e0f45f62ed8153 (diff)
Small simplification. Use the iterator already present as the insertion point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59008 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/StackProtector.cpp')
-rw-r--r--lib/CodeGen/StackProtector.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/StackProtector.cpp b/lib/CodeGen/StackProtector.cpp
index 386c7cd162..746addeba4 100644
--- a/lib/CodeGen/StackProtector.cpp
+++ b/lib/CodeGen/StackProtector.cpp
@@ -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);