diff options
author | Eric Christopher <echristo@apple.com> | 2012-07-11 01:49:26 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2012-07-11 01:49:26 +0000 |
commit | 3d40f96394fb30b70ba83bdfd10f3ed69530b0e5 (patch) | |
tree | 8b11baa0ba7714e3ab6fa4a2540c0759dc6e0053 /lib/CodeGen/CodeGenFunction.h | |
parent | 81e5a936a510f32ccbe85303147f1b0a587b6504 (diff) |
The end of a block doesn't necessarily need a line table entry unless
there's something going on there. Remove the unconditional line entry
and only add one if we're emitting cleanups (any other statements
would be handled normally).
Fixes rdar://9199234
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160033 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index b737a9ed7a..8740fd06df 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -854,8 +854,11 @@ public: /// cleanups. ~LexicalScope() { if (PopDebugStack) { - CGDebugInfo *DI = CGF.getDebugInfo(); - if (DI) DI->EmitLexicalBlockEnd(CGF.Builder, Range.getEnd()); + if (CGDebugInfo *DI = CGF.getDebugInfo()) { + if (RunCleanupsScope::requiresCleanups()) + DI->EmitLocation(CGF.Builder, Range.getEnd()); + DI->EmitLexicalBlockEnd(CGF.Builder, Range.getEnd()); + } } } @@ -864,6 +867,8 @@ public: void ForceCleanup() { RunCleanupsScope::ForceCleanup(); if (CGDebugInfo *DI = CGF.getDebugInfo()) { + if (RunCleanupsScope::requiresCleanups()) + DI->EmitLocation(CGF.Builder, Range.getEnd()); DI->EmitLexicalBlockEnd(CGF.Builder, Range.getEnd()); PopDebugStack = false; } |