diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2014-06-02 18:08:08 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2014-06-02 18:08:08 +0000 |
commit | e09e4f33ca135e62c7c98b9c4359b45ec1b18559 (patch) | |
tree | bb92aff0ad21ee1de23e17bcafe08517ba7515d9 /lib/CodeGen/BackendUtil.cpp | |
parent | 2fd209633568ce58700938a60f4582c45e83a90e (diff) |
Remove sanitizer blacklist from ASan/TSan/MSan function passes.
Instrumentation passes now use attributes
address_safety/thread_safety/memory_safety which are added by Clang frontend.
Clang parses the blacklist file and adds the attributes accordingly.
Currently blacklist is still used in ASan module pass to disable instrumentation
for certain global variables. We should fix this as well by collecting the
set of globals we're going to instrument in Clang and passing it to ASan
in metadata (as we already do for dynamically-initialized globals and init-order
checking).
This change also removes -tsan-blacklist and -msan-blacklist LLVM commandline
flags in favor of -fsanitize-blacklist= Clang flag.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210037 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BackendUtil.cpp')
-rw-r--r-- | lib/CodeGen/BackendUtil.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index fc6c5949d5..1e9d5d4b87 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -184,11 +184,9 @@ static void addAddressSanitizerPasses(const PassManagerBuilder &Builder, static_cast<const PassManagerBuilderWrapper&>(Builder); const CodeGenOptions &CGOpts = BuilderWrapper.getCGOpts(); const LangOptions &LangOpts = BuilderWrapper.getLangOpts(); - PM.add(createAddressSanitizerFunctionPass( - LangOpts.Sanitize.InitOrder, - LangOpts.Sanitize.UseAfterReturn, - LangOpts.Sanitize.UseAfterScope, - CGOpts.SanitizerBlacklistFile)); + PM.add(createAddressSanitizerFunctionPass(LangOpts.Sanitize.InitOrder, + LangOpts.Sanitize.UseAfterReturn, + LangOpts.Sanitize.UseAfterScope)); PM.add(createAddressSanitizerModulePass( LangOpts.Sanitize.InitOrder, CGOpts.SanitizerBlacklistFile)); @@ -199,8 +197,7 @@ static void addMemorySanitizerPass(const PassManagerBuilder &Builder, const PassManagerBuilderWrapper &BuilderWrapper = static_cast<const PassManagerBuilderWrapper&>(Builder); const CodeGenOptions &CGOpts = BuilderWrapper.getCGOpts(); - PM.add(createMemorySanitizerPass(CGOpts.SanitizeMemoryTrackOrigins, - CGOpts.SanitizerBlacklistFile)); + PM.add(createMemorySanitizerPass(CGOpts.SanitizeMemoryTrackOrigins)); // MemorySanitizer inserts complex instrumentation that mostly follows // the logic of the original code, but operates on "shadow" values. @@ -219,8 +216,7 @@ static void addThreadSanitizerPass(const PassManagerBuilder &Builder, PassManagerBase &PM) { const PassManagerBuilderWrapper &BuilderWrapper = static_cast<const PassManagerBuilderWrapper&>(Builder); - const CodeGenOptions &CGOpts = BuilderWrapper.getCGOpts(); - PM.add(createThreadSanitizerPass(CGOpts.SanitizerBlacklistFile)); + PM.add(createThreadSanitizerPass()); } static void addDataFlowSanitizerPass(const PassManagerBuilder &Builder, |