summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-12-10 01:03:48 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-12-10 01:03:48 +0000
commitf0aceb2f69cae1b84e1b96f1ae9932480e801b32 (patch)
tree2c443e544bece9e150438348cd2b30d5732193d2 /clang/lib/CodeGen/CGExpr.cpp
parentc67e1b6a2a33ea6b2f49c4cca99170af8107405e (diff)
downloadbcm5719-llvm-f0aceb2f69cae1b84e1b96f1ae9932480e801b32.tar.gz
bcm5719-llvm-f0aceb2f69cae1b84e1b96f1ae9932480e801b32.zip
DebugInfo: Correct the location of array accesses
Especially relevant to ASan when dealing with complex expressions containing multiple array accesses. See PR21737. llvm-svn: 223872
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 5eb04a4ddff..e7caf835ce2 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -2459,6 +2459,8 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E,
} else {
// The base must be a pointer, which is not an aggregate. Emit it.
llvm::Value *Base = EmitScalarExpr(E->getBase());
+ if (auto *DI = getDebugInfo())
+ DI->EmitLocation(Builder, E->getLocStart());
if (getLangOpts().isSignedOverflowDefined())
Address = Builder.CreateGEP(Base, Idx, "arrayidx");
else
OpenPOWER on IntegriCloud