diff options
author | Bill Wendling <isanbard@gmail.com> | 2008-11-10 23:38:59 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2008-11-10 23:38:59 +0000 |
commit | cfa3e287bb4169ca8584a51e0ce20f71606395aa (patch) | |
tree | e9497c877c8581cccdcd31dc5520691fa60aa202 /llvm/lib/CodeGen/StackProtector.cpp | |
parent | b172c66af3635b5a376695cce4a12f7654268b5f (diff) | |
download | bcm5719-llvm-cfa3e287bb4169ca8584a51e0ce20f71606395aa.tar.gz bcm5719-llvm-cfa3e287bb4169ca8584a51e0ce20f71606395aa.zip |
Small simplification. Use the iterator already present as the insertion point.
llvm-svn: 59008
Diffstat (limited to 'llvm/lib/CodeGen/StackProtector.cpp')
-rw-r--r-- | llvm/lib/CodeGen/StackProtector.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/StackProtector.cpp b/llvm/lib/CodeGen/StackProtector.cpp index 386c7cd162a..746addeba44 100644 --- a/llvm/lib/CodeGen/StackProtector.cpp +++ b/llvm/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); |