diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-03-06 01:41:15 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-03-06 01:41:15 +0000 |
commit | 4e14b6588e441534f2b2fc806261a9fe126ae520 (patch) | |
tree | e9672c6ec0630baeb127d43834e24a2ceaf7c70d /lib/CodeGen/StackProtector.cpp | |
parent | 9b951559061c60e5dc9dfb51f7defe7b96ad31a3 (diff) | |
download | external_llvm-4e14b6588e441534f2b2fc806261a9fe126ae520.tar.gz external_llvm-4e14b6588e441534f2b2fc806261a9fe126ae520.tar.bz2 external_llvm-4e14b6588e441534f2b2fc806261a9fe126ae520.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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66234 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/StackProtector.cpp')
-rw-r--r-- | lib/CodeGen/StackProtector.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/CodeGen/StackProtector.cpp b/lib/CodeGen/StackProtector.cpp index 7c4d22df8b..c333acd42a 100644 --- a/lib/CodeGen/StackProtector.cpp +++ b/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); |