When splitting a basic block, insert the new half immediately after the first
authorChris Lattner <sabre@nondot.org>
Wed, 4 Feb 2004 03:21:31 +0000 (03:21 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 4 Feb 2004 03:21:31 +0000 (03:21 +0000)
half.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11110 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/BasicBlock.cpp

index c83b316672cd8f7608071b3c8ac3dd0bed33ff97..04f2034e9e2d0292dc7eb18eeba0db06792693d6 100644 (file)
@@ -231,7 +231,7 @@ BasicBlock *BasicBlock::splitBasicBlock(iterator I, const std::string &BBName) {
   assert(I != InstList.end() && 
         "Trying to get me to create degenerate basic block!");
 
-  BasicBlock *New = new BasicBlock(BBName, getParent());
+  BasicBlock *New = new BasicBlock(BBName, getNext());
 
   // Move all of the specified instructions from the original basic block into
   // the new basic block.