Allow specifying the name for the newly split basic block
authorChris Lattner <sabre@nondot.org>
Sun, 24 Aug 2003 03:41:39 +0000 (03:41 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 24 Aug 2003 03:41:39 +0000 (03:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8097 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/BasicBlock.h
lib/VMCore/BasicBlock.cpp

index 893792656c8e66792ed90e54e465b0711f283679..103761a23eebff53102d6c072bb206ecf8ebd10a 100644 (file)
@@ -171,7 +171,7 @@ public:
   /// cause a degenerate basic block to be formed, having a terminator inside of
   /// the basic block).
   ///
-  BasicBlock *splitBasicBlock(iterator I);
+  BasicBlock *splitBasicBlock(iterator I, const std::string &BBName = "");
 };
 
 #endif
index d04e5546162620c2c6cccdab2f82ee2c4b8b707b..ac97ed386e1d4290217e1da89c70163bf687f9b5 100644 (file)
@@ -217,12 +217,12 @@ void BasicBlock::removePredecessor(BasicBlock *Pred) {
 // cause a degenerate basic block to be formed, having a terminator inside of
 // the basic block). 
 //
-BasicBlock *BasicBlock::splitBasicBlock(iterator I) {
+BasicBlock *BasicBlock::splitBasicBlock(iterator I, const std::string &BBName) {
   assert(getTerminator() && "Can't use splitBasicBlock on degenerate BB!");
   assert(I != InstList.end() && 
         "Trying to get me to create degenerate basic block!");
 
-  BasicBlock *New = new BasicBlock("", getParent());
+  BasicBlock *New = new BasicBlock(BBName, getParent());
 
   // Go from the end of the basic block through to the iterator pointer, moving
   // to the new basic block...