diff options
author | Devang Patel <dpatel@apple.com> | 2009-01-08 23:40:34 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-01-08 23:40:34 +0000 |
commit | eb3fc289141ad44883acbb91e839ab1b9a0f2025 (patch) | |
tree | ba35a1e9f588e7ef801a8f2432cd92f1a63a1435 /lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp | |
parent | 5d5ee80ea8bf300d1ee8ccbd7174466d98a1e99e (diff) | |
download | external_llvm-eb3fc289141ad44883acbb91e839ab1b9a0f2025.zip external_llvm-eb3fc289141ad44883acbb91e839ab1b9a0f2025.tar.gz external_llvm-eb3fc289141ad44883acbb91e839ab1b9a0f2025.tar.bz2 |
Convert DwarfWriter into a pass.
Now Users request DwarfWriter through getAnalysisUsage() instead of creating an instance of DwarfWriter object directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61955 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp')
-rw-r--r-- | lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp | 20 |
1 files changed, 10 insertions, 10 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); |