Live local variables are being dropped because the begin or end labels marking
authorJim Laskey <jlaskey@mac.com>
Sat, 4 Nov 2006 10:48:07 +0000 (10:48 +0000)
committerJim Laskey <jlaskey@mac.com>
Sat, 4 Nov 2006 10:48:07 +0000 (10:48 +0000)
their scope are being deleted.  Workaround is to widen scope to full function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31454 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/DwarfWriter.cpp

index 40518eb20933014dc07b5f6412090181c78953ed..1c33cd85f1e7cd6d9fac44a3646c5f8640a711b4 100644 (file)
@@ -1862,9 +1862,10 @@ private:
       unsigned StartID = Scope->getStartLabelID();
       unsigned EndID = Scope->getEndLabelID();
       
-      // Throw out scope if block is discarded.
-      if (StartID && !DebugInfo->isLabelValid(StartID)) continue;
-      if (EndID && !DebugInfo->isLabelValid(EndID)) continue;
+      // Widen scope if label is discarded.
+      // FIXME - really need to find a GOOD label if a block is dead.
+      if (StartID && !DebugInfo->isLabelValid(StartID)) StartID = 0;
+      if (EndID && !DebugInfo->isLabelValid(EndID)) EndID = 0;
       
       DIE *ScopeDie = new DIE(DW_TAG_lexical_block);