From efb72adbae0c253fc2fd9127fb3e1c36cb1b8d93 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178490 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenFunction.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'lib/CodeGen/CodeGenFunction.h') diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index e40a731825..f76022fb97 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/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-70-g09d2