sink dwarf finalization out of each target into AsmPrinter::doFinalization
authorChris Lattner <sabre@nondot.org>
Wed, 24 Jun 2009 18:54:37 +0000 (18:54 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 24 Jun 2009 18:54:37 +0000 (18:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74097 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
lib/Target/XCore/XCoreAsmPrinter.cpp

index 2b1b48f60e1f98778f0224700ff29ff9ddd2d113..bf4af42628f643504ce956ce2ef4a280fb30eef6 100644 (file)
@@ -192,6 +192,10 @@ bool AsmPrinter::doInitialization(Module &M) {
 }
 
 bool AsmPrinter::doFinalization(Module &M) {
+  // Emit final debug information.
+  if (TAI->doesSupportDebugInformation() || TAI->doesSupportExceptionHandling())
+    DW->EndModule();
+  
   // If the target wants to know about weak references, print them all.
   if (TAI->getWeakRefDirective()) {
     // FIXME: This is not lazy, it would be nice to only print weak references
index fcc30c1c6586d1bdc1b0d2013d03ae18a879203b..b4616cd6e77f9a80e52719d3c2d3e48104276f93 100644 (file)
@@ -1118,18 +1118,12 @@ bool ARMAsmPrinter::doFinalization(Module &M) {
     }
 
 
-    // Emit initial debug information.
-    DW->EndModule();
-
     // Funny Darwin hack: This flag tells the linker that no global symbols
     // contain code that falls through to other global symbols (e.g. the obvious
     // implementation of multiple entry points).  If this doesn't occur, the
     // linker can safely perform dead code stripping.  Since LLVM never
     // generates code that does this, it is always safe to set.
     O << "\t.subsections_via_symbols\n";
-  } else {
-    // Emit final debug information for ELF.
-    DW->EndModule();
   }
 
   return AsmPrinter::doFinalization(M);
index e31163ed600ef77ef97485a409b5dcf0f24edc8b..6f0bd98b3114ace13b333e6fb9f220b680307c55 100644 (file)
@@ -591,9 +591,6 @@ bool LinuxAsmPrinter::doFinalization(Module &M) {
        I != E; ++I)
     printModuleLevelGV(I);
 
-  // Emit initial debug information.
-  DW->EndModule();
-
   return AsmPrinter::doFinalization(M);
 }
 
index a77c8134bffde2305a77094e1c6d6fd7005bd173..08b0de593d9b771b35596e18cddf1c7b5d0821f2 100644 (file)
@@ -746,11 +746,6 @@ bool PPCLinuxAsmPrinter::doFinalization(Module &M) {
        I != E; ++I)
     printModuleLevelGV(I);
 
-  // TODO
-
-  // Emit initial debug information.
-  DW->EndModule();
-
   return AsmPrinter::doFinalization(M);
 }
 
@@ -1120,10 +1115,6 @@ bool PPCDarwinAsmPrinter::doFinalization(Module &M) {
     }
   }
 
-
-  // Emit initial debug information.
-  DW->EndModule();
-
   // Funny Darwin hack: This flag tells the linker that no global symbols
   // contain code that falls through to other global symbols (e.g. the obvious
   // implementation of multiple entry points).  If this doesn't occur, the
index cb7553181865eb6c85d58d5b2b0d53a30aad78ec..b8a9727fcd29a075aba398e755cc48a6a0aa9183 100644 (file)
@@ -1172,11 +1172,6 @@ bool X86ATTAsmPrinter::doFinalization(Module &M) {
       O << "\t.ascii \" -export:" << i->getKeyData() << "\"\n";
   }
   
-  // Emit final debug information.
-  // FIXME: Sink into DoFinalization.
-  if (TAI->doesSupportDebugInformation() || TAI->doesSupportExceptionHandling())
-    DW->EndModule();
-
   // Do common shutdown.
   bool Changed = AsmPrinter::doFinalization(M);
   
index b87d88fb9923ff2b6cc2711a839d82cf07ba9496..4ab5d75e5b7158b6c4d23baaef21bf6029cc1b04 100644 (file)
@@ -436,8 +436,5 @@ bool XCoreAsmPrinter::doFinalization(Module &M) {
     emitGlobal(I);
   }
   
-  // Emit final debug information.
-  DW->EndModule();
-
   return AsmPrinter::doFinalization(M);
 }