diff options
| author | Vitaly Buka <vitalybuka@google.com> | 2019-08-26 22:15:50 +0000 |
|---|---|---|
| committer | Vitaly Buka <vitalybuka@google.com> | 2019-08-26 22:15:50 +0000 |
| commit | df48533d4a3a2acf1280ec37a9f369efc468cbf2 (patch) | |
| tree | 8468ababd38f5aa7f80d848d32034e359a4596f1 /lib/CodeGen/CGExpr.cpp | |
| parent | eff099ee1875d8503bec7f952e84e3d19e939956 (diff) | |
| download | clang-df48533d4a3a2acf1280ec37a9f369efc468cbf2.tar.gz | |
msan, codegen, instcombine: Keep more lifetime markers used for msan
Reviewers: eugenis
Subscribers: hiraditya, cfe-commits, #sanitizers, llvm-commits
Tags: #clang, #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D66695
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@369979 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
| -rw-r--r-- | lib/CodeGen/CGExpr.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index d53fb46f33..0e04a51456 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -516,13 +516,12 @@ EmitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *M) { // Avoid creating a conditional cleanup just to hold an llvm.lifetime.end // marker. Instead, start the lifetime of a conditional temporary earlier - // so that it's unconditional. Don't do this in ASan's use-after-scope - // mode so that it gets the more precise lifetime marks. If the type has - // a non-trivial destructor, we'll have a cleanup block for it anyway, - // so this typically doesn't help; skip it in that case. + // so that it's unconditional. Don't do this with sanitizers which need + // more precise lifetime marks. ConditionalEvaluation *OldConditional = nullptr; CGBuilderTy::InsertPoint OldIP; if (isInConditionalBranch() && !E->getType().isDestructedType() && + !SanOpts.has(SanitizerKind::Memory) && !CGM.getCodeGenOpts().SanitizeAddressUseAfterScope) { OldConditional = OutermostConditional; OutermostConditional = nullptr; |
