[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 19:47:00 PDT 2021
dblaikie added inline comments.
================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h:100
+ };
+ SmallVector<UnfinishedStaticVariable, 1> UnfinishedStaticVariables;
+
----------------
ellis wrote:
> dblaikie wrote:
> > 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`?
> The issue is `getOrCreateGlobalVariableDIE()` is call in `constructImportedEntityDIE()` before `finalizeModuleInfo()`. That's why I made sure to include `DIImportedEntity()` in the test case.
& we can't move the imported entity creation to the end of the module because they're needed for lexical scopes?
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