summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-23 21:20:10 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-04-23 21:20:10 +0000
commit08e5ef25fb0be95aef82d3dd2d4b81aa1cd08aed (patch)
tree88e40c8653a425c58310d0fa38a9ad9a867a64ee /lib/CodeGen/AsmPrinter
parent2bff66859ef811a2fbe0a2c027f05063d2a62f47 (diff)
downloadllvm-08e5ef25fb0be95aef82d3dd2d4b81aa1cd08aed.tar.gz
llvm-08e5ef25fb0be95aef82d3dd2d4b81aa1cd08aed.tar.bz2
llvm-08e5ef25fb0be95aef82d3dd2d4b81aa1cd08aed.tar.xz
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
Diffstat (limited to 'lib/CodeGen/AsmPrinter')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp7
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.h4
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfFile.h4
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfUnit.cpp6
4 files changed, 10 insertions, 11 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index e98df8cd47..ac145ce39f 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -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);
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h
index a18246070c..3a69538108 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -321,6 +321,8 @@ class DwarfDebug : public AsmPrinterHandler {
// True iff there are multiple CUs in this module.
bool SingleCU;
+ AddressPool AddrPool;
+
MCDwarfDwoLineTable *getDwoLineTable(const DwarfCompileUnit &);
void addScopeVariable(LexicalScope *LS, DbgVariable *Var);
@@ -631,6 +633,8 @@ public:
/// isSubprogramContext - Return true if Context is either a subprogram
/// or another context nested inside a subprogram.
bool isSubprogramContext(const MDNode *Context);
+
+ AddressPool &getAddressPool() { return AddrPool; }
};
} // End of namespace llvm
diff --git a/lib/CodeGen/AsmPrinter/DwarfFile.h b/lib/CodeGen/AsmPrinter/DwarfFile.h
index 279468409b..68ac530fd3 100644
--- a/lib/CodeGen/AsmPrinter/DwarfFile.h
+++ b/lib/CodeGen/AsmPrinter/DwarfFile.h
@@ -52,8 +52,6 @@ class DwarfFile {
unsigned NextStringPoolNumber;
std::string StringPref;
- AddressPool AddrPool;
-
public:
DwarfFile(AsmPrinter *AP, const char *Pref, BumpPtrAllocator &DA);
@@ -98,8 +96,6 @@ public:
/// \brief Returns the string pool.
StrPool *getStringPool() { return &StringPool; }
-
- AddressPool &getAddressPool() { return AddrPool; }
};
}
#endif
diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index b2df723914..4c1ee3ba94 100644
--- a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -290,7 +290,7 @@ void DwarfCompileUnit::addLabelAddress(DIE *Die, dwarf::Attribute Attribute,
if (Label)
DD->addArangeLabel(SymbolCU(this, Label));
- unsigned idx = DU->getAddressPool().getIndex(Label);
+ unsigned idx = DD->getAddressPool().getIndex(Label);
DIEValue *Value = new (DIEValueAllocator) DIEInteger(idx);
Die->addValue(Attribute, dwarf::DW_FORM_GNU_addr_index, Value);
}
@@ -336,7 +336,7 @@ void DwarfUnit::addOpAddress(DIELoc *Die, const MCSymbol *Sym) {
} else {
addUInt(Die, dwarf::DW_FORM_data1, dwarf::DW_OP_GNU_addr_index);
addUInt(Die, dwarf::DW_FORM_GNU_addr_index,
- DU->getAddressPool().getIndex(Sym));
+ DD->getAddressPool().getIndex(Sym));
}
}
@@ -1669,7 +1669,7 @@ void DwarfCompileUnit::createGlobalVariableDIE(DIGlobalVariable GV) {
} else {
addUInt(Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_GNU_const_index);
addUInt(Loc, dwarf::DW_FORM_udata,
- DU->getAddressPool().getIndex(Sym, /* TLS */ true));
+ DD->getAddressPool().getIndex(Sym, /* TLS */ true));
}
// 3) followed by a custom OP to make the debugger do a TLS lookup.
addUInt(Loc, dwarf::DW_FORM_data1, dwarf::DW_OP_GNU_push_tls_address);