summaryrefslogtreecommitdiffstats
path: root/clang/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
commit65c5c9132f700a79619aa2bc339acc8896a8b48b (patch)
tree945fcdbd1ad1333fdb166f8c24a909c216ef5bc2 /clang/lib/CodeGen/CodeGenFunction.cpp
parent29cfe6c3683f2a80e28e3735bfb3955504d3cdd9 (diff)
downloadbcm5719-llvm-65c5c9132f700a79619aa2bc339acc8896a8b48b.tar.gz
bcm5719-llvm-65c5c9132f700a79619aa2bc339acc8896a8b48b.zip
Carry the debug information from single exit unified return block
along with the new insert point. Fixes PR10829 llvm-svn: 139416
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 7e8415bb268..a16f10e6541 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/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();
OpenPOWER on IntegriCloud