summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2018-08-16 23:56:32 +0000
committerDavid Blaikie <dblaikie@gmail.com>2018-08-16 23:56:32 +0000
commit9982bb873993c99e4a6a0ade6349519ff193d559 (patch)
tree3a629f330d750e45056d5b1614fdb377d117217c
parente76fa9eccaec169913725487c1760341ff4853d4 (diff)
downloadbcm5719-llvm-9982bb873993c99e4a6a0ade6349519ff193d559.tar.gz
bcm5719-llvm-9982bb873993c99e4a6a0ade6349519ff193d559.zip
Disable pubnames in NVPTX debug info using metadata
llvm-svn: 339968
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp7
-rw-r--r--clang/test/CodeGen/debug-nvptx.c6
2 files changed, 11 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index e6136d51573..c7637ef47d1 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -579,8 +579,11 @@ void CGDebugInfo::CreateCompileUnit() {
CGOpts.DwarfDebugFlags, RuntimeVers,
CGOpts.EnableSplitDwarf ? "" : CGOpts.SplitDwarfFile, EmissionKind,
0 /* DWOid */, CGOpts.SplitDwarfInlining, CGOpts.DebugInfoForProfiling,
- CGOpts.GnuPubnames ? llvm::DICompileUnit::DebugNameTableKind::GNU
- : llvm::DICompileUnit::DebugNameTableKind::Default);
+ CGM.getTarget().getTriple().isNVPTX()
+ ? llvm::DICompileUnit::DebugNameTableKind::None
+ : CGOpts.GnuPubnames
+ ? llvm::DICompileUnit::DebugNameTableKind::GNU
+ : llvm::DICompileUnit::DebugNameTableKind::Default);
}
llvm::DIType *CGDebugInfo::CreateType(const BuiltinType *BT) {
diff --git a/clang/test/CodeGen/debug-nvptx.c b/clang/test/CodeGen/debug-nvptx.c
new file mode 100644
index 00000000000..ceff3008296
--- /dev/null
+++ b/clang/test/CodeGen/debug-nvptx.c
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -triple nvptx-unknown-unknown -S -o - -debug-info-kind=limited %s -emit-llvm | FileCheck %s
+
+// CHECK: DICompileUnit({{.*}}, nameTableKind: None)
+
+void f1(void) {
+}
OpenPOWER on IntegriCloud