mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
sink management of DwarfWriter & MachineModuleInfo into the AsmPrinter base class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74101 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user