diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-12-10 01:34:25 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-12-10 01:34:25 +0000 |
commit | 7c5da41c70041cd3a388454f71a6faaeaf77adce (patch) | |
tree | eec90b42d4d1d61f9f2f08438bd9e4e789bbbfdd /clang/lib/CodeGen | |
parent | 859e4b5da12ec670e5237663fbe77e9dc37f4aab (diff) | |
download | bcm5719-llvm-7c5da41c70041cd3a388454f71a6faaeaf77adce.tar.gz bcm5719-llvm-7c5da41c70041cd3a388454f71a6faaeaf77adce.zip |
DebugInfo: Correct location information for array accesses to elements of variable array type.
llvm-svn: 223902
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index ca06e852d0f..9348b174620 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -2407,6 +2407,9 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E, // The element count here is the total number of non-VLA elements. llvm::Value *numElements = getVLASize(vla).first; + if (auto *DI = getDebugInfo()) + DI->EmitLocation(Builder, E->getLocStart()); + // Effectively, the multiply by the VLA size is part of the GEP. // GEP indexes are signed, and scaling an index isn't permitted to // signed-overflow, so we use the same semantics for our explicit |