From: David Blaikie Date: Thu, 16 Aug 2018 23:56:32 +0000 (+0000) Subject: Disable pubnames in NVPTX debug info using metadata X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=18639d8d29ddb46ac09e359607534b5dd7d2dc51;p=clang Disable pubnames in NVPTX debug info using metadata git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339968 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index e6136d5157..c7637ef47d 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/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/test/CodeGen/debug-nvptx.c b/test/CodeGen/debug-nvptx.c new file mode 100644 index 0000000000..ceff300829 --- /dev/null +++ b/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) { +}