diff options
Diffstat (limited to 'contrib/llvm/lib/IR/BasicBlock.cpp')
-rw-r--r-- | contrib/llvm/lib/IR/BasicBlock.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/llvm/lib/IR/BasicBlock.cpp b/contrib/llvm/lib/IR/BasicBlock.cpp index 70ae3c3..77cb10d 100644 --- a/contrib/llvm/lib/IR/BasicBlock.cpp +++ b/contrib/llvm/lib/IR/BasicBlock.cpp @@ -362,12 +362,15 @@ BasicBlock *BasicBlock::splitBasicBlock(iterator I, const Twine &BBName) { BasicBlock *New = BasicBlock::Create(getContext(), BBName, getParent(), InsertBefore); + // Save DebugLoc of split point before invalidating iterator. + DebugLoc Loc = I->getDebugLoc(); // Move all of the specified instructions from the original basic block into // the new basic block. New->getInstList().splice(New->end(), this->getInstList(), I, end()); // Add a branch instruction to the newly formed basic block. - BranchInst::Create(New, this); + BranchInst *BI = BranchInst::Create(New, this); + BI->setDebugLoc(Loc); // Now we must loop through all of the successors of the New block (which // _were_ the successors of the 'this' block), and update any PHI nodes in |