summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2017-03-31 09:19:25 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2017-03-31 09:19:25 +0000
commit2a7d39dfe8cf0681baa5b64effc641a9c04a2a71 (patch)
treea2ef6741ac2218ba11d73a4d57c95040b765aa11 /clang/lib/CodeGen/CodeGenFunction.cpp
parent25fdc3acf42a2827b0e5105fdd00eaf34960c44d (diff)
downloadbcm5719-llvm-2a7d39dfe8cf0681baa5b64effc641a9c04a2a71.tar.gz
bcm5719-llvm-2a7d39dfe8cf0681baa5b64effc641a9c04a2a71.zip
[msan] Turn off lifetime markers even when use after scope checking is on.
Since r299174 use after scope checking is on by default. Even though msan doesn't check for use after scope it gets confused by the lifetime markers emitted for it, making unit tests fail. This is covered by ninja check-msan. llvm-svn: 299191
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 79c0694f902..d1c068eda9a 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -45,15 +45,15 @@ static bool shouldEmitLifetimeMarkers(const CodeGenOptions &CGOpts,
if (CGOpts.DisableLifetimeMarkers)
return false;
- // Asan uses markers for use-after-scope checks.
- if (CGOpts.SanitizeAddressUseAfterScope)
- return true;
-
// Disable lifetime markers in msan builds.
// FIXME: Remove this when msan works with lifetime markers.
if (LangOpts.Sanitize.has(SanitizerKind::Memory))
return false;
+ // Asan uses markers for use-after-scope checks.
+ if (CGOpts.SanitizeAddressUseAfterScope)
+ return true;
+
// For now, only in optimized builds.
return CGOpts.OptimizationLevel != 0;
}
OpenPOWER on IntegriCloud