[PATCH] D95518: [Debug-Info][XCOFF] support dwarf for XCOFF for assembly output

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 11 11:10:16 PST 2021


hubert.reinterpretcast added a comment.

In D95518#2556452 <https://reviews.llvm.org/D95518#2556452>, @jmorse wrote:

> Drive by comment,
>
>> Object output will be handled in followup patches.
>
> [...]
>
>> Since I can not get the assembly file been assembled, I verify the debug info by checking the assembly files.

I think this shifts the context of the quoted text. The second part of the quoted text says that we cannot use `llvm-dwarfdump` to test the assembly output because an assembler that reads the assembly is not available in all LLVM build environments. The quoted text is not meant to say that the checking of the assembly is a temporary situation only until object output is added.

> When support for object emission is added, please translate the empty.ll into an object + llvm-dwarfdump test. Testing the assembly output is fine for the short-term, but in the long term it causes a lot of needless test changes. The NVPTX debug-info tests are all assembly output, and they create an extra burden.

The XCOFF object output for 64-bit is some ways off. Assembly output checking will be around for some time. In any case, the assembly output should not be completely untested.



================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:394
+
+  if (!Dwarf64 && TT.isArch64Bit() && TT.isOSBinFormatXCOFF())
+    report_fatal_error("XCOFF requires DWARF64 for 64-bit mode!");
----------------
shchenz wrote:
> MaskRay wrote:
> > The report_fatal_error only triggers if `DwarfVersion < 3`. I think the driver and llvm-mc should surface the error and essentially make this line unreachable: then due to whether we have an error subsequently, this report_fatal_error may not be needed.
> Could you help to point out the places that checks `DWARF64` and dwarf version 3? As I tested, there is no error if I compile with `clang -m64 -gdwarf-2 t.c` on AIX without the new added `report_fatal_error`.
I agree the Clang driver at least should produce a friendly error message for this; however, there is not a closed set of users of LLVM as a library, so the `report_fatal_error` is still appropriate to have.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95518



More information about the llvm-commits mailing list