Reapply section moving, make sure string section is output last.
authorEric Christopher <echristo@gmail.com>
Tue, 27 Nov 2012 22:43:42 +0000 (22:43 +0000)
committerEric Christopher <echristo@gmail.com>
Tue, 27 Nov 2012 22:43:42 +0000 (22:43 +0000)
llvm-svn: 168736

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index 97f61e8..aacd839 100644 (file)
@@ -903,11 +903,60 @@ void DwarfDebug::endModule() {
   // Emit initial sections.
   emitSectionLabels();
 
-  // Emit all the DIEs into a debug info section
-  emitDebugInfo();
+  if (!useDwarfFission()) {
+    // Emit all the DIEs into a debug info section.
+    emitDebugInfo();
 
-  // Corresponding abbreviations into a abbrev section.
-  emitAbbreviations();
+    // Corresponding abbreviations into a abbrev section.
+    emitAbbreviations();
+
+    // Emit info into a debug loc section.
+    emitDebugLoc();
+
+    // Emit info into a debug aranges section.
+    emitDebugARanges();
+
+    // Emit info into a debug ranges section.
+    emitDebugRanges();
+
+    // Emit info into a debug macinfo section.
+    emitDebugMacInfo();
+
+    // Emit inline info.
+    // TODO: When we don't need the option anymore we
+    // can remove all of the code that this section
+    // depends upon.
+    if (useDarwinGDBCompat())
+      emitDebugInlineInfo();
+  } else {
+    // TODO: Fill this in for Fission sections and separate
+    // out information into new sections.
+
+    // Emit all the DIEs into a debug info section.
+    emitDebugInfo();
+
+    // Corresponding abbreviations into a abbrev section.
+    emitAbbreviations();
+
+    // Emit info into a debug loc section.
+    emitDebugLoc();
+
+    // Emit info into a debug aranges section.
+    emitDebugARanges();
+
+    // Emit info into a debug ranges section.
+    emitDebugRanges();
+
+    // Emit info into a debug macinfo section.
+    emitDebugMacInfo();
+
+    // Emit inline info.
+    // TODO: When we don't need the option anymore we
+    // can remove all of the code that this section
+    // depends upon.
+    if (useDarwinGDBCompat())
+      emitDebugInlineInfo();
+  }
 
   // Emit info into the dwarf accelerator table sections.
   if (useDwarfAccelTables()) {
@@ -923,26 +972,7 @@ void DwarfDebug::endModule() {
   if (useDarwinGDBCompat())
     emitDebugPubTypes();
 
-  // Emit info into a debug loc section.
-  emitDebugLoc();
-
-  // Emit info into a debug aranges section.
-  emitDebugARanges();
-
-  // Emit info into a debug ranges section.
-  emitDebugRanges();
-
-  // Emit info into a debug macinfo section.
-  emitDebugMacInfo();
-
-  // Emit inline info.
-  // TODO: When we don't need the option anymore we
-  // can remove all of the code that this section
-  // depends upon.
-  if (useDarwinGDBCompat())
-    emitDebugInlineInfo();
-
-  // Emit info into a debug str section.
+  // Finally emit string information into a string table.
   emitDebugStr();
 
   // clean up.