llvm.org GIT mirror llvm / c30eca2
[DEBUG_INFO][NVPTX]Emit empty .debug_loc section in presence of the debug option. Summary: If the LLVM module shows that it has debug info, but the file is actually empty and the real debug info is not emitted, the ptxas tool emits error 'Debug information not found in presence of .target debug'. We need at leas one empty debug section to silence this message. Section `.debug_loc` is not emitted for PTX and we can emit empty `.debug_loc` section if `debug` option was emitted. Reviewers: tra Subscribers: jholewinski, aprantl, llvm-commits Differential Revision: https://reviews.llvm.org/D57250 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355719 91177308-0d34-0410-b5e6-96231b3b80d8 Alexey Bataev 1 year, 8 months ago
2 changed file(s) with 5 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
953953
954954 delete[] gv_array;
955955 // Close the last emitted section
956 if (HasDebugInfo)
956 if (HasDebugInfo) {
957957 static_cast(OutStreamer->getTargetStreamer())
958958 ->closeLastSection();
959 // Emit empty .debug_loc section for better support of the empty files.
960 OutStreamer->EmitRawText("\t.section\t.debug_loc\t{\t}");
961 }
959962
960963 // Output last DWARF .file directives, if any.
961964 static_cast(OutStreamer->getTargetStreamer())
0 ; RUN: llc < %s -mtriple=nvptx64-nvidia-cuda | FileCheck %s
11
22 ; CHECK: .target sm_{{[0-9]+$}}
3 ; CHECK: .section .debug_loc { }
34 ; CHECK-NOT: }
45
56 !llvm.dbg.cu = !{!0}