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 | 1a45484151060a9c0190e5d1674709eab72cbd14 (patch) | |
tree | 6cdae6080a19a3b234ff1e5d5442d18f16ce2dad /lib/CodeGen/AsmPrinter/AsmPrinter.cpp | |
parent | d9206bb1b7cdbd74ee770bfc1e8b8773eee306a6 (diff) | |
download | external_llvm-1a45484151060a9c0190e5d1674709eab72cbd14.zip external_llvm-1a45484151060a9c0190e5d1674709eab72cbd14.tar.gz external_llvm-1a45484151060a9c0190e5d1674709eab72cbd14.tar.bz2 |
Move up dwarf writer initialization in common AsmPrinter class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73784 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 28f3b9b..e931904 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/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; } |