This patch comes from D105469.
In DWARF2/3, the DW_FORM_data4/8 in DW_AT_data_member_location must be interpreted as location-list pointers.
In this patch, we use DW_FORM_udata instead of DW_FORM_data4/8 to encode the constants of DW_AT_data_member_location in DWARF3.
Details
- Reviewers
probinson shchenz dblaikie aprantl jhenderson jdoerfert - Group Reviewers
Restricted Project - Commits
- rG0d3e4d9d4d2c: [Debug-Info][llvm-dwarfdump] Don't use DW_FORM_data4/8
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Sorry for the slow response, I will try to be better about it.
With the test case being an asm file, what it is actually testing is how llvm-dwarfdump displays the DWARF that is explicitly given in the .s file. However, your patch changes how the DWARF is emitted. Really what you should have here is an IR (.ll) file, which you compile to an object with llc. Then you can use llvm-dwarfdump to verify what the backend produces from now on, instead of what it produced one time (when the .s file was created).
Also the test should be in CodeGen, not tools/llvm-dwarfdump, because you are testing the code generator not dwarfdump.
llvm/test/tools/llvm-dwarfdump/ELF/formclass3-atmemloc.s | ||
---|---|---|
9 ↗ | (On Diff #357449) | Eliminate function foo() and replace it with e E; to make the test case much shorter. |
14 ↗ | (On Diff #357449) | Add -v to the llvm-dwarfdump options, and that will allow you to verify the FORM directly. |
llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | ||
---|---|---|
1622 | We try to be consistent in how we refer to DWARF versions in commentary; so please replace DWARF3 with DWARF v3. |
One comment tweak needed, and LGTM.
llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | ||
---|---|---|
1624 | "Interpreting constants as pointers..." |
We try to be consistent in how we refer to DWARF versions in commentary; so please replace DWARF3 with DWARF v3.