[llvm-dev] Invalid DW_AT_calling_convention generated for a DW_TAG_class_type
Snider, Todd via llvm-dev
llvm-dev at lists.llvm.org
Tue Jul 30 09:59:15 PDT 2019
I see now that this is a DWARF 5 addition. It is still invalid for DWARF 4 or earlier.
From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Snider, Todd via llvm-dev
Sent: Tuesday, July 30, 2019 11:54 AM
To: llvm-dev
Subject: [EXTERNAL] [llvm-dev] Invalid DW_AT_calling_convention generated for a DW_TAG_class_type
In llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp, the compiler can emit a DW_AT_calling_convention attribute with a DW_TAG_class_type (and it looks like a DW_TAG_variant_part, DW_TAG_structure_type or DW_TAG_union_type as well), but the DWARF 4 specification says that DW_AT_calling_convention is not a valid attribute for any of those three DWARF tags.
Downstream object consumers that check to verify that a DWARF attr is appropriate for a given DWARF tag will appropriately flag an error.
I conjecture that this part of the DwarfUnit::constructTypeDIe() function (circa line 958 in DwarfUnit.cpp) should be guarded with a target- or vendor-specific conditional if it is needed for a particular purpose. Otherwise, I propose that it be removed since it breaks compliance with the DWARF specification.
~ Todd Snider
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190730/51fd2b0e/attachment.html>
More information about the llvm-dev
mailing list