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;
}
SetDirective = "\t.set\t";
ProtectedDirective = NULL;
HasDotTypeDotSizeDirective = false;
+ SupportsDebugInformation = true;
}
ARMELFTargetAsmInfo::ARMELFTargetAsmInfo(const ARMTargetMachine &TM):
StaticCtorsSection = "\t.section .ctors,\"aw\",%progbits";
StaticDtorsSection = "\t.section .dtors,\"aw\",%progbits";
}
+ SupportsDebugInformation = true;
}
/// Count the number of comma-separated arguments.
bool ARMAsmPrinter::doInitialization(Module &M) {
bool Result = AsmPrinter::doInitialization(M);
-
- // Emit initial debug information.
- MMI = getAnalysisIfAvailable<MachineModuleInfo>();
- assert(MMI);
DW = getAnalysisIfAvailable<DwarfWriter>();
- assert(DW && "Dwarf Writer is not available");
- DW->BeginModule(&M, MMI, O, this, TAI);
// Thumb-2 instructions are supported only in unified assembler syntax mode.
if (Subtarget->hasThumb2())
bool LinuxAsmPrinter::doInitialization(Module &M) {
bool Result = AsmPrinter::doInitialization(M);
- SwitchToTextSection("\t.text");
- // Emit initial debug information.
DW = getAnalysisIfAvailable<DwarfWriter>();
- assert(DW && "Dwarf Writer is not available");
- MMI = getAnalysisIfAvailable<MachineModuleInfo>();
- DW->BeginModule(&M, MMI, O, this, TAI);
+ SwitchToTextSection("\t.text");
return Result;
}
bool PPCLinuxAsmPrinter::doInitialization(Module &M) {
bool Result = AsmPrinter::doInitialization(M);
-
- // Emit initial debug information.
- MMI = getAnalysisIfAvailable<MachineModuleInfo>();
- assert(MMI);
DW = getAnalysisIfAvailable<DwarfWriter>();
- assert(DW && "DwarfWriter is not available");
- DW->BeginModule(&M, MMI, O, this, TAI);
-
SwitchToSection(TAI->getTextSection());
-
return Result;
}
O << "\t.machine " << CPUDirectives[Directive] << '\n';
bool Result = AsmPrinter::doInitialization(M);
-
- // Emit initial debug information.
- // We need this for Personality functions.
- // AsmPrinter::doInitialization should have done this analysis.
- MMI = getAnalysisIfAvailable<MachineModuleInfo>();
- assert(MMI);
DW = getAnalysisIfAvailable<DwarfWriter>();
- assert(DW && "DwarfWriter is not available");
- DW->BeginModule(&M, MMI, O, this, TAI);
// Prime text sections so they are adjacent. This reduces the likelihood a
// large data or debug section causes a branch to exceed 16M limit.
/// doInitialization
bool X86ATTAsmPrinter::doInitialization(Module &M) {
-
- bool Result = AsmPrinter::doInitialization(M);
-
- if (TAI->doesSupportDebugInformation()) {
- // Let PassManager know we need debug information and relay
- // the MachineModuleInfo address on to DwarfWriter.
- // AsmPrinter::doInitialization did this analysis.
- MMI = getAnalysisIfAvailable<MachineModuleInfo>();
- DW = getAnalysisIfAvailable<DwarfWriter>();
- DW->BeginModule(&M, MMI, O, this, TAI);
- }
-
- return Result;
+ return AsmPrinter::doInitialization(M);
}
}
// Emit final debug information.
- DwarfWriter *DW = getAnalysisIfAvailable<DwarfWriter>();
- DW->EndModule();
+ if (TAI->doesSupportDebugInformation())
+ DW->EndModule();
// Funny Darwin hack: This flag tells the linker that no global symbols
// contain code that falls through to other global symbols (e.g. the obvious
}
// Emit final debug information.
- DwarfWriter *DW = getAnalysisIfAvailable<DwarfWriter>();
- DW->EndModule();
+ if (TAI->doesSupportDebugInformation())
+ DW->EndModule();
} else if (Subtarget->isTargetELF()) {
// Emit final debug information.
- DwarfWriter *DW = getAnalysisIfAvailable<DwarfWriter>();
- DW->EndModule();
+ if (TAI->doesSupportDebugInformation())
+ DW->EndModule();
}
return AsmPrinter::doFinalization(M);
class MCInst;
class VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter {
- DwarfWriter *DW;
MachineModuleInfo *MMI;
const X86Subtarget *Subtarget;
public:
explicit X86ATTAsmPrinter(raw_ostream &O, X86TargetMachine &TM,
const TargetAsmInfo *T, CodeGenOpt::Level OL,
bool V)
- : AsmPrinter(O, TM, T, OL, V), DW(0), MMI(0) {
+ : AsmPrinter(O, TM, T, OL, V), MMI(0) {
Subtarget = &TM.getSubtarget<X86Subtarget>();
}
bool XCoreAsmPrinter::doInitialization(Module &M) {
bool Result = AsmPrinter::doInitialization(M);
+ DW = getAnalysisIfAvailable<DwarfWriter>();
if (!FileDirective.empty()) {
emitFileDirective(FileDirective);
}
}
- // Emit initial debug information.
- DW = getAnalysisIfAvailable<DwarfWriter>();
- assert(DW && "Dwarf Writer is not available");
- DW->BeginModule(&M, getAnalysisIfAvailable<MachineModuleInfo>(),
- O, this, TAI);
return Result;
}
XCoreTargetAsmInfo::XCoreTargetAsmInfo(const XCoreTargetMachine &TM)
: ELFTargetAsmInfo(TM),
Subtarget(TM.getSubtargetImpl()) {
+ SupportsDebugInformation = true;
TextSection = getUnnamedSection("\t.text", SectionFlags::Code);
DataSection = getNamedSection("\t.dp.data", SectionFlags::Writeable |
SectionFlags::Small);