From 33f4eb462fe8c0c2092bee983e53f1dff8aac6a4 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Fri, 19 Jun 2009 21:54:26 +0000 Subject: Move up dwarf writer initialization in common AsmPrinter class. llvm-svn: 73784 --- llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp') 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(); - if (MMI) MMI->AnalyzeModule(M); - DW = getAnalysisIfAvailable(); + if (TAI->doesSupportDebugInformation() + || TAI->doesSupportExceptionHandling()) { + MachineModuleInfo *MMI = getAnalysisIfAvailable(); + if (MMI) { + MMI->AnalyzeModule(M); + DW = getAnalysisIfAvailable(); + if (DW) + DW->BeginModule(&M, MMI, O, this, TAI); + } + } + return false; } -- cgit v1.2.3