[PATCH] D57250: [DEBUG_INFO][NVPTX]Emit empty .debug_loc section in presence of the debug option.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 8 12:08:06 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL355719: [DEBUG_INFO][NVPTX]Emit empty .debug_loc section in presence of the debug… (authored by ABataev, committed by ).

Repository:
  rL LLVM

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

https://reviews.llvm.org/D57250

Files:
  llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
  llvm/trunk/test/DebugInfo/NVPTX/debug-empty.ll


Index: llvm/trunk/test/DebugInfo/NVPTX/debug-empty.ll
===================================================================
--- llvm/trunk/test/DebugInfo/NVPTX/debug-empty.ll
+++ llvm/trunk/test/DebugInfo/NVPTX/debug-empty.ll
@@ -1,6 +1,7 @@
 ; RUN: llc < %s -mtriple=nvptx64-nvidia-cuda | FileCheck %s
 
 ; CHECK: .target sm_{{[0-9]+$}}
+; CHECK: .section .debug_loc { }
 ; CHECK-NOT: }
 
 !llvm.dbg.cu = !{!0}
Index: llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
===================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
+++ llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
@@ -954,9 +954,12 @@
 
   delete[] gv_array;
   // Close the last emitted section
-  if (HasDebugInfo)
+  if (HasDebugInfo) {
     static_cast<NVPTXTargetStreamer *>(OutStreamer->getTargetStreamer())
         ->closeLastSection();
+    // Emit empty .debug_loc section for better support of the empty files.
+    OutStreamer->EmitRawText("\t.section\t.debug_loc\t{\t}");
+  }
 
   // Output last DWARF .file directives, if any.
   static_cast<NVPTXTargetStreamer *>(OutStreamer->getTargetStreamer())


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57250.189903.patch
Type: text/x-patch
Size: 1137 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190308/700bfc09/attachment.bin>


More information about the llvm-commits mailing list