diff options
author | David Blaikie <dblaikie@gmail.com> | 2015-02-04 19:47:54 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2015-02-04 19:47:54 +0000 |
commit | 4d52443c0e329f0cd650cf208a77ed60df5e022b (patch) | |
tree | b2d5c873e689d455fc14a8b3f8ca4a73018736e2 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 920df5c1bbb1fd179371e0a68af3e48517ca949b (diff) | |
download | bcm5719-llvm-4d52443c0e329f0cd650cf208a77ed60df5e022b.tar.gz bcm5719-llvm-4d52443c0e329f0cd650cf208a77ed60df5e022b.zip |
DebugInfo: Attribute cleanup code to the end of the scope, not the end of the function.
Now if you break on a dtor and go 'up' in your debugger (or you get an
asan failure in a dtor) during an exception unwind, you'll have more
context. Instead of all dtors appearing to be called from the '}' of the
function, they'll be attributed to the end of the scope of the variable,
the same as the non-exceptional dtor call.
This doesn't /quite/ remove all uses of CurEHLocation (which might be
nice to remove, for a few reasons) - it's still used to choose the
location for some other work in the landing pad. It'd be nice to
attribute that code to the same location as the exception calls within
the block and to remove CurEHLocation.
llvm-svn: 228181
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index e152bfd7491..43c9dfe87a0 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -241,8 +241,6 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) { // edges will be *really* confused. bool EmitRetDbgLoc = true; if (EHStack.stable_begin() != PrologueCleanupDepth) { - PopCleanupBlocks(PrologueCleanupDepth); - // Make sure the line table doesn't jump back into the body for // the ret after it's been at EndLoc. EmitRetDbgLoc = false; @@ -250,6 +248,8 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) { if (CGDebugInfo *DI = getDebugInfo()) if (OnlySimpleReturnStmts) DI->EmitLocation(Builder, EndLoc); + + PopCleanupBlocks(PrologueCleanupDepth); } // Emit function epilog (to return). |