[PATCH] D113741: [RFC][DwarfDebug][AsmPrinter] Support emitting function-local declaration for a lexical block
Kristina Bessonova via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 1 11:02:08 PST 2021
krisb marked 2 inline comments as done.
krisb added inline comments.
================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDie.cpp:675-676
return;
+ if (D.getTag() == DW_TAG_lexical_block)
+ return;
D = D.resolveTypeUnitReference();
----------------
dblaikie wrote:
> krisb wrote:
> > dblaikie wrote:
> > > This change could probably be committed separately with a llvm-dwarfdump+assembly test case demonstrating this fix. Then the LLVM code generation changes that depend on this would come in the second patch. Not a huge deal, though.
> > Before this patch, AsmPrinter would crash on types scoped within a lexical block (cause DwarfCompileUnit would not able to create a context for such types), so I'm not sure how to reproduce the case. Do you have some ideas in mind?
> What you could do is using this patch, generate the assembly for a type scoped in a lexical block - but then commit that assembly test case ahead of the rest of the patch. It's still a good/general improvement to llvm-dwarfdump/libDebugInfoDWARF that applies even if LLVM never generates this DWARF (because llvm-dwarfdump is intended as a tool to investigate any DWARF, not just the DWARF that llvm generates).
>
> This is true for most llvm-dwarfdump/libDebugInfoDWARF changes - they can come before the LLVM change that generates them, because they should/can be tested without any LLVM support at all, through assembly test cases .
Ah, got it! Thank you for all the details! I've opened a separate review for this change https://reviews.llvm.org/D114892. Please, take a look if you have a chance.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113741/new/
https://reviews.llvm.org/D113741
More information about the llvm-commits
mailing list