Move the AddressPool from DwarfFile to DwarfDebug.

There's only ever one address pool, not one per DWARF output file, so
let's just have one.

(similar refactoring of the string pool to come soon)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207026 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2014-04-23 21:20:10 +00:00
parent 2bff66859e
commit 08e5ef25fb
4 changed files with 10 additions and 11 deletions

View File

@ -888,7 +888,7 @@ void DwarfDebug::finalizeModuleInfo() {
// We don't keep track of which addresses are used in which CU so this
// is a bit pessimistic under LTO.
if (!InfoHolder.getAddressPool().isEmpty())
if (!AddrPool.isEmpty())
addSectionLabel(*Asm, *SkCU, SkCU->getUnitDie(),
dwarf::DW_AT_GNU_addr_base, DwarfAddrSectionSym,
DwarfAddrSectionSym);
@ -1019,8 +1019,7 @@ void DwarfDebug::endModule() {
emitDebugAbbrevDWO();
emitDebugLineDWO();
// Emit DWO addresses.
InfoHolder.getAddressPool().emit(
*Asm, Asm->getObjFileLowering().getDwarfAddrSection());
AddrPool.emit(*Asm, Asm->getObjFileLowering().getDwarfAddrSection());
emitDebugLocDWO();
} else
// Emit info into a debug loc section.
@ -2205,7 +2204,7 @@ void DwarfDebug::emitDebugLocDWO() {
// address we know we've emitted elsewhere (the start of the function?
// The start of the CU or CU subrange that encloses this range?)
Asm->EmitInt8(dwarf::DW_LLE_start_length_entry);
unsigned idx = InfoHolder.getAddressPool().getIndex(Entry.getBeginSym());
unsigned idx = AddrPool.getIndex(Entry.getBeginSym());
Asm->EmitULEB128(idx);
Asm->EmitLabelDifference(Entry.getEndSym(), Entry.getBeginSym(), 4);