[PATCH] D87011: [DebugInfo] Add the -dwarf64 switch to llc and other internal tools (4/19).

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 3 11:39:37 PDT 2020


MaskRay added inline comments.


================
Comment at: llvm/test/DebugInfo/X86/dwarf64-support.ll:6
+; should be ignored for earlier versions.
+; RUN: llc -mtriple=x86_64 -dwarf-version=2 -dwarf64 -filetype=obj %s -o - | \
+; RUN:   llvm-dwarfdump -debug-line - | \
----------------
ikudrin wrote:
> MaskRay wrote:
> > If `-dwarf-version=2 -dwarf64` does not make sense, shouldn't the combo be errored to prevent misuse?
> I am not sure where to add that check and reporting. It looks like for internal tools erroneous combinations are just ignored. For example, for NVPTX, setting the DWARF version is silently ignored (see lines 372-374 in `DwarfDebug.cpp`). Thus, my change just follows the crowd.
I guess NVPTX does so for quick MVP prototype ("[DEBUG] Initial adaptation of NVPTX target for debug info emission."). Downgrading DWARF version this way allows them to use -gdwarf-* quickly with their auxiliary target triples (`"-triple" "x86_64-unknown-linux-gnu" "-aux-triple" "nvptx64-nvidia-cuda"`)

For clang -gdwarf-4, I think it probably does not hurt when an auxiliary target triple does support DWARF v4 and downgrades to v2. For the testing tool llc, we probably should emit better diagnostic to remind the user.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87011



More information about the llvm-commits mailing list