Introduce the DWARFUnitSection abstraction.

A DWARFUnitSection is the collection of Units that have been extracted from
the same debug section.

By embeding a reference to their DWARFUnitSection in each unit, the DIEs
will be able to resolve inter-unit references by interrogating their Unit's
DWARFUnitSection.

This is a minimal patch where the DWARFUnitSection is-a SmallVector of Units,
thus exposing exactly the same interface as before. Followup-up patches might
change from inheritance to composition in order to expose only the wanted
DWARFUnitSection abstraction.

    Differential Revision: http://reviews.llvm.org/D5310

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217747 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Frederic Riss
2014-09-15 07:50:27 +00:00
parent b1287f54cf
commit ea3ce67d71
6 changed files with 69 additions and 44 deletions
+3 -2
View File
@@ -19,10 +19,11 @@ using namespace dwarf;
DWARFUnit::DWARFUnit(DWARFContext &DC, const DWARFDebugAbbrev *DA,
StringRef IS, StringRef RS, StringRef SS, StringRef SOS,
StringRef AOS, const RelocAddrMap *M, bool LE)
StringRef AOS, const RelocAddrMap *M, bool LE,
const DWARFUnitSectionBase& UnitSection)
: Context(DC), Abbrev(DA), InfoSection(IS), RangeSection(RS),
StringSection(SS), StringOffsetSection(SOS), AddrOffsetSection(AOS),
RelocMap(M), isLittleEndian(LE) {
RelocMap(M), isLittleEndian(LE), UnitSection(UnitSection) {
clear();
}