Add a DWARFContext& member in DWARFUnit.

The DWARFContext will be used to pass global 'context' down, like
pointers to related debug info sections or command line options.
The first use will be for the debug_info dumper to be able to access
other debug info section to dump eg. Location Expression inline
in the debug_info dump.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217128 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Frederic Riss
2014-09-04 06:14:28 +00:00
parent 21797d6cd6
commit a1f7715ef9
5 changed files with 29 additions and 24 deletions

View File

@ -318,7 +318,7 @@ void DWARFContext::parseCompileUnits() {
const DataExtractor &DIData = DataExtractor(getInfoSection().Data,
isLittleEndian(), 0);
while (DIData.isValidOffset(offset)) {
std::unique_ptr<DWARFCompileUnit> CU(new DWARFCompileUnit(
std::unique_ptr<DWARFCompileUnit> CU(new DWARFCompileUnit(*this,
getDebugAbbrev(), getInfoSection().Data, getRangeSection(),
getStringSection(), StringRef(), getAddrSection(),
&getInfoSection().Relocs, isLittleEndian()));
@ -338,10 +338,10 @@ void DWARFContext::parseTypeUnits() {
const DataExtractor &DIData =
DataExtractor(I.second.Data, isLittleEndian(), 0);
while (DIData.isValidOffset(offset)) {
std::unique_ptr<DWARFTypeUnit> TU(
new DWARFTypeUnit(getDebugAbbrev(), I.second.Data, getRangeSection(),
getStringSection(), StringRef(), getAddrSection(),
&I.second.Relocs, isLittleEndian()));
std::unique_ptr<DWARFTypeUnit> TU(new DWARFTypeUnit(*this,
getDebugAbbrev(), I.second.Data, getRangeSection(),
getStringSection(), StringRef(), getAddrSection(),
&I.second.Relocs, isLittleEndian()));
if (!TU->extract(DIData, &offset))
break;
TUs.push_back(std::move(TU));
@ -357,7 +357,7 @@ void DWARFContext::parseDWOCompileUnits() {
const DataExtractor &DIData =
DataExtractor(getInfoDWOSection().Data, isLittleEndian(), 0);
while (DIData.isValidOffset(offset)) {
std::unique_ptr<DWARFCompileUnit> DWOCU(new DWARFCompileUnit(
std::unique_ptr<DWARFCompileUnit> DWOCU(new DWARFCompileUnit(*this,
getDebugAbbrevDWO(), getInfoDWOSection().Data, getRangeDWOSection(),
getStringDWOSection(), getStringOffsetDWOSection(), getAddrSection(),
&getInfoDWOSection().Relocs, isLittleEndian()));
@ -377,7 +377,7 @@ void DWARFContext::parseDWOTypeUnits() {
const DataExtractor &DIData =
DataExtractor(I.second.Data, isLittleEndian(), 0);
while (DIData.isValidOffset(offset)) {
std::unique_ptr<DWARFTypeUnit> TU(new DWARFTypeUnit(
std::unique_ptr<DWARFTypeUnit> TU(new DWARFTypeUnit(*this,
getDebugAbbrevDWO(), I.second.Data, getRangeDWOSection(),
getStringDWOSection(), getStringOffsetDWOSection(), getAddrSection(),
&I.second.Relocs, isLittleEndian()));