diff options
author | Devang Patel <dpatel@apple.com> | 2009-06-19 21:54:26 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-06-19 21:54:26 +0000 |
commit | 33f4eb462fe8c0c2092bee983e53f1dff8aac6a4 (patch) | |
tree | d73ca9c22c00930f733e38ea2ed5dd947113b5f9 /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | |
parent | 86076c9e307d148da1e0ecd2df996459677cf109 (diff) | |
download | bcm5719-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/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 28f3b9b1bf6..e9319046234 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -177,9 +177,17 @@ bool AsmPrinter::doInitialization(Module &M) { SwitchToDataSection(""); // Reset back to no section. - MachineModuleInfo *MMI = getAnalysisIfAvailable<MachineModuleInfo>(); - if (MMI) MMI->AnalyzeModule(M); - DW = getAnalysisIfAvailable<DwarfWriter>(); + if (TAI->doesSupportDebugInformation() + || TAI->doesSupportExceptionHandling()) { + MachineModuleInfo *MMI = getAnalysisIfAvailable<MachineModuleInfo>(); + if (MMI) { + MMI->AnalyzeModule(M); + DW = getAnalysisIfAvailable<DwarfWriter>(); + if (DW) + DW->BeginModule(&M, MMI, O, this, TAI); + } + } + return false; } |