r223854 - DebugInfo: Correct location of aggregate assignment
David Blaikie
dblaikie at gmail.com
Tue Dec 9 15:33:26 PST 2014
Author: dblaikie
Date: Tue Dec 9 17:33:26 2014
New Revision: 223854
URL: http://llvm.org/viewvc/llvm-project?rev=223854&view=rev
Log:
DebugInfo: Correct location of aggregate assignment
Modified:
cfe/trunk/lib/CodeGen/CGExprCXX.cpp
cfe/trunk/test/CodeGenCXX/debug-info-line.cpp
Modified: cfe/trunk/lib/CodeGen/CGExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprCXX.cpp?rev=223854&r1=223853&r2=223854&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprCXX.cpp Tue Dec 9 17:33:26 2014
@@ -187,6 +187,8 @@ RValue CodeGenFunction::EmitCXXMemberOrO
unsigned ArgsToSkip = isa<CXXOperatorCallExpr>(CE) ? 1 : 0;
llvm::Value *RHS =
EmitLValue(*(CE->arg_begin() + ArgsToSkip)).getAddress();
+ if (auto *DI = getDebugInfo())
+ DI->EmitLocation(Builder, CE->getLocStart());
EmitAggregateAssign(This, RHS, CE->getType());
return RValue::get(This);
}
Modified: cfe/trunk/test/CodeGenCXX/debug-info-line.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-line.cpp?rev=223854&r1=223853&r2=223854&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-line.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-line.cpp Tue Dec 9 17:33:26 2014
@@ -64,6 +64,17 @@ void f5() {
= complex_src();
}
+struct agg { int i; };
+agg agg_src();
+
+// CHECK-LABEL: define
+void f6() {
+ agg x;
+#line 700
+ x // CHECK: call void @llvm.memcpy{{.*}} !dbg [[DBG_F6:!.*]]
+ = agg_src();
+}
+
// CHECK: [[DBG_F1]] = metadata !{i32 100,
// CHECK: [[DBG_FOO_VALUE]] = metadata !{i32 200,
// CHECK: [[DBG_FOO_REF]] = metadata !{i32 202,
@@ -72,3 +83,4 @@ void f5() {
// CHECK: [[DBG_F3]] = metadata !{i32 400,
// CHECK: [[DBG_F4]] = metadata !{i32 500,
// CHECK: [[DBG_F5]] = metadata !{i32 600,
+// CHECK: [[DBG_F6]] = metadata !{i32 700,
More information about the cfe-commits
mailing list