aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-09-09 21:53:04 +0000
committerEric Christopher <echristo@apple.com>2011-09-09 21:53:04 +0000
commitacae01124151392a842bd6c37bd01b1ad56d6b4d (patch)
treee48ba74f8d02cf6d2e9e336d97cce9b8d1ab7800 /lib/CodeGen/CodeGenFunction.cpp
parent359427794704666ff7a5a933ace11c5256fa3af7 (diff)
Carry the debug information from single exit unified return block
along with the new insert point. Fixes PR10829 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139416 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index 7e8415bb26..a16f10e654 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -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();