summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.h
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/CodeGenModule.h
parentfc31efe95a9a220fb1a3f7a7dd8109fd2441d196 (diff)
downloadbcm5719-llvm-15c96696150cc76a28e4aa51a109ef68476c3b5a.tar.gz
bcm5719-llvm-15c96696150cc76a28e4aa51a109ef68476c3b5a.zip
[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/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index 34254697467..d6b694a8824 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -1015,8 +1015,10 @@ public:
return SanitizerBL;
}
- void reportGlobalToASan(llvm::GlobalVariable *GV, SourceLocation Loc,
+ void reportGlobalToASan(llvm::GlobalVariable *GV, const VarDecl &D,
bool IsDynInit = false);
+ void reportGlobalToASan(llvm::GlobalVariable *GV, SourceLocation Loc,
+ StringRef Name, bool IsDynInit = false);
void addDeferredVTable(const CXXRecordDecl *RD) {
DeferredVTables.push_back(RD);
OpenPOWER on IntegriCloud