[PATCH] D101024: [Debug-Info] make DIE attributes generating under control of strict dwarf

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 25 09:57:13 PDT 2021


dblaikie accepted this revision.
dblaikie added a comment.
This revision is now accepted and ready to land.

Looks good, thanks!



================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h:85
+    // DWARF version.
+    if (Attribute != 0 && Asm->TM.Options.DebugStrictDwarf &&
+        DD->getDwarfVersion() < dwarf::AttributeVersion(Attribute))
----------------
Might be worth expanding the comment to describe the Attribute 0 case - "Attribute 0 is used when emitting form-encoded values in blocks, which don't have attributes (only forms) so we cannot detect their DWARF version compatibility here and assume they are compatible"


================
Comment at: llvm/test/DebugInfo/PowerPC/strict-dwarf.ll:11
+; is also right for attribute 0.
+; For this case, the location attribute adding is for global variable @_ZL3var
+; and the call chain to addUInt() is:
----------------
Rather than using a comment (or in addition to the comment, you can use a CHECK for DW_AT_name of "var" to make it clear that the location checking is for that variable. (with a CHECK-NOT: DW_TAG between the attributes to ensure the test didn't skip from one tag to another between the two attributes)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101024/new/

https://reviews.llvm.org/D101024



More information about the llvm-commits mailing list