DebugInfo: Simplify dead variable collection slightly.
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 22 May 2014 00:48:36 +0000 (00:48 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 22 May 2014 00:48:36 +0000 (00:48 +0000)
constructSubprogramDIE was already called for every subprogram in every
CU when the module was started - there's no need to call it again at
module finalization.

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

lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index 4a317cf0b561aadecd24aff40ffcae8f5f6eae43..049e9e28c119c5d20f3fddc930f081216c49dcd4 100644 (file)
@@ -827,10 +827,8 @@ void DwarfDebug::collectDeadVariables() {
         if (Variables.getNumElements() == 0)
           continue;
 
-        // FIXME: See the comment in constructSubprogramDIE about duplicate
-        // subprogram DIEs.
-        constructSubprogramDIE(*SPCU, SP);
         DIE *SPDIE = SPCU->getDIE(SP);
+        assert(SPDIE);
         for (unsigned vi = 0, ve = Variables.getNumElements(); vi != ve; ++vi) {
           DIVariable DV(Variables.getElement(vi));
           assert(DV.isVariable());