aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/BackendUtil.cpp')
-rw-r--r--lib/CodeGen/BackendUtil.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp
index ff593620fd..ea5bcb55f8 100644
--- a/lib/CodeGen/BackendUtil.cpp
+++ b/lib/CodeGen/BackendUtil.cpp
@@ -188,7 +188,10 @@ static void addAddressSanitizerPasses(const PassManagerBuilder &Builder,
static void addMemorySanitizerPass(const PassManagerBuilder &Builder,
PassManagerBase &PM) {
- PM.add(createMemorySanitizerPass());
+ const PassManagerBuilderWrapper &BuilderWrapper =
+ static_cast<const PassManagerBuilderWrapper&>(Builder);
+ const CodeGenOptions &CGOpts = BuilderWrapper.getCGOpts();
+ PM.add(createMemorySanitizerPass(CGOpts.MemorySanitizerTrackOrigins));
}
static void addThreadSanitizerPass(const PassManagerBuilder &Builder,