DebugInfo: Correct the line location of geps on array accesses

llvm-svn: 227023
This commit is contained in:
David Blaikie 2015-01-24 23:35:17 +00:00
parent d201099177
commit 2d321fb79d
2 changed files with 10 additions and 0 deletions

View File

@ -807,6 +807,7 @@ LValue CodeGenFunction::EmitCheckedLValue(const Expr *E, TypeCheckKind TCK) {
/// 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");

View File

@ -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,