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
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();
--- /dev/null
+// RUN: %clang_cc1 -g -S -emit-llvm %s -o - | FileCheck %s
+
+void func(char c, char* d)
+{
+ *d = c + 1;
+ return;
+
+
+
+
+
+
+}
+
+// CHECK: ret void, !dbg !19
+// CHECK: !19 = metadata !{i32 6,