r227023 - DebugInfo: Correct the line location of geps on array accesses

David Blaikie dblaikie at gmail.com
Sat Jan 24 15:35:17 PST 2015


Author: dblaikie
Date: Sat Jan 24 17:35:17 2015
New Revision: 227023

URL: http://llvm.org/viewvc/llvm-project?rev=227023&view=rev
Log:
DebugInfo: Correct the line location of geps on array accesses

Modified:
    cfe/trunk/lib/CodeGen/CGExpr.cpp
    cfe/trunk/test/CodeGenCXX/debug-info-line.cpp

Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=227023&r1=227022&r2=227023&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Sat Jan 24 17:35:17 2015
@@ -807,6 +807,7 @@ LValue CodeGenFunction::EmitCheckedLValu
 /// length type, this is not possible.
 ///
 LValue CodeGenFunction::EmitLValue(const Expr *E) {
+  ApplyDebugLocation DL(*this, E->getLocStart());
   switch (E->getStmtClass()) {
   default: return EmitUnsupportedLValue(E, "l-value 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=227023&r1=227022&r2=227023&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-line.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-line.cpp Sat Jan 24 17:35:17 2015
@@ -199,6 +199,14 @@ void f16(__complex float f) {
       f + 1;
 }
 
+// CHECK-LABEL: define
+void f17(int *x) {
+  1,
+// CHECK: getelementptr {{.*}}, !dbg [[DBG_F17:![0-9]*]]
+#line 1900
+      x[1];
+}
+
 // CHECK: [[DBG_F1]] = !MDLocation(line: 100,
 // CHECK: [[DBG_FOO_VALUE]] = !MDLocation(line: 200,
 // CHECK: [[DBG_FOO_REF]] = !MDLocation(line: 202,
@@ -221,3 +229,4 @@ void f16(__complex float f) {
 // CHECK: [[DBG_F14_CTOR_CALL]] = !MDLocation(line: 1600,
 // CHECK: [[DBG_F15]] = !MDLocation(line: 1700,
 // CHECK: [[DBG_F16]] = !MDLocation(line: 1800,
+// CHECK: [[DBG_F17]] = !MDLocation(line: 1900,





More information about the cfe-commits mailing list