[PATCH] D108492: [DebugInfo] Place static variable DIEs under the correct parent

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 20 18:07:11 PDT 2021


dblaikie added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h:100
+  };
+  SmallVector<UnfinishedStaticVariable, 1> UnfinishedStaticVariables;
+
----------------
Rather than creating then deferring them - would it work if the whole creation were deferred until needed? (ie: move this loop:
```
    DenseSet<DIGlobalVariable *> Processed;
    for (auto *GVE : CUNode->getGlobalVariables()) {
      DIGlobalVariable *GV = GVE->getVariable();
      if (Processed.insert(GV).second)
        CU.getOrCreateGlobalVariableDIE(GV, sortGlobalExprs(GVMap[GV]));
    }
```
from `beginModule` to `finalizeModuleInfo`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108492/new/

https://reviews.llvm.org/D108492



More information about the llvm-commits mailing list