[llvm] r195120 - Refactor the section emission code to remove duplicates now that

Eric Christopher echristo at gmail.com
Tue Nov 19 01:04:50 PST 2013


Author: echristo
Date: Tue Nov 19 03:04:50 2013
New Revision: 195120

URL: http://llvm.org/viewvc/llvm-project?rev=195120&view=rev
Log:
Refactor the section emission code to remove duplicates now that
we can emit various sections in any order.
No functional change.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=195120&r1=195119&r2=195120&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Nov 19 03:04:50 2013
@@ -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());
   }





More information about the llvm-commits mailing list