[PATCH] D46061: [DEBUGINFO, NVPTX] Disable emission of ', debug' option if only debug directives are allowed.
Alexey Bataev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 6 08:28:39 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL348497: [DEBUGINFO, NVPTX] Disable emission of ',debug' option if only debug directives… (authored by ABataev, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D46061?vs=173352&id=176984#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D46061/new/
https://reviews.llvm.org/D46061
Files:
llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
llvm/trunk/test/DebugInfo/NVPTX/debug-file-loc-only.ll
Index: llvm/trunk/test/DebugInfo/NVPTX/debug-file-loc-only.ll
===================================================================
--- llvm/trunk/test/DebugInfo/NVPTX/debug-file-loc-only.ll
+++ llvm/trunk/test/DebugInfo/NVPTX/debug-file-loc-only.ll
@@ -8,7 +8,7 @@
;__device__ void bar() {}
;}
-; CHECK: .target sm_{{[0-9]+}}//, debug
+; CHECK: .target sm_{{[0-9]+$}}
; CHECK: .visible .func foo()
; CHECK: .loc [[FOO:[0-9]+]] 1 31
Index: llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
===================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
+++ llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
@@ -881,8 +881,22 @@
if (NTM.getDrvInterface() == NVPTX::NVCL)
O << ", texmode_independent";
+ bool HasFullDebugInfo = false;
+ for (DICompileUnit *CU : M.debug_compile_units()) {
+ switch(CU->getEmissionKind()) {
+ case DICompileUnit::NoDebug:
+ case DICompileUnit::DebugDirectivesOnly:
+ break;
+ case DICompileUnit::LineTablesOnly:
+ case DICompileUnit::FullDebug:
+ HasFullDebugInfo = true;
+ break;
+ }
+ if (HasFullDebugInfo)
+ break;
+ }
// FIXME: remove comment once debug info is properly supported.
- if (MMI && MMI->hasDebugInfo())
+ if (MMI && MMI->hasDebugInfo() && HasFullDebugInfo)
O << "//, debug";
O << "\n";
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46061.176984.patch
Type: text/x-patch
Size: 1361 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181206/b7118f25/attachment.bin>
More information about the llvm-commits
mailing list