Carry the debug information from single exit unified return block
along with the new insert point. Fixes PR10829 llvm-svn: 139416
This commit is contained in:
@@ -116,7 +116,8 @@ void CodeGenFunction::EmitReturnBlock() {
|
||||
dyn_cast<llvm::BranchInst>(*ReturnBlock.getBlock()->use_begin());
|
||||
if (BI && BI->isUnconditional() &&
|
||||
BI->getSuccessor(0) == ReturnBlock.getBlock()) {
|
||||
// Reset insertion point and delete the branch.
|
||||
// Reset insertion point, including debug location, and delete the branch.
|
||||
Builder.SetCurrentDebugLocation(BI->getDebugLoc());
|
||||
Builder.SetInsertPoint(BI->getParent());
|
||||
BI->eraseFromParent();
|
||||
delete ReturnBlock.getBlock();
|
||||
|
||||
Reference in New Issue
Block a user