From: David Blaikie Date: Sun, 18 Jan 2015 01:57:54 +0000 (+0000) Subject: DebugInfo: Attribute complex expressions to the source location of the expression X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae2ddc8cbf4fbe1d70473ba333d258ae340e4910;p=clang DebugInfo: Attribute complex expressions to the source location of the expression Just as r225956 did for scalar expressions (CGExprScalar::Visit), do the same for complex expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226390 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp index 1580bbe6a2..2cbd42b7ee 100644 --- a/lib/CodeGen/CGExprComplex.cpp +++ b/lib/CodeGen/CGExprComplex.cpp @@ -95,6 +95,7 @@ public: //===--------------------------------------------------------------------===// ComplexPairTy Visit(Expr *E) { + ApplyDebugLocation DL(CGF, E->getLocStart()); return StmtVisitor::Visit(E); } diff --git a/test/CodeGenCXX/debug-info-line.cpp b/test/CodeGenCXX/debug-info-line.cpp index 8278b1d53f..36b7a94a51 100644 --- a/test/CodeGenCXX/debug-info-line.cpp +++ b/test/CodeGenCXX/debug-info-line.cpp @@ -181,6 +181,7 @@ struct f14_use { f14_use::f14_use() = default; +// CHECK-LABEL: define // CHECK-LABEL: define void func(foo); void f15(foo *f) { @@ -190,6 +191,14 @@ void f15(foo *f) { f[3]); } +// CHECK-LABEL: define +void f16(__complex float f) { + __complex float g = // +// CHECK: add {{.*}}, !dbg [[DBG_F16:![0-9]*]] +#line 1800 + f + 1; +} + // CHECK: [[DBG_F1]] = !MDLocation(line: 100, // CHECK: [[DBG_FOO_VALUE]] = !MDLocation(line: 200, // CHECK: [[DBG_FOO_REF]] = !MDLocation(line: 202, @@ -211,3 +220,4 @@ void f15(foo *f) { // CHECK: [[DBG_F13]] = !MDLocation(line: 1500, // CHECK: [[DBG_F14_CTOR_CALL]] = !MDLocation(line: 1600, // CHECK: [[DBG_F15]] = !MDLocation(line: 1700, +// CHECK: [[DBG_F16]] = !MDLocation(line: 1800,