[llvm] r203634 - DebugInfo: Omit pubnames/pubtypes when compiling with -gmlt

David Blaikie dblaikie at gmail.com
Tue Mar 11 20:34:38 PDT 2014


Author: dblaikie
Date: Tue Mar 11 22:34:38 2014
New Revision: 203634

URL: http://llvm.org/viewvc/llvm-project?rev=203634&view=rev
Log:
DebugInfo: Omit pubnames/pubtypes when compiling with -gmlt

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
    llvm/trunk/test/DebugInfo/cu-line-tables.ll

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=203634&r1=203633&r2=203634&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Tue Mar 11 22:34:38 2014
@@ -998,8 +998,9 @@ void DwarfUnit::updateAcceleratorTables(
     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 N
 
 /// 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;
 }

Modified: llvm/trunk/test/DebugInfo/cu-line-tables.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/cu-line-tables.ll?rev=203634&r1=203633&r2=203634&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/cu-line-tables.ll (original)
+++ llvm/trunk/test/DebugInfo/cu-line-tables.ll Tue Mar 11 22:34:38 2014
@@ -12,6 +12,12 @@
 ; CHECK: .debug_ranges contents:
 ; CHECK-NOT: 00000000 <End of list>
 
+; 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:





More information about the llvm-commits mailing list