[PATCH] D100440: [Debug-Info] DW_AT_export_symbols shouldn't be generated before version-5 of DWARF.
David Blaikie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 20 10:28:57 PDT 2021
dblaikie added a comment.
In D100440#2702203 <https://reviews.llvm.org/D100440#2702203>, @probinson wrote:
> There may be an opportunity to do this more robustly, instead of scattering the checks all over the place. Note that the Dwarf.def file already knows the version for each tag and attribute; DwarfDebug already knows the version we're emitting; so if DwarfDebug also had the strict-dwarf flag, it would be easy to add a helper predicate or two that would do the checking for any tag or attribute.
>
> Then the methods that add attributes could generally call the predicate themselves, instead of having higher-level code do it.
> For tags you probably do want the higher-level code to call the predicate, but it seems like it would be a lot simpler to do something like `if (canEmitTag(dwarf::DW_TAG_rvalue_reference))` than the kind of thing we're seeing in these patches.
>
> Does that seem reasonable?
Agreed - brought up something similar here: https://reviews.llvm.org/D100826#2702135
(For the tags, yeah, I'm not sure - wonder if the code for emitting the DIEs could return null/empty DIE/something to indicate that the DIE wasn't created - though that might be hard to retrofit if it means revisiting every place that constructs a DIE to ensure it can handle a "nothing" return)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100440/new/
https://reviews.llvm.org/D100440
More information about the llvm-commits
mailing list