aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-12-28 09:31:34 +0000
committerAlexey Samsonov <samsonov@google.com>2012-12-28 09:31:34 +0000
commite8c0322701ce6ece0c24ab1391915676dd2eba1c (patch)
tree399aa4af66803768c4af0a4977a01aa618e2f315 /lib/CodeGen/BackendUtil.cpp
parentebf75d75e2e78cd50b1e8f29f297a47246a525c0 (diff)
Add proper support for -fsanitize-blacklist= flag for TSan and MSan. Clang part.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171184 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BackendUtil.cpp')
-rw-r--r--lib/CodeGen/BackendUtil.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp
index ea5bcb55f8..4568a2c1c9 100644
--- a/lib/CodeGen/BackendUtil.cpp
+++ b/lib/CodeGen/BackendUtil.cpp
@@ -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) {