[ASan] Collect unmangled names of global variables in Clang to print them in error...
commit4bc3d2f1b8539c01f9fda124764451720af65b56
authorAlexey Samsonov <vonosmas@gmail.com>
Sat, 12 Jul 2014 00:42:52 +0000 (12 00:42 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Sat, 12 Jul 2014 00:42:52 +0000 (12 00:42 +0000)
tree4860ed1a0278fcdb5f0ae9b31ab68f608e4675db
parent8a017a0ac65a43aae8a267af9803022a268e46ce
[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.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@212872 91177308-0d34-0410-b5e6-96231b3b80d8
test/asan/TestCases/global-location.cc