DebugInfo: Fix another case of array access line information

llvm-svn: 223897
This commit is contained in:
David Blaikie 2014-12-10 01:16:09 +00:00
parent 96d7732b08
commit d85548d423
2 changed files with 13 additions and 0 deletions

View File

@ -2452,6 +2452,9 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E,
// Propagate the alignment from the array itself to the result.
ArrayAlignment = ArrayLV.getAlignment();
if (auto *DI = getDebugInfo())
DI->EmitLocation(Builder, E->getLocStart());
if (getLangOpts().isSignedOverflowDefined())
Address = Builder.CreateGEP(ArrayPtr, Args, "arrayidx");
else

View File

@ -81,6 +81,15 @@ void f7() {
src1())[src2()];
}
// CHECK-LABEL: define
void f8() {
int src1[1];
int src2();
#line 900
int x = ( // CHECK: load {{.*}} !dbg [[DBG_F8:!.*]]
src1)[src2()];
}
// CHECK: [[DBG_F1]] = metadata !{i32 100,
// CHECK: [[DBG_FOO_VALUE]] = metadata !{i32 200,
// CHECK: [[DBG_FOO_REF]] = metadata !{i32 202,
@ -91,3 +100,4 @@ void f7() {
// CHECK: [[DBG_F5]] = metadata !{i32 600,
// CHECK: [[DBG_F6]] = metadata !{i32 700,
// CHECK: [[DBG_F7]] = metadata !{i32 800,
// CHECK: [[DBG_F8]] = metadata !{i32 900,