summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-07-18 17:50:06 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-07-18 17:50:06 +0000
commit6c12414358031407667b75657b9d768080f16409 (patch)
treefdca701ab7a2c9095e7d95de449b704f5347caed /clang/lib/CodeGen/CodeGenModule.h
parent54502402193e5d58a450dd7d8b30c46ae9bbe484 (diff)
downloadbcm5719-llvm-6c12414358031407667b75657b9d768080f16409.tar.gz
bcm5719-llvm-6c12414358031407667b75657b9d768080f16409.zip
Make sure globals created by UBSan are not instrumented by ASan.
Summary: This change adds description of globals created by UBSan instrumentation (UBSan handlers, type descriptors, filenames) to llvm.asan.globals metadata, effectively "blacklisting" them. This can dramatically decrease the data section in binaries built with UBSan+ASan, as UBSan tends to create a lot of handlers, and ASan instrumentation increases the global size to at least 64 bytes. Test Plan: clang regression test suite Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits, byoungyoung, kcc Differential Revision: http://reviews.llvm.org/D4575 llvm-svn: 213392
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index d6b694a8824..c65598e96df 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -1018,7 +1018,11 @@ public:
void reportGlobalToASan(llvm::GlobalVariable *GV, const VarDecl &D,
bool IsDynInit = false);
void reportGlobalToASan(llvm::GlobalVariable *GV, SourceLocation Loc,
- StringRef Name, bool IsDynInit = false);
+ StringRef Name, bool IsDynInit = false,
+ bool IsBlacklisted = false);
+
+ /// Disable sanitizer instrumentation for this global.
+ void disableSanitizerForGlobal(llvm::GlobalVariable *GV);
void addDeferredVTable(const CXXRecordDecl *RD) {
DeferredVTables.push_back(RD);
OpenPOWER on IntegriCloud