llvm.org GIT mirror llvm / f37825c
[DEBUGINFO, NVPTX] Disable emission of ',debug' option if only debug directives are allowed. Summary: If the output of debug directives only is requested, we should drop emission of ',debug' option from the target directive. Required for supporting of nvprof profiler. Reviewers: echristo Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46061 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348497 91177308-0d34-0410-b5e6-96231b3b80d8 Alexey Bataev 1 year, 11 months ago
2 changed file(s) with 16 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
880880 if (NTM.getDrvInterface() == NVPTX::NVCL)
881881 O << ", texmode_independent";
882882
883 bool HasFullDebugInfo = false;
884 for (DICompileUnit *CU : M.debug_compile_units()) {
885 switch(CU->getEmissionKind()) {
886 case DICompileUnit::NoDebug:
887 case DICompileUnit::DebugDirectivesOnly:
888 break;
889 case DICompileUnit::LineTablesOnly:
890 case DICompileUnit::FullDebug:
891 HasFullDebugInfo = true;
892 break;
893 }
894 if (HasFullDebugInfo)
895 break;
896 }
883897 // FIXME: remove comment once debug info is properly supported.
884 if (MMI && MMI->hasDebugInfo())
898 if (MMI && MMI->hasDebugInfo() && HasFullDebugInfo)
885899 O << "//, debug";
886900
887901 O << "\n";
77 ;__device__ void bar() {}
88 ;}
99
10 ; CHECK: .target sm_{{[0-9]+}}//, debug
10 ; CHECK: .target sm_{{[0-9]+$}}
1111
1212 ; CHECK: .visible .func foo()
1313 ; CHECK: .loc [[FOO:[0-9]+]] 1 31