[PATCH] D41827: [DEBUG] Initial adaptation of NVPTX target for debug info emission.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 07:32:18 PST 2018


ABataev added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:416
     DIE &Die, SmallVector<RangeSpan, 2> Ranges) {
-  if (Ranges.size() == 1) {
-    const auto &single = Ranges.front();
-    attachLowHighPC(Die, single.getStart(), single.getEnd());
+  if (Ranges.size() == 1 || DD->useSectionsAsReferences()) {
+    const auto &front = Ranges.front();
----------------
probinson wrote:
> ABataev wrote:
> > echristo wrote:
> > > I don't believe that this is a necessary or sufficient check here. What's the point of it?
> > PTX format does not allow use of `.debug_ranges` section, we should not emit it.
> The .debug_ranges section was not defined in DWARF v2.  Better to avoid emitting it based on the DWARF version.
It won't be emitted  (at least for NVPTX). I'm not sure about other targets. Maybe they allow to use  `.debug_ranges` sections even for DWARF2?


================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:274
+    DebuggerTuning = DebuggerKind::GDB;
+  else if (Asm->TM.Options.DebuggerTuning != DebuggerKind::Default)
     DebuggerTuning = Asm->TM.Options.DebuggerTuning;
----------------
probinson wrote:
> Unconditionally ignoring a command-line option?  Are there tests that fail if you don't do this?
I'm not aware of any, did it just in case if there are such cases.


Repository:
  rL LLVM

https://reviews.llvm.org/D41827





More information about the llvm-commits mailing list