aboutsummaryrefslogtreecommitdiff
path: root/clang/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
commitc6515b6a41244c5af0f57528a9527e636bacccb1 (patch)
treed3e294ead16dea4a42c4052cd98583f374072030 /clang/lib/CodeGen/BackendUtil.cpp
parent3efc87e92d6d187c29efcf82a2a39e5fd79c5eeb (diff)
downloadllvm-c6515b6a41244c5af0f57528a9527e636bacccb1.zip
llvm-c6515b6a41244c5af0f57528a9527e636bacccb1.tar.gz
llvm-c6515b6a41244c5af0f57528a9527e636bacccb1.tar.bz2
Add proper support for -fsanitize-blacklist= flag for TSan and MSan. Clang part.
llvm-svn: 171184
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index ea5bcb5..4568a2c 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/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) {