summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/StackProtector.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-03-06 01:41:15 +0000
committerBill Wendling <isanbard@gmail.com>2009-03-06 01:41:15 +0000
commit6d8472b9cc39e0937be4ce02df6d25925fcf7b34 (patch)
tree8c1107136afdea7639aae073394c9e6452ffdcad /llvm/lib/CodeGen/StackProtector.cpp
parentfc507a1f9c073fe1e7d7a557f0a8f6be5a05c72c (diff)
downloadbcm5719-llvm-6d8472b9cc39e0937be4ce02df6d25925fcf7b34.tar.gz
bcm5719-llvm-6d8472b9cc39e0937be4ce02df6d25925fcf7b34.zip
When we split a basic block, there's a default branch to the newly created BB.
Delete this default branch, because we're going to generate our own. llvm-svn: 66234
Diffstat (limited to 'llvm/lib/CodeGen/StackProtector.cpp')
-rw-r--r--llvm/lib/CodeGen/StackProtector.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/StackProtector.cpp b/llvm/lib/CodeGen/StackProtector.cpp
index 7c4d22df8bf..c333acd42a8 100644
--- a/llvm/lib/CodeGen/StackProtector.cpp
+++ b/llvm/lib/CodeGen/StackProtector.cpp
@@ -191,6 +191,9 @@ bool StackProtector::InsertStackProtectors() {
// Split the basic block before the return instruction.
BasicBlock *NewBB = BB->splitBasicBlock(RI, "SP_return");
+ // Remove default branch instruction to the new BB.
+ BB->getTerminator()->eraseFromParent();
+
// 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->moveAfter(BB);
OpenPOWER on IntegriCloud