diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2014-07-07 23:34:34 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2014-07-07 23:34:34 +0000 |
commit | e7a8ccfaad752f02b4f0e3bf49321b9f23313a75 (patch) | |
tree | 862aed2a5ff7208f92a1fa44283ccc14514471f0 /clang/lib/CodeGen/CodeGenModule.h | |
parent | 2620b877b6299e04767718358d6e1eb66b18cb49 (diff) | |
download | bcm5719-llvm-e7a8ccfaad752f02b4f0e3bf49321b9f23313a75.tar.gz bcm5719-llvm-e7a8ccfaad752f02b4f0e3bf49321b9f23313a75.zip |
[Sanitizer] Reduce the usage of sanitizer blacklist in CodeGenModule
Get rid of cached CodeGenModule::SanOpts, which was used to turn off
sanitizer codegen options if current LLVM Module is blacklisted, and use
plain LangOpts.Sanitize instead.
1) Some codegen decisions (turning TBAA or writable strings on/off)
shouldn't depend on the contents of blacklist.
2) llvm.asan.globals should *always* be created, even if the module
is blacklisted - soon Clang's CodeGen where we read sanitizer
blacklist files, so we should properly report which globals are
blacklisted to the backend.
llvm-svn: 212499
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 8ce4668e032..2f605184876 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -475,8 +475,6 @@ class CodeGenModule : public CodeGenTypeCache { std::unique_ptr<llvm::SpecialCaseList> SanitizerBlacklist; - const SanitizerOptions &SanOpts; - /// @} public: CodeGenModule(ASTContext &C, const CodeGenOptions &CodeGenOpts, @@ -1014,7 +1012,10 @@ public: return *SanitizerBlacklist; } - const SanitizerOptions &getSanOpts() const { return SanOpts; } + const SanitizerOptions &getSanOpts() const { + return SanitizerBlacklist->isIn(TheModule) ? SanitizerOptions::Disabled + : LangOpts.Sanitize; + } void reportGlobalToASan(llvm::GlobalVariable *GV, SourceLocation Loc, bool IsDynInit = false); |