From b9097a71d41d61331f545b7fec163ff0b8f8e45c Mon Sep 17 00:00:00 2001 From: Dale Johannesen Date: Tue, 8 Jul 2008 21:56:22 +0000 Subject: Make debug info come out in data-only files. This is a question of the debugging setup code not being called at the right time, and it's called from target-dependent code for some reason. I have only attempted to fix Darwin, but I'm pretty sure it's broken elsewhere; I'll leave that to people who can test it. llvm-svn: 53254 --- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'llvm/lib/Target/X86/X86ATTAsmPrinter.cpp') diff --git a/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp b/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp index a61bb2261d6..4e1c1dfde1d 100644 --- a/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp +++ b/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp @@ -232,13 +232,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(); - DW.SetModuleInfo(MMI); - } - SetupMachineFunction(MF); O << "\n\n"; @@ -751,13 +744,20 @@ void X86ATTAsmPrinter::printMachineInstruction(const MachineInstr *MI) { /// doInitialization bool X86ATTAsmPrinter::doInitialization(Module &M) { + + bool Result = AsmPrinter::doInitialization(M); + if (TAI->doesSupportDebugInformation()) { // Emit initial debug information. DW.BeginModule(&M); + // Let PassManager know we need debug information and relay + // the MachineModuleInfo address on to DwarfWriter. + // AsmPrinter::doInitialization should have done this analysis. + MMI = getAnalysisToUpdate(); + assert(MMI); + DW.SetModuleInfo(MMI); } - bool Result = AsmPrinter::doInitialization(M); - // Darwin wants symbols to be quoted if they have complex names. if (Subtarget->isTargetDarwin()) Mang->setUseQuotes(true); -- cgit v1.2.3