<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Sep 23, 2013 at 1:55 PM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: echristo<br>
Date: Mon Sep 23 15:55:35 2013<br>
New Revision: 191225<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=191225&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=191225&view=rev</a><br>
Log:<br>
Handle gnu pubtypes sections:<br>
<br>
a) Make sure we are emitting the correct section in our section labels<br>
when we begin the module.<br>
b) Make sure we are emitting the correct pubtypes section in the<br>
presence of gnu pubtypes.<br>
c) For C++ struct, union, class, and enumeration types are default<br>
external.<br></blockquote><div><br></div><div>I take it we should be seeing that type (which type is it? 'C' I guess?) in the pubnames section too? (we had no types being checked for, nor emitted, in the test as originally committed - I assume that's a bug? but I had seen types emitted in some cases I'd been experimenting with)<br>
<br>I'll look into adding dumping support for pubtypes.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Modified:<br>
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
    llvm/trunk/test/DebugInfo/X86/gnu-public-names.ll<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=191225&r1=191224&r2=191225&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=191225&r1=191224&r2=191225&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Sep 23 15:55:35 2013<br>
@@ -1966,12 +1966,12 @@ void DwarfDebug::emitSectionLabels() {<br>
   DwarfLineSectionSym =<br>
     emitSectionSym(Asm, TLOF.getDwarfLineSection(), "section_line");<br>
   emitSectionSym(Asm, TLOF.getDwarfLocSection());<br>
-  if (HasDwarfPubSections) {<br>
-    emitSectionSym(Asm, TLOF.getDwarfPubNamesSection());<br>
-    emitSectionSym(Asm, TLOF.getDwarfPubTypesSection());<br>
-  } else if (GenerateGnuPubSections) {<br>
+  if (GenerateGnuPubSections) {<br>
     emitSectionSym(Asm, TLOF.getDwarfGnuPubNamesSection());<br>
     emitSectionSym(Asm, TLOF.getDwarfGnuPubTypesSection());<br>
+  } else if (HasDwarfPubSections) {<br>
+    emitSectionSym(Asm, TLOF.getDwarfPubNamesSection());<br>
+    emitSectionSym(Asm, TLOF.getDwarfPubTypesSection());<br>
   }<br>
<br>
   DwarfStrSectionSym =<br>
@@ -2358,6 +2358,10 @@ static dwarf::PubIndexEntryDescriptor co<br>
   case dwarf::DW_TAG_structure_type:<br>
   case dwarf::DW_TAG_union_type:<br>
   case dwarf::DW_TAG_enumeration_type:<br>
+    return dwarf::PubIndexEntryDescriptor(<br>
+        dwarf::GIEK_TYPE, CU->getLanguage() != dwarf::DW_LANG_C_plus_plus<br>
+                              ? dwarf::GIEL_STATIC<br>
+                              : dwarf::GIEL_EXTERNAL);<br>
   case dwarf::DW_TAG_typedef:<br>
   case dwarf::DW_TAG_base_type:<br>
   case dwarf::DW_TAG_subrange_type:<br>
@@ -2446,7 +2450,9 @@ void DwarfDebug::emitDebugPubNames(bool<br>
<br>
 void DwarfDebug::emitDebugPubTypes(bool GnuStyle) {<br>
   const MCSection *ISec = Asm->getObjFileLowering().getDwarfInfoSection();<br>
-  const MCSection *PSec = Asm->getObjFileLowering().getDwarfPubTypesSection();<br>
+  const MCSection *PSec =<br>
+      GnuStyle ? Asm->getObjFileLowering().getDwarfGnuPubTypesSection()<br>
+               : Asm->getObjFileLowering().getDwarfPubTypesSection();<br>
<br>
   for (DenseMap<const MDNode *, CompileUnit *>::iterator I = CUMap.begin(),<br>
                                                          E = CUMap.end();<br>
<br>
Modified: llvm/trunk/test/DebugInfo/X86/gnu-public-names.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/gnu-public-names.ll?rev=191225&r1=191224&r2=191225&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/gnu-public-names.ll?rev=191225&r1=191224&r2=191225&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/test/DebugInfo/X86/gnu-public-names.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/X86/gnu-public-names.ll Mon Sep 23 15:55:35 2013<br>
@@ -33,9 +33,12 @@<br>
 ;   int global_namespace_variable = 1;<br>
 ; }<br>
<br>
-<br>
+; ASM: .section        .debug_gnu_pubnames<br>
 ; ASM: .byte   32                      # Kind: VARIABLE, EXTERNAL<br>
<br>
+; ASM: .section        .debug_gnu_pubtypes<br>
+; ASM: .byte   16                      # Kind: TYPE, EXTERNAL<br>
+<br>
 ; CHECK: .debug_info contents:<br>
 ; CHECK: 0x00000046: DW_TAG_subprogram<br>
 ; CHECK-NEXT: DW_AT_MIPS_linkage_name<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>