Emit debug info for data-only files. This version
authorDale Johannesen <dalej@apple.com>
Wed, 9 Jul 2008 20:55:35 +0000 (20:55 +0000)
committerDale Johannesen <dalej@apple.com>
Wed, 9 Jul 2008 20:55:35 +0000 (20:55 +0000)
is X86 ATT only.

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

lib/Target/X86/X86ATTAsmPrinter.cpp

index 51fc3bb3df18d0e640a2cfbe0954b62a3f6f89d7..8c688f354fae50989d798147c85d9e22d8e03a7e 100644 (file)
@@ -216,13 +216,6 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   const Function *F = MF.getFunction();
   unsigned CC = F->getCallingConv();
 
-  if (TAI->doesSupportDebugInformation()) {
-    // Let PassManager know we need debug information and relay
-    // the MachineModuleInfo address on to DwarfWriter.
-    MMI = &getAnalysis<MachineModuleInfo>();
-    DW.SetModuleInfo(MMI);
-  }
-
   SetupMachineFunction(MF);
   O << "\n\n";
 
@@ -739,6 +732,14 @@ bool X86ATTAsmPrinter::doInitialization(Module &M) {
 
   bool Result = AsmPrinter::doInitialization(M);
 
+  if (TAI->doesSupportDebugInformation()) {
+    // Let PassManager know we need debug information and relay
+    // the MachineModuleInfo address on to DwarfWriter.
+    // AsmPrinter::doInitialization did this analysis.
+    MMI = getAnalysisToUpdate<MachineModuleInfo>();
+    DW.SetModuleInfo(MMI);
+  }
+
   // Darwin wants symbols to be quoted if they have complex names.
   if (Subtarget->isTargetDarwin())
     Mang->setUseQuotes(true);