[cfe-commits] r171184 - /cfe/trunk/lib/CodeGen/BackendUtil.cpp

Alexey Samsonov samsonov at google.com
Fri Dec 28 01:31:34 PST 2012


Author: samsonov
Date: Fri Dec 28 03:31:34 2012
New Revision: 171184

URL: http://llvm.org/viewvc/llvm-project?rev=171184&view=rev
Log:
Add proper support for -fsanitize-blacklist= flag for TSan and MSan. Clang part.

Modified:
    cfe/trunk/lib/CodeGen/BackendUtil.cpp

Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=171184&r1=171183&r2=171184&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Fri Dec 28 03:31:34 2012
@@ -136,8 +136,8 @@
   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 @@
   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) {





More information about the cfe-commits mailing list