]> granicus.if.org Git - clang/commitdiff
Fold debug scope emission into the cleanup scope.
authorEric Christopher <echristo@apple.com>
Thu, 23 Feb 2012 00:43:07 +0000 (00:43 +0000)
committerEric Christopher <echristo@apple.com>
Thu, 23 Feb 2012 00:43:07 +0000 (00:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151216 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGStmt.cpp

index 47807c407b3358248fe1c964424c0bb9f1c75e80..d87202ee59f5cf1d6abb57f2f3496a94ced60cb0 100644 (file)
@@ -191,20 +191,13 @@ RValue CodeGenFunction::EmitCompoundStmt(const CompoundStmt &S, bool GetLast,
   PrettyStackTraceLoc CrashInfo(getContext().getSourceManager(),S.getLBracLoc(),
                              "LLVM IR generation of compound statement ('{}')");
 
-  CGDebugInfo *DI = getDebugInfo();
-  if (DI)
-    DI->EmitLexicalBlockStart(Builder, S.getLBracLoc());
-
-  // Keep track of the current cleanup stack depth.
-  RunCleanupsScope Scope(*this);
+  // Keep track of the current cleanup stack depth, including debug scopes.
+  LexicalScope Scope(*this, S.getSourceRange());
 
   for (CompoundStmt::const_body_iterator I = S.body_begin(),
        E = S.body_end()-GetLast; I != E; ++I)
     EmitStmt(*I);
 
-  if (DI)
-    DI->EmitLexicalBlockEnd(Builder, S.getRBracLoc());
-
   RValue RV;
   if (!GetLast)
     RV = RValue::get(0);