[PATCH] D121299: [NVPTX] Disable DWARF .file directory for PTX

Andrew Savonichev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 20 03:34:36 PDT 2022


asavonic added a comment.

> The question is whether this is the right place to do it, or would it better to do it wherever `UseDwarfDirectory` is set.

This option is first set in `llc.cpp` and then propagated to `MCAsmStreamer`. I think this is the right place for to do it, but we can move this code to the class constructor instead.

In D121299#3376523 <https://reviews.llvm.org/D121299#3376523>, @MaskRay wrote:

> I am a bit unsure whether we should make such logic spread in two places (clang Driver and MCAsmStreamer).
> It's nice that `llc` without other options (-dwarf-directory=0) produced assembly can be passed to the assembler for the target but that's not a requirement.

I think it is important for llc to produce valid assembly output by default, especially considering that the error message from ptxas is not obvious.
Although the way we should change this default depends on use cases and expectations for -dwarf-directory. I traced it back to 2011 (commit 40f8f2ff "Add support for a new extension to the .file directive") , where it it was added as an extension and (I assume) later included into DWARFv5. Do we still want to support it as an extension for DWARF < 5, or it is only needed for integrated assembler?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121299



More information about the llvm-commits mailing list