Some targets (like AIX) might not feature dwarf address section due to low dwarf version. Check before emitting one.
Fixed DebugInfo unit test failures in https://lab.llvm.org/buildbot/#/builders/214/builds/5739.
Reviewed By: qiucf
Differential Revision: https://reviews.llvm.org/D143561
StringPool->emit(*Asm, TLOF->getDwarfStrSection(),
TLOF->getDwarfStrOffSection());
- AddressPool.emit(*Asm, TLOF->getDwarfAddrSection(), AddrTableStartSym);
+ if (Asm->getDwarfVersion() >= 5)
+ AddressPool.emit(*Asm, TLOF->getDwarfAddrSection(), AddrTableStartSym);
MS->switchSection(TLOF->getDwarfInfoSection());
for (auto &CU : CompileUnits) {