From 9d3e746b85b73cdd557872d9e47aff02d43b56ad Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Wed, 12 Mar 2014 03:34:38 +0000 Subject: [PATCH] DebugInfo: Omit pubnames/pubtypes when compiling with -gmlt git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203634 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 7 +++++-- test/DebugInfo/cu-line-tables.ll | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index e046bf417b6..fe5ded34cbe 100644 --- a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -998,8 +998,9 @@ void DwarfUnit::updateAcceleratorTables(DIScope Context, DIType Ty, unsigned Flags = IsImplementation ? dwarf::DW_FLAG_type_implementation : 0; addAccelType(Ty.getName(), std::make_pair(TyDIE, Flags)); - if (!Context || Context.isCompileUnit() || Context.isFile() || - Context.isNameSpace()) + if ((!Context || Context.isCompileUnit() || Context.isFile() || + Context.isNameSpace()) && + getCUNode().getEmissionKind() != DIBuilder::LineTablesOnly) GlobalTypes[getParentContextString(Context) + Ty.getName().str()] = TyDIE; } } @@ -1064,6 +1065,8 @@ void DwarfUnit::addAccelType(StringRef Name, /// addGlobalName - Add a new global name to the compile unit. void DwarfUnit::addGlobalName(StringRef Name, DIE *Die, DIScope Context) { + if (getCUNode().getEmissionKind() == DIBuilder::LineTablesOnly) + return; std::string FullName = getParentContextString(Context) + Name.str(); GlobalNames[FullName] = Die; } diff --git a/test/DebugInfo/cu-line-tables.ll b/test/DebugInfo/cu-line-tables.ll index 493184dba1d..2179bd57b82 100644 --- a/test/DebugInfo/cu-line-tables.ll +++ b/test/DebugInfo/cu-line-tables.ll @@ -12,6 +12,12 @@ ; CHECK: .debug_ranges contents: ; CHECK-NOT: 00000000 +; CHECK: .debug_pubnames contents: +; CHECK-NOT: Offset + +; CHECK: .debug_pubtypes contents: +; CHECK-NOT: Offset + ; Function Attrs: nounwind uwtable define i32 @f(i32 %a) #0 { entry: -- 2.34.1