Refactor the section emission code to remove duplicates now that
authorEric Christopher <echristo@gmail.com>
Tue, 19 Nov 2013 09:04:50 +0000 (09:04 +0000)
committerEric Christopher <echristo@gmail.com>
Tue, 19 Nov 2013 09:04:50 +0000 (09:04 +0000)
we can emit various sections in any order.
No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195120 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index 81d7e249efaf66576c7bc228d6d245de3c7fc151..9c75373765a35b86986ad9a47e11cacf9803c3bb 100644 (file)
@@ -1165,54 +1165,30 @@ void DwarfDebug::endModule() {
   // Finalize the debug info for the module.
   finalizeModuleInfo();
 
-  if (!useSplitDwarf()) {
-    emitDebugStr();
+  emitDebugStr();
 
-    // Emit all the DIEs into a debug info section.
-    emitDebugInfo();
+  // 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 loc section.
+  emitDebugLoc();
 
-    // Emit info into a debug aranges section.
-    emitDebugARanges();
+  // Emit info into a debug aranges section.
+  emitDebugARanges();
 
-    // Emit info into a debug ranges section.
-    emitDebugRanges();
+  // Emit info into a debug ranges section.
+  emitDebugRanges();
 
-    // Emit info into a debug macinfo section.
-    emitDebugMacInfo();
+  // Emit info into a debug macinfo section.
+  emitDebugMacInfo();
 
-  } else {
-    // TODO: Fill this in for separated debug sections and separate
-    // out information into new sections.
-    emitDebugStr();
-    if (useSplitDwarf())
-      emitDebugStrDWO();
-
-    // Emit the debug info section and compile units.
-    emitDebugInfo();
+  if (useSplitDwarf()) {
+    emitDebugStrDWO();
     emitDebugInfoDWO();
-
-    // Corresponding abbreviations into a abbrev section.
-    emitAbbreviations();
     emitDebugAbbrevDWO();
-
-    // 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 DWO addresses.
     InfoHolder.emitAddresses(Asm->getObjFileLowering().getDwarfAddrSection());
   }