summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-06-24 19:09:55 +0000
committerChris Lattner <sabre@nondot.org>2009-06-24 19:09:55 +0000
commit1fd588829444efd2442d3fe522ccadc6891fafa1 (patch)
tree99def3c39fda796041bb2b0e1ff47b4770fa2f3e /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
parent9f345e1cadbb832ca6fe3e8ca5dd40b4f586c295 (diff)
downloadbcm5719-llvm-1fd588829444efd2442d3fe522ccadc6891fafa1.tar.gz
bcm5719-llvm-1fd588829444efd2442d3fe522ccadc6891fafa1.zip
sink management of DwarfWriter & MachineModuleInfo into the AsmPrinter base class.
llvm-svn: 74101
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index bf4af42628f..dc1ec2d9965 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -45,8 +45,8 @@ AsmPrinter::AsmPrinter(raw_ostream &o, TargetMachine &tm,
const TargetAsmInfo *T, CodeGenOpt::Level OL, bool VDef)
: MachineFunctionPass(&ID), FunctionNumber(0), OptLevel(OL), O(o),
TM(tm), TAI(T), TRI(tm.getRegisterInfo()),
- IsInTextSection(false)
-{
+ IsInTextSection(false) {
+ DW = 0; MMI = 0;
switch (AsmVerbose) {
case cl::BOU_UNSET: VerboseAsm = VDef; break;
case cl::BOU_TRUE: VerboseAsm = true; break;
@@ -177,15 +177,14 @@ bool AsmPrinter::doInitialization(Module &M) {
SwitchToDataSection(""); // Reset back to no section.
- if (TAI->doesSupportDebugInformation()
- || TAI->doesSupportExceptionHandling()) {
- MachineModuleInfo *MMI = getAnalysisIfAvailable<MachineModuleInfo>();
- if (MMI) {
+ if (TAI->doesSupportDebugInformation() ||
+ TAI->doesSupportExceptionHandling()) {
+ MMI = getAnalysisIfAvailable<MachineModuleInfo>();
+ if (MMI)
MMI->AnalyzeModule(M);
- DW = getAnalysisIfAvailable<DwarfWriter>();
- if (DW)
- DW->BeginModule(&M, MMI, O, this, TAI);
- }
+ DW = getAnalysisIfAvailable<DwarfWriter>();
+ if (DW)
+ DW->BeginModule(&M, MMI, O, this, TAI);
}
return false;
@@ -258,6 +257,7 @@ bool AsmPrinter::doFinalization(Module &M) {
O << TAI->getNonexecutableStackDirective() << '\n';
delete Mang; Mang = 0;
+ DW = 0; MMI = 0;
return false;
}
OpenPOWER on IntegriCloud