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.

llvm-svn: 210037
This commit is contained in:
Alexey Samsonov 2014-06-02 18:08:08 +00:00
parent a4ec2fcff9
commit 1cf07ea6bb
1 changed files with 5 additions and 9 deletions

View File

@ -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,