summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2018-12-06 16:25:35 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2018-12-06 16:25:35 +0000
commit2e1a7821895ffdb6bb7309ad31853da082510f4b (patch)
treea9f0611255156c35620ad6d728fd6b5bfbbb8687 /llvm/lib
parente4c91f5c4c52cd36b8238d29b933f2866ea0d735 (diff)
downloadbcm5719-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.cpp16
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";
OpenPOWER on IntegriCloud