r226388 - DebugInfo: Attribute aggregate expressions to the source location of the expression
David Blaikie
dblaikie at gmail.com
Sat Jan 17 17:48:19 PST 2015
Author: dblaikie
Date: Sat Jan 17 19:48:19 2015
New Revision: 226388
URL: http://llvm.org/viewvc/llvm-project?rev=226388&view=rev
Log:
DebugInfo: Attribute aggregate expressions to the source location of the expression
Just as r225956 did for scalar expressions (CGExprScalar::Visit), do the
same for aggregate expressions.
Modified:
cfe/trunk/lib/CodeGen/CGExprAgg.cpp
cfe/trunk/test/CodeGenCXX/debug-info-line.cpp
Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=226388&r1=226387&r2=226388&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Sat Jan 17 19:48:19 2015
@@ -98,6 +98,11 @@ public:
// Visitor Methods
//===--------------------------------------------------------------------===//
+ void Visit(Expr *E) {
+ ApplyDebugLocation DL(CGF, E->getLocStart());
+ StmtVisitor<AggExprEmitter>::Visit(E);
+ }
+
void VisitStmt(Stmt *S) {
CGF.ErrorUnsupported(S, "aggregate expression");
}
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=226388&r1=226387&r2=226388&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-line.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-line.cpp Sat Jan 17 19:48:19 2015
@@ -166,23 +166,29 @@ void f13() {
F13_IMPL;
}
-struct f14 {
- f14(int);
+struct f14_impl {
+ f14_impl(int);
};
// CHECK-LABEL: define
struct f14_use {
-// CHECK: call {{.*}}, !dbg [[DBG_F14_CTOR_CALL:![0-9]*]]
+// CHECK: call {{.*}}f14_impl{{.*}}, !dbg [[DBG_F14_CTOR_CALL:![0-9]*]]
#line 1600
- f14 v
- =
- 1;
+ f14_impl v{//
+ 1};
f14_use();
};
f14_use::f14_use() = default;
// CHECK-LABEL: define
+void func(foo);
+void f15(foo *f) {
+ func(
+// CHECK: getelementptr {{.*}}, !dbg [[DBG_F15:![0-9]*]]
+#line 1700
+ f[3]);
+}
// CHECK: [[DBG_F1]] = !MDLocation(line: 100,
// CHECK: [[DBG_FOO_VALUE]] = !MDLocation(line: 200,
@@ -204,3 +210,4 @@ f14_use::f14_use() = default;
// CHECK: [[DBG_F12]] = !MDLocation(line: 1400,
// CHECK: [[DBG_F13]] = !MDLocation(line: 1500,
// CHECK: [[DBG_F14_CTOR_CALL]] = !MDLocation(line: 1600,
+// CHECK: [[DBG_F15]] = !MDLocation(line: 1700,
More information about the cfe-commits
mailing list