Przeglądaj źródła

Temporarily revert this to see if it brings the gdb bot back.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160049 91177308-0d34-0410-b5e6-96231b3b80d8
Eric Christopher 13 lat temu
rodzic
commit
c852e9ff06

+ 4 - 0
lib/CodeGen/CGDebugInfo.cpp

@@ -2135,6 +2135,10 @@ void CGDebugInfo::EmitLexicalBlockStart(CGBuilderTy &Builder, SourceLocation Loc
 /// region - end of a DW_TAG_lexical_block.
 /// region - end of a DW_TAG_lexical_block.
 void CGDebugInfo::EmitLexicalBlockEnd(CGBuilderTy &Builder, SourceLocation Loc) {
 void CGDebugInfo::EmitLexicalBlockEnd(CGBuilderTy &Builder, SourceLocation Loc) {
   assert(!LexicalBlockStack.empty() && "Region stack mismatch, stack empty!");
   assert(!LexicalBlockStack.empty() && "Region stack mismatch, stack empty!");
+
+  // Provide an entry in the line table for the end of the block.
+  EmitLocation(Builder, Loc);
+
   LexicalBlockStack.pop_back();
   LexicalBlockStack.pop_back();
 }
 }
 
 

+ 2 - 7
lib/CodeGen/CodeGenFunction.h

@@ -854,11 +854,8 @@ public:
     /// cleanups.
     /// cleanups.
     ~LexicalScope() {
     ~LexicalScope() {
       if (PopDebugStack) {
       if (PopDebugStack) {
-        if (CGDebugInfo *DI = CGF.getDebugInfo()) {
-          if (RunCleanupsScope::requiresCleanups())
-            DI->EmitLocation(CGF.Builder, Range.getEnd());
-          DI->EmitLexicalBlockEnd(CGF.Builder, Range.getEnd());
-        }
+        CGDebugInfo *DI = CGF.getDebugInfo();
+        if (DI) DI->EmitLexicalBlockEnd(CGF.Builder, Range.getEnd());
       }
       }
     }
     }
 
 
@@ -867,8 +864,6 @@ public:
     void ForceCleanup() {
     void ForceCleanup() {
       RunCleanupsScope::ForceCleanup();
       RunCleanupsScope::ForceCleanup();
       if (CGDebugInfo *DI = CGF.getDebugInfo()) {
       if (CGDebugInfo *DI = CGF.getDebugInfo()) {
-        if (RunCleanupsScope::requiresCleanups())
-          DI->EmitLocation(CGF.Builder, Range.getEnd());
         DI->EmitLexicalBlockEnd(CGF.Builder, Range.getEnd());
         DI->EmitLexicalBlockEnd(CGF.Builder, Range.getEnd());
         PopDebugStack = false;
         PopDebugStack = false;
       }
       }

+ 0 - 17
test/CodeGen/debug-info-block-end.c

@@ -1,17 +0,0 @@
-// RUN: %clang_cc1 -g -S -emit-llvm %s -o - | FileCheck %s
-
-int bar();
-
-int foo(int i) {
-  int j = 0;
-  if (i) {
-    j = bar();
-  }
-  else {
-    j = bar() + 2;
-  }
-  return j;
-}
-
-// Make sure we don't have a line table entry for a block with no cleanups.
-// CHECK-NOT: i32 9, i32 3, metadata