diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-04-22 21:38:15 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-04-22 21:38:15 +0000 |
commit | dc012fa26690bef5cd7b56e28bbbe9d1aa17349a (patch) | |
tree | 98eea4882cb0f30190beef442b48c562bff7a89a /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 952d95141828eeb787d17c7f92d9dd6ea455cd0c (diff) | |
download | bcm5719-llvm-dc012fa26690bef5cd7b56e28bbbe9d1aa17349a.tar.gz bcm5719-llvm-dc012fa26690bef5cd7b56e28bbbe9d1aa17349a.zip |
Revert "Revert r234581, it might have caused a few miscompiles in Chromium."
This reverts commit r234700. It turns out that the lifetime markers
were not the cause of Chromium failing but a bug which was uncovered by
optimizations exposed by the markers.
llvm-svn: 235553
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 42c3a423fa0..93f00113e9a 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "CodeGenFunction.h" +#include "CGCleanup.h" #include "CGCUDARuntime.h" #include "CGCXXABI.h" #include "CGDebugInfo.h" @@ -243,12 +244,13 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) { // parameters. Do this in whatever block we're currently in; it's // important to do this before we enter the return block or return // edges will be *really* confused. - bool EmitRetDbgLoc = true; - if (EHStack.stable_begin() != PrologueCleanupDepth) { + bool HasCleanups = EHStack.stable_begin() != PrologueCleanupDepth; + bool HasOnlyLifetimeMarkers = + HasCleanups && EHStack.containsOnlyLifetimeMarkers(PrologueCleanupDepth); + bool EmitRetDbgLoc = !HasCleanups || HasOnlyLifetimeMarkers; + if (HasCleanups) { // Make sure the line table doesn't jump back into the body for // the ret after it's been at EndLoc. - EmitRetDbgLoc = false; - if (CGDebugInfo *DI = getDebugInfo()) if (OnlySimpleReturnStmts) DI->EmitLocation(Builder, EndLoc); |