]> granicus.if.org Git - clang/commitdiff
Add proper support for -fsanitize-blacklist= flag for TSan and MSan. Clang part.
authorAlexey Samsonov <samsonov@google.com>
Fri, 28 Dec 2012 09:31:34 +0000 (09:31 +0000)
committerAlexey Samsonov <samsonov@google.com>
Fri, 28 Dec 2012 09:31:34 +0000 (09:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171184 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/BackendUtil.cpp

index ea5bcb55f8c1dfa8aa5a398d07eb61fe106a4d1a..4568a2c1c96b276cd55c0f61ca1deffc26b51aa2 100644 (file)
@@ -136,8 +136,8 @@ public:
   void EmitAssembly(BackendAction Action, raw_ostream *OS);
 };
 
-// We need this wrapper to access LangOpts from extension functions that
-// we add to the PassManagerBuilder.
+// We need this wrapper to access LangOpts and CGOpts from extension functions
+// that we add to the PassManagerBuilder.
 class PassManagerBuilderWrapper : public PassManagerBuilder {
 public:
   PassManagerBuilderWrapper(const CodeGenOptions &CGOpts,
@@ -191,12 +191,16 @@ static void addMemorySanitizerPass(const PassManagerBuilder &Builder,
   const PassManagerBuilderWrapper &BuilderWrapper =
       static_cast<const PassManagerBuilderWrapper&>(Builder);
   const CodeGenOptions &CGOpts = BuilderWrapper.getCGOpts();
-  PM.add(createMemorySanitizerPass(CGOpts.MemorySanitizerTrackOrigins));
+  PM.add(createMemorySanitizerPass(CGOpts.MemorySanitizerTrackOrigins,
+                                   CGOpts.SanitizerBlacklistFile));
 }
 
 static void addThreadSanitizerPass(const PassManagerBuilder &Builder,
                                    PassManagerBase &PM) {
-  PM.add(createThreadSanitizerPass());
+  const PassManagerBuilderWrapper &BuilderWrapper =
+      static_cast<const PassManagerBuilderWrapper&>(Builder);
+  const CodeGenOptions &CGOpts = BuilderWrapper.getCGOpts();
+  PM.add(createThreadSanitizerPass(CGOpts.SanitizerBlacklistFile));
 }
 
 void EmitAssemblyHelper::CreatePasses(TargetMachine *TM) {