summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.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/CodeGen/AsmPrinter/AsmPrinter.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/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp14
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;
}
OpenPOWER on IntegriCloud