diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2018-12-06 16:25:35 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2018-12-06 16:25:35 +0000 |
commit | 2e1a7821895ffdb6bb7309ad31853da082510f4b (patch) | |
tree | a9f0611255156c35620ad6d728fd6b5bfbbb8687 /llvm/lib | |
parent | e4c91f5c4c52cd36b8238d29b933f2866ea0d735 (diff) | |
download | bcm5719-llvm-2e1a7821895ffdb6bb7309ad31853da082510f4b.tar.gz bcm5719-llvm-2e1a7821895ffdb6bb7309ad31853da082510f4b.zip |
[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
llvm-svn: 348497
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp b/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp index e28d633fabe..aec0d7db81a 100644 --- a/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp @@ -881,8 +881,22 @@ void NVPTXAsmPrinter::emitHeader(Module &M, raw_ostream &O, 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"; |