[llvm-commits] [llvm] r59008 - /llvm/trunk/lib/CodeGen/StackProtector.cpp
Bill Wendling
isanbard at gmail.com
Mon Nov 10 15:39:00 PST 2008
Author: void
Date: Mon Nov 10 17:38:59 2008
New Revision: 59008
URL: http://llvm.org/viewvc/llvm-project?rev=59008&view=rev
Log:
Small simplification. Use the iterator already present as the insertion point.
Modified:
llvm/trunk/lib/CodeGen/StackProtector.cpp
Modified: llvm/trunk/lib/CodeGen/StackProtector.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackProtector.cpp?rev=59008&r1=59007&r2=59008&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/StackProtector.cpp (original)
+++ llvm/trunk/lib/CodeGen/StackProtector.cpp Mon Nov 10 17:38:59 2008
@@ -148,16 +148,15 @@
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);
More information about the llvm-commits
mailing list