summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-06-19 21:54:26 +0000
committerDevang Patel <dpatel@apple.com>2009-06-19 21:54:26 +0000
commit33f4eb462fe8c0c2092bee983e53f1dff8aac6a4 (patch)
treed73ca9c22c00930f733e38ea2ed5dd947113b5f9 /llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
parent86076c9e307d148da1e0ecd2df996459677cf109 (diff)
downloadbcm5719-llvm-33f4eb462fe8c0c2092bee983e53f1dff8aac6a4.tar.gz
bcm5719-llvm-33f4eb462fe8c0c2092bee983e53f1dff8aac6a4.zip
Move up dwarf writer initialization in common AsmPrinter class.
llvm-svn: 73784
Diffstat (limited to 'llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp')
-rw-r--r--llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp26
1 files changed, 7 insertions, 19 deletions
diff --git a/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp b/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
index 927267bc17b..f5e3831ff33 100644
--- a/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
+++ b/llvm/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
@@ -780,19 +780,7 @@ void X86ATTAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
/// doInitialization
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 = getAnalysisIfAvailable<MachineModuleInfo>();
- DW = getAnalysisIfAvailable<DwarfWriter>();
- DW->BeginModule(&M, MMI, O, this, TAI);
- }
-
- return Result;
+ return AsmPrinter::doInitialization(M);
}
@@ -1046,8 +1034,8 @@ bool X86ATTAsmPrinter::doFinalization(Module &M) {
}
// Emit final debug information.
- DwarfWriter *DW = getAnalysisIfAvailable<DwarfWriter>();
- DW->EndModule();
+ if (TAI->doesSupportDebugInformation())
+ 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
@@ -1066,12 +1054,12 @@ bool X86ATTAsmPrinter::doFinalization(Module &M) {
}
// Emit final debug information.
- DwarfWriter *DW = getAnalysisIfAvailable<DwarfWriter>();
- DW->EndModule();
+ if (TAI->doesSupportDebugInformation())
+ DW->EndModule();
} else if (Subtarget->isTargetELF()) {
// Emit final debug information.
- DwarfWriter *DW = getAnalysisIfAvailable<DwarfWriter>();
- DW->EndModule();
+ if (TAI->doesSupportDebugInformation())
+ DW->EndModule();
}
return AsmPrinter::doFinalization(M);
OpenPOWER on IntegriCloud