[PATCH] D94882: [MC] Upgrade DWARF version to 5 upon .file 0

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 27 01:44:59 PST 2021


jhenderson added a comment.

I'm a little lost as to what you're referring to requiring a new command line option. If I understand it correctly, the issue is when an assembly file was produced with a specific version which doesn't match what is used when it gets assembled.

Let me try and reframe so to help clear things up. We have the following cases:

1. No option is passed to the assembler - in this case, the assembler should be able to infer the DWARF version from the presence (or lack thereof) of `.file 0`, no diagnostic needed.
2. The DWARF version is passed to the assembler via an option. In this case, in my opinion should warn if it encounters `.file 0` but the requested version doesn't support `.file 0`. Potentially, the inverse should also warn too (i.e. `.file 0` is not present, but other `.file` directives are, and version 5 is requested), but I am not familiar enough with the related assembly to know whether that is supported or not.

Does clang need to pass `dwarf-version` to cc1as at all when the version is not explicitly specified/debug data is not specifically requested? If it could avoid specifying that option, we'd be able to hit case 1) for most cases, I think, whilst still getting the warning for case 2 when there's a mismatch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94882



More information about the llvm-commits mailing list