[PATCH] D100826: [Debug-Info][NFC] add -gstrict-dwarf support in backend
David Blaikie via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 20 10:09:17 PDT 2021
dblaikie added a comment.
Do you know if you're going to be using LTO with DBX? If so, to respect this flag, it would need to be added to LLVM IR module metadata (like the Dwarf Version and Debug Info Version fields) rather than as an MCOption. (we're pretty wishy-washy about what things we decide have to be carried through LTO (& thus go in the IR metadata) and what things we're OK saying "eh, this'll be set on MCOptions or in a -mllvm flag and you'll have to pass the flag to your link step if you want this functionality in an LTO build") - so there's no hard line here)
If you stick with the MCOption, it'll need to be plumbed into llc as a flag there, and should be tested (might be that the whole functionality of the llc flag, MCOption to lower it to, and its use in LLVM's debug info emission should go together in one patch - I'm not sure)
A general architectural issue too: I think the other patches that are using this functionality for specific features should be abandoned if the following alternative is possible: Could the code for adding attributes be modified to check the version of the attribute and omit it if the in-use version doesn't support the attribute (& strict DWARF is enabled)? (is it only attributes you're dealing with, or also tags? I would guess for tags the architectural changes might be a bit more difficult, but I think would still be worth considering such a general solution)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100826/new/
https://reviews.llvm.org/D100826
More information about the cfe-commits
mailing list