From e09e4f33ca135e62c7c98b9c4359b45ec1b18559 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Mon, 2 Jun 2014 18:08:08 +0000 Subject: [PATCH] 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 --- lib/CodeGen/BackendUtil.cpp | 14 +++++--------- 1 file 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(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(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(Builder); - const CodeGenOptions &CGOpts = BuilderWrapper.getCGOpts(); - PM.add(createThreadSanitizerPass(CGOpts.SanitizerBlacklistFile)); + PM.add(createThreadSanitizerPass()); } static void addDataFlowSanitizerPass(const PassManagerBuilder &Builder, -- 2.50.1