aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-07-12 00:42:52 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-07-12 00:42:52 +0000
commit15c96696150cc76a28e4aa51a109ef68476c3b5a (patch)
tree3b7d919d22ad549c245c88ad1f2d0b176a4c2068 /clang/lib/CodeGen/CGDecl.cpp
parentfc31efe95a9a220fb1a3f7a7dd8109fd2441d196 (diff)
downloadllvm-15c96696150cc76a28e4aa51a109ef68476c3b5a.zip
llvm-15c96696150cc76a28e4aa51a109ef68476c3b5a.tar.gz
llvm-15c96696150cc76a28e4aa51a109ef68476c3b5a.tar.bz2
[ASan] Collect unmangled names of global variables in Clang to print them in error reports.
Currently ASan instrumentation pass creates a string with global name for each instrumented global (to include global names in the error report). Global name is already mangled at this point, and we may not be able to demangle it at runtime (e.g. there is no __cxa_demangle on Android). Instead, create a string with fully qualified global name in Clang, and pass it to ASan instrumentation pass in llvm.asan.globals metadata. If there is no metadata for some global, ASan will use the original algorithm. This fixes https://code.google.com/p/address-sanitizer/issues/detail?id=264. llvm-svn: 212872
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 9bd61d7..91f8041 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -345,7 +345,7 @@ void CodeGenFunction::EmitStaticVarDecl(const VarDecl &D,
DMEntry = castedAddr;
CGM.setStaticLocalDeclAddress(&D, castedAddr);
- CGM.reportGlobalToASan(var, D.getLocation());
+ CGM.reportGlobalToASan(var, D);
// Emit global variable debug descriptor for static vars.
CGDebugInfo *DI = getDebugInfo();