[llvm] r339970 - DebugInfo: Remove command line (& target-based) disabling of pubnames in favor of metadata

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 16 16:57:16 PDT 2018


Author: dblaikie
Date: Thu Aug 16 16:57:15 2018
New Revision: 339970

URL: http://llvm.org/viewvc/llvm-project?rev=339970&view=rev
Log:
DebugInfo: Remove command line (& target-based) disabling of pubnames in favor of metadata

Now that Clang disables NVPTX pubnames via metadata there's no need for
this fallback to target detection in the backend.

Removed:
    llvm/trunk/test/DebugInfo/X86/no-public-sections.ll
Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
    llvm/trunk/test/DebugInfo/NVPTX/cu-range-hole.ll
    llvm/trunk/test/DebugInfo/NVPTX/dbg-declare-alloca.ll
    llvm/trunk/test/DebugInfo/NVPTX/debug-info.ll
    llvm/trunk/test/DebugInfo/NVPTX/debug-loc-offset.ll
    llvm/trunk/test/DebugInfo/X86/sections_as_references.ll

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=339970&r1=339969&r2=339970&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Thu Aug 16 16:57:15 2018
@@ -891,8 +891,8 @@ bool DwarfCompileUnit::hasDwarfPubSectio
   case DICompileUnit::DebugNameTableKind::GNU:
     return true;
   case DICompileUnit::DebugNameTableKind::Default:
-    return DD->tuneForGDB() && DD->usePubSections() &&
-           !includeMinimalInlineScopes() && !CUNode->isDebugDirectivesOnly();
+    return DD->tuneForGDB() && !includeMinimalInlineScopes() &&
+           !CUNode->isDebugDirectivesOnly();
   }
 }
 

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=339970&r1=339969&r2=339970&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Thu Aug 16 16:57:15 2018
@@ -130,11 +130,6 @@ DwarfInlinedStrings("dwarf-inlined-strin
                  cl::init(Default));
 
 static cl::opt<bool>
-    NoDwarfPubSections("no-dwarf-pub-sections", cl::Hidden,
-                       cl::desc("Disable emission of DWARF pub sections."),
-                       cl::init(false));
-
-static cl::opt<bool>
     NoDwarfRangesSection("no-dwarf-ranges-section", cl::Hidden,
                          cl::desc("Disable emission .debug_ranges section."),
                          cl::init(false));
@@ -355,7 +350,6 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Mo
   DwarfVersion =
       TT.isNVPTX() ? 2 : (DwarfVersion ? DwarfVersion : dwarf::DWARF_VERSION);
 
-  UsePubSections = !NoDwarfPubSections && !TT.isNVPTX();
   UseRangesSection = !NoDwarfRangesSection && !TT.isNVPTX();
 
   // Use sections as references. Force for NVPTX.

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=339970&r1=339969&r2=339970&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Thu Aug 16 16:57:15 2018
@@ -266,9 +266,6 @@ class DwarfDebug : public DebugHandlerBa
   /// Use inlined strings.
   bool UseInlineStrings = false;
 
-  /// Whether to emit DWARF pub sections or not.
-  bool UsePubSections = true;
-
   /// Allow emission of .debug_ranges section.
   bool UseRangesSection = true;
 
@@ -543,9 +540,6 @@ public:
   /// Returns whether to use inline strings.
   bool useInlineStrings() const { return UseInlineStrings; }
 
-  /// Returns whether GNU pub sections should be emitted.
-  bool usePubSections() const { return UsePubSections; }
-
   /// Returns whether ranges section should be emitted.
   bool useRangesSection() const { return UseRangesSection; }
 

Modified: llvm/trunk/test/DebugInfo/NVPTX/cu-range-hole.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/NVPTX/cu-range-hole.ll?rev=339970&r1=339969&r2=339970&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/NVPTX/cu-range-hole.ll (original)
+++ llvm/trunk/test/DebugInfo/NVPTX/cu-range-hole.ll Thu Aug 16 16:57:15 2018
@@ -280,7 +280,7 @@ attributes #1 = { nounwind readnone }
 !llvm.module.flags = !{!11, !12}
 
 !0 = !{!"clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)"}
-!1 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)", isOptimized: false, emissionKind: FullDebug, file: !2, enums: !3, retainedTypes: !3, globals: !3, imports: !3)
+!1 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 204164) (llvm/trunk 204183)", isOptimized: false, emissionKind: FullDebug, file: !2, enums: !3, retainedTypes: !3, globals: !3, imports: !3, nameTableKind: None)
 !2 = !DIFile(filename: "b.c", directory: "/source")
 !3 = !{}
 !5 = distinct !DISubprogram(name: "b", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !1, scopeLine: 1, file: !2, scope: !6, type: !7, retainedNodes: !3)

Modified: llvm/trunk/test/DebugInfo/NVPTX/dbg-declare-alloca.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/NVPTX/dbg-declare-alloca.ll?rev=339970&r1=339969&r2=339970&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/NVPTX/dbg-declare-alloca.ll (original)
+++ llvm/trunk/test/DebugInfo/NVPTX/dbg-declare-alloca.ll Thu Aug 16 16:57:15 2018
@@ -237,7 +237,7 @@ attributes #1 = { nounwind readnone spec
 !llvm.module.flags = !{!3, !4, !5}
 !llvm.ident = !{!6}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
 !1 = !DIFile(filename: "t.c", directory: "test")
 !2 = !{}
 !3 = !{i32 2, !"Dwarf Version", i32 2}

Modified: llvm/trunk/test/DebugInfo/NVPTX/debug-info.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/NVPTX/debug-info.ll?rev=339970&r1=339969&r2=339970&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/NVPTX/debug-info.ll (original)
+++ llvm/trunk/test/DebugInfo/NVPTX/debug-info.ll Thu Aug 16 16:57:15 2018
@@ -8420,7 +8420,7 @@ attributes #3 = { nounwind }
 !nvvm.internalize.after.link = !{}
 !nvvmir.version = !{!565}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, imports: !3)
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, imports: !3, nameTableKind: None)
 !1 = !DIFile(filename: "debug-info.cu", directory: "/some/directory")
 !2 = !{}
 !3 = !{!4, !11, !16, !18, !20, !22, !24, !28, !30, !32, !34, !36, !38, !40, !42, !44, !46, !48, !50, !52, !54, !56, !60, !62, !64, !66, !71, !76, !78, !80, !85, !89, !91, !93, !95, !97, !99, !101, !103, !105, !110, !114, !116, !118, !122, !124, !126, !128, !130, !132, !136, !138, !140, !145, !153, !157, !159, !161, !163, !165, !169, !171, !173, !177, !179, !181, !183, !185, !187, !189, !191, !193, !195, !201, !203, !205, !209, !211, !213, !215, !217, !219, !221, !223, !227, !231, !233, !235, !240, !242, !244, !246, !248, !250, !252, !257, !263, !267, !271, !276, !279, !283, !287, !302, !306, !310, !314, !318, !323, !325, !329, !333, !337, !345, !349, !353, !357, !361, !366, !372, !376, !380, !382, !390, !394, !401, !403, !405, !409, !413, !417, !422, !426, !431, !432, !433, !434, !436, !437, !438, !439, !440, !441, !442, !446, !448, !450, !452, !454, !456, !458, !460, !463, !465, !467, !469, !471, !473, !475, !477, !479, !481, !483, !485, !487, !489, !491, !493, !495, !497, !499, !501, !503, !505, !507, !509, !511, !513, !515, !517, !519, !521, !523, !525, !527, !529, !531, !533, !535, !537, !539, !541, !543, !545, !547, !549, !551, !553}

Modified: llvm/trunk/test/DebugInfo/NVPTX/debug-loc-offset.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/NVPTX/debug-loc-offset.ll?rev=339970&r1=339969&r2=339970&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/NVPTX/debug-loc-offset.ll (original)
+++ llvm/trunk/test/DebugInfo/NVPTX/debug-loc-offset.ll Thu Aug 16 16:57:15 2018
@@ -93,7 +93,7 @@ attributes #2 = { "less-precise-fpmad"="
 !llvm.module.flags = !{!18, !19}
 !llvm.ident = !{!20, !20}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (210479)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (210479)", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2, nameTableKind: None)
 !1 = !DIFile(filename: "debug-loc-offset1.cc", directory: "/llvm_cmake_gcc")
 !2 = !{}
 !4 = distinct !DISubprogram(name: "bar", linkageName: "_Z3bari", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !6, retainedNodes: !2)
@@ -101,7 +101,7 @@ attributes #2 = { "less-precise-fpmad"="
 !6 = !DISubroutineType(types: !7)
 !7 = !{!8, !8}
 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (210479)", isOptimized: false, emissionKind: FullDebug, file: !10, enums: !2, retainedTypes: !11, globals: !2, imports: !2)
+!9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 (210479)", isOptimized: false, emissionKind: FullDebug, file: !10, enums: !2, retainedTypes: !11, globals: !2, imports: !2, nameTableKind: None)
 !10 = !DIFile(filename: "debug-loc-offset2.cc", directory: "/llvm_cmake_gcc")
 !11 = !{!12}
 !12 = !DICompositeType(tag: DW_TAG_structure_type, name: "A", line: 1, flags: DIFlagFwdDecl, file: !10, identifier: "_ZTS1A")

Removed: llvm/trunk/test/DebugInfo/X86/no-public-sections.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/no-public-sections.ll?rev=339969&view=auto
==============================================================================
--- llvm/trunk/test/DebugInfo/X86/no-public-sections.ll (original)
+++ llvm/trunk/test/DebugInfo/X86/no-public-sections.ll (removed)
@@ -1,31 +0,0 @@
-; RUN: llc -mtriple=x86_64-pc-linux-gnu -debugger-tune=gdb -filetype=asm < %s -no-dwarf-pub-sections | FileCheck %s --check-prefix=DISABLED
-; RUN: llc -mtriple=x86_64-pc-linux-gnu -debugger-tune=gdb -filetype=asm < %s | FileCheck %s
-
-; DISABLED-NOT: {{.debug_pubnames|.debug_pubtypes}}
-; CHECK-DAG: .section .debug_pubnames
-; CHECK-DAG: .section .debug_pubtypes
-
-%struct.bar = type { %"struct.ns::foo" }
-%"struct.ns::foo" = type { i8 }
-
- at b = global %struct.bar zeroinitializer, align 1, !dbg !0
-
-!llvm.dbg.cu = !{!2}
-!llvm.module.flags = !{!11, !12}
-!llvm.ident = !{!13}
-
-!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
-!1 = distinct !DIGlobalVariable(name: "b", scope: !2, file: !3, line: 8, type: !6, isLocal: false, isDefinition: true)
-!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, nameTableKind: Default)
-!3 = !DIFile(filename: "type.cpp", directory: "/tmp/dbginfo")
-!4 = !{}
-!5 = !{!0}
-!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "bar", file: !3, line: 5, size: 8, elements: !7, identifier: "_ZTS3bar")
-!7 = !{!8}
-!8 = !DIDerivedType(tag: DW_TAG_member, name: "f", scope: !6, file: !3, line: 6, baseType: !9, size: 8)
-!9 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "foo", scope: !10, file: !3, line: 2, size: 8, elements: !4, identifier: "_ZTSN2ns3fooE")
-!10 = !DINamespace(name: "ns", scope: null)
-!11 = !{i32 2, !"Dwarf Version", i32 4}
-!12 = !{i32 2, !"Debug Info Version", i32 3}
-!13 = !{!"clang"}
-

Modified: llvm/trunk/test/DebugInfo/X86/sections_as_references.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/sections_as_references.ll?rev=339970&r1=339969&r2=339970&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/X86/sections_as_references.ll (original)
+++ llvm/trunk/test/DebugInfo/X86/sections_as_references.ll Thu Aug 16 16:57:15 2018
@@ -1,4 +1,4 @@
-; RUN: llc -filetype=asm -O0 -mtriple=x86_64-linux-gnu < %s -dwarf-sections-as-references=Enable -dwarf-inlined-strings=Enable -no-dwarf-pub-sections -no-dwarf-ranges-section -dwarf-version 2 -debugger-tune=gdb | FileCheck %s
+; RUN: llc -filetype=asm -O0 -mtriple=x86_64-linux-gnu < %s -dwarf-sections-as-references=Enable -dwarf-inlined-strings=Enable -no-dwarf-ranges-section -dwarf-version 2 -debugger-tune=gdb | FileCheck %s
 
 ; CHECK:      .file
 
@@ -44,10 +44,10 @@ source_filename = "test/DebugInfo/X86/se
 !6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())
 !7 = !DIGlobalVariable(name: "g", scope: null, file: !8, line: 2, type: !3, isLocal: false, isDefinition: true)
 !8 = !DIFile(filename: "tu2.cpp", directory: "/dir")
-!9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !10, globals: !11, imports: !5)
+!9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !10, globals: !11, imports: !5, nameTableKind: None)
 !10 = !{!3}
 !11 = !{!0}
-!12 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !8, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !10, globals: !13, imports: !5)
+!12 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !8, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !10, globals: !13, imports: !5, nameTableKind: None)
 !13 = !{!6}
 !14 = !{i32 2, !"Dwarf Version", i32 2}
 !15 = !{i32 1, !"Debug Info Version", i32 3}




More information about the llvm-commits mailing list