There is no need to maintain a set to keep track of variables that use location expre...
authorDevang Patel <dpatel@apple.com>
Mon, 15 Aug 2011 21:43:21 +0000 (21:43 +0000)
committerDevang Patel <dpatel@apple.com>
Mon, 15 Aug 2011 21:43:21 +0000 (21:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137659 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.h

index 0fa820dee21ca44f022092da808526712de4cdea..07268abf05de66dd7a4d71978ed0c302b3ba2228 100644 (file)
@@ -412,7 +412,6 @@ DIE *DwarfDebug::constructVariableDIE(DbgVariable *DV, LexicalScope *Scope) {
                          dwarf::DW_FORM_data4,
                          Asm->GetTempSymbol("debug_loc", Offset));
     DV->setDIE(VariableDie);
-    UseDotDebugLocEntry.insert(VariableDie);
     return VariableDie;
   }
 
@@ -1676,10 +1675,9 @@ void DwarfDebug::emitDIE(DIE *Die) {
       break;
     }
     case dwarf::DW_AT_location: {
-      if (UseDotDebugLocEntry.count(Die) != 0) {
-        DIELabel *L = cast<DIELabel>(Values[i]);
+      if (DIELabel *L = dyn_cast<DIELabel>(Values[i]))
         Asm->EmitLabelDifference(L->getValue(), DwarfDebugLocSectionSym, 4);
-      else
+      else
         Values[i]->EmitValue(Asm, Form);
       break;
     }
index 7f26850dedf0d361fa845aebc4e2a756476448e4..2a3b03ebe46a5935f99f2f058bbe9da88fbf790b 100644 (file)
@@ -234,10 +234,6 @@ class DwarfDebug {
   /// DotDebugLocEntries - Collection of DotDebugLocEntry.
   SmallVector<DotDebugLocEntry, 4> DotDebugLocEntries;
 
-  /// UseDotDebugLocEntry - DW_AT_location attributes for the DIEs in this set
-  /// idetifies corresponding .debug_loc entry offset.
-  SmallPtrSet<const DIE *, 4> UseDotDebugLocEntry;
-
   /// InliendSubprogramDIEs - Collection of subprgram DIEs that are marked
   /// (at the end of the module) as DW_AT_inline.
   SmallPtrSet<DIE *, 4> InlinedSubprogramDIEs;