From 5b5370aebe96de047ff2578ded998f476713fbea Mon Sep 17 00:00:00 2001 From: Evgeniy Stepanov Date: Mon, 7 Nov 2016 21:02:11 +0000 Subject: [PATCH] Use -fsanitize-recover instead of -mllvm -msan-keep-going: clang. Summary: Use -fsanitize-recover instead of -mllvm -msan-keep-going: pass -fsanitize-recover value to msan. Reviewers: eugenis Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26354 Patch by Aleksey Shlyapnikov. llvm-svn: 286148 --- clang/lib/CodeGen/BackendUtil.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp index 367cace096ad..7b832ab5639b 100644 --- a/clang/lib/CodeGen/BackendUtil.cpp +++ b/clang/lib/CodeGen/BackendUtil.cpp @@ -200,7 +200,9 @@ static void addMemorySanitizerPass(const PassManagerBuilder &Builder, const PassManagerBuilderWrapper &BuilderWrapper = static_cast(Builder); const CodeGenOptions &CGOpts = BuilderWrapper.getCGOpts(); - PM.add(createMemorySanitizerPass(CGOpts.SanitizeMemoryTrackOrigins)); + int TrackOrigins = CGOpts.SanitizeMemoryTrackOrigins; + bool Recover = CGOpts.SanitizeRecover.has(SanitizerKind::Memory); + PM.add(createMemorySanitizerPass(TrackOrigins, Recover)); // MemorySanitizer inserts complex instrumentation that mostly follows // the logic of the original code, but operates on "shadow" values.