diff options
Diffstat (limited to 'lib/Target/X86')
-rw-r--r-- | lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp | 20 | ||||
-rw-r--r-- | lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h | 6 |
2 files changed, 13 insertions, 13 deletions
diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp index 76b1ddc..e8a77a8 100644 --- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp +++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp @@ -227,7 +227,7 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) { // Emit pre-function debug and/or EH information. if (TAI->doesSupportDebugInformation() || TAI->doesSupportExceptionHandling()) - DW.BeginFunction(&MF); + DW->BeginFunction(&MF); // Print out code for the function. bool hasAnyRealCode = false; @@ -260,7 +260,7 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) { // Emit post-function debug information. if (TAI->doesSupportDebugInformation()) - DW.EndFunction(&MF); + DW->EndFunction(&MF); // Print out jump tables referenced by the function. EmitJumpTableInfo(MF.getJumpTableInfo(), MF); @@ -726,10 +726,6 @@ void X86ATTAsmPrinter::printMachineInstruction(const MachineInstr *MI) { /// doInitialization bool X86ATTAsmPrinter::doInitialization(Module &M) { - if (TAI->doesSupportDebugInformation()) { - // Emit initial debug information. - DW.BeginModule(&M); - } bool Result = AsmPrinter::doInitialization(M); @@ -738,7 +734,8 @@ bool X86ATTAsmPrinter::doInitialization(Module &M) { // the MachineModuleInfo address on to DwarfWriter. // AsmPrinter::doInitialization did this analysis. MMI = getAnalysisToUpdate<MachineModuleInfo>(); - DW.SetModuleInfo(MMI); + DW = getAnalysisToUpdate<DwarfWriter>(); + DW->BeginModule(&M, MMI, O, this, TAI); } // Darwin wants symbols to be quoted if they have complex names. @@ -973,7 +970,8 @@ bool X86ATTAsmPrinter::doFinalization(Module &M) { } // Emit final debug information. - DW.EndModule(); + DwarfWriter *DW = getAnalysisToUpdate<DwarfWriter>(); + 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 @@ -992,10 +990,12 @@ bool X86ATTAsmPrinter::doFinalization(Module &M) { } // Emit final debug information. - DW.EndModule(); + DwarfWriter *DW = getAnalysisToUpdate<DwarfWriter>(); + DW->EndModule(); } else if (Subtarget->isTargetELF()) { // Emit final debug information. - DW.EndModule(); + DwarfWriter *DW = getAnalysisToUpdate<DwarfWriter>(); + DW->EndModule(); } return AsmPrinter::doFinalization(M); diff --git a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h index 40a5b4f..3732ce8 100644 --- a/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h +++ b/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h @@ -29,14 +29,13 @@ namespace llvm { struct MachineJumpTableInfo; struct VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter { - DwarfWriter DW; + DwarfWriter *DW; MachineModuleInfo *MMI; - const X86Subtarget *Subtarget; X86ATTAsmPrinter(raw_ostream &O, X86TargetMachine &TM, const TargetAsmInfo *T) - : AsmPrinter(O, TM, T), DW(O, this, T), MMI(0) { + : AsmPrinter(O, TM, T), DW(0), MMI(0) { Subtarget = &TM.getSubtarget<X86Subtarget>(); } @@ -51,6 +50,7 @@ struct VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter { Subtarget->isTargetCygMing()) { AU.addRequired<MachineModuleInfo>(); } + AU.addRequired<DwarfWriter>(); AsmPrinter::getAnalysisUsage(AU); } |