From 5d5b67c52cd2e1fc1ef2342a4480938a70f0d2ec Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Mon, 1 Apr 2013 19:02:06 +0000 Subject: * Attempt to un-break gdb buildbot by emitting a lexical block end only when we actually end a lexical block. * Added new test for line table / block cleanup. * Follow-up to r177819 / rdar://problem/13115369 llvm-svn: 178490 --- clang/lib/CodeGen/CodeGenFunction.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenFunction.h') diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index e40a731825b..f76022fb97d 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -881,6 +881,9 @@ public: /// \brief Exit this cleanup scope, emitting any accumulated /// cleanups. ~LexicalScope() { + if (CGDebugInfo *DI = CGF.getDebugInfo()) + DI->EmitLexicalBlockEnd(CGF.Builder, Range.getEnd()); + // If we should perform a cleanup, force them now. Note that // this ends the cleanup scope before rescoping any labels. if (PerformCleanup) ForceCleanup(); @@ -889,15 +892,9 @@ public: /// \brief Force the emission of cleanups now, instead of waiting /// until this object is destroyed. void ForceCleanup() { + CGF.CurLexicalScope = ParentScope; RunCleanupsScope::ForceCleanup(); - endLexicalScope(); - } - private: - void endLexicalScope() { - CGF.CurLexicalScope = ParentScope; - if (CGDebugInfo *DI = CGF.getDebugInfo()) - DI->EmitLexicalBlockEnd(CGF.Builder, Range.getEnd()); if (!Labels.empty()) rescopeLabels(); } -- cgit v1.2.3