[DebugInfo]: Refactored Macinfo section consumption part to allow future

macro section dumping.

Summary: Previously macinfo infrastructure was using functions
names that were ambiguous i.e `getMacro/getMacroDWO` in a sense
of conveying stated intentions. This patch refactored them into more
reasonable `getDebugMacinfo/getDebugMacinfoDWO` names thus making
room for macro implementation.

Reviewers: aprantl, probinson, jini.susan.george, dblaikie

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D75037
This commit is contained in:
Sourabh Singh Tomar 2020-02-24 15:51:36 +05:30
parent 0b46b078b6
commit 226bddce45
2 changed files with 19 additions and 19 deletions

View File

@ -66,7 +66,7 @@ class DWARFContext : public DIContext {
std::unique_ptr<DWARFDebugLine> Line;
std::unique_ptr<DWARFDebugFrame> DebugFrame;
std::unique_ptr<DWARFDebugFrame> EHFrame;
std::unique_ptr<DWARFDebugMacro> Macro;
std::unique_ptr<DWARFDebugMacro> Macinfo;
std::unique_ptr<DWARFDebugNames> Names;
std::unique_ptr<AppleAcceleratorTable> AppleNames;
std::unique_ptr<AppleAcceleratorTable> AppleTypes;
@ -75,7 +75,7 @@ class DWARFContext : public DIContext {
DWARFUnitVector DWOUnits;
std::unique_ptr<DWARFDebugAbbrev> AbbrevDWO;
std::unique_ptr<DWARFDebugMacro> MacroDWO;
std::unique_ptr<DWARFDebugMacro> MacinfoDWO;
/// The maximum DWARF version of all units.
unsigned MaxVersion = 0;
@ -273,10 +273,10 @@ public:
const DWARFDebugFrame *getEHFrame();
/// Get a pointer to the parsed DebugMacro object.
const DWARFDebugMacro *getDebugMacro();
const DWARFDebugMacro *getDebugMacinfo();
/// Get a pointer to the parsed DebugMacroDWO object.
const DWARFDebugMacro *getDebugMacroDWO();
/// Get a pointer to the parsed dwo DebugMacro object.
const DWARFDebugMacro *getDebugMacinfoDWO();
/// Get a reference to the parsed accelerator table object.
const DWARFDebugNames &getDebugNames();

View File

@ -442,12 +442,12 @@ void DWARFContext::dump(
if (shouldDump(Explicit, ".debug_macinfo", DIDT_ID_DebugMacro,
DObj->getMacinfoSection())) {
getDebugMacro()->dump(OS);
getDebugMacinfo()->dump(OS);
}
if (shouldDump(Explicit, ".debug_macinfo.dwo", DIDT_ID_DebugMacro,
DObj->getMacinfoDWOSection())) {
getDebugMacroDWO()->dump(OS);
getDebugMacinfoDWO()->dump(OS);
}
if (shouldDump(Explicit, ".debug_aranges", DIDT_ID_DebugAranges,
@ -808,25 +808,25 @@ const DWARFDebugFrame *DWARFContext::getEHFrame() {
return DebugFrame.get();
}
const DWARFDebugMacro *DWARFContext::getDebugMacroDWO() {
if (MacroDWO)
return MacroDWO.get();
const DWARFDebugMacro *DWARFContext::getDebugMacinfoDWO() {
if (MacinfoDWO)
return MacinfoDWO.get();
DataExtractor MacinfoDWOData(DObj->getMacinfoDWOSection(), isLittleEndian(),
0);
MacroDWO.reset(new DWARFDebugMacro());
MacroDWO->parse(MacinfoDWOData);
return MacroDWO.get();
MacinfoDWO.reset(new DWARFDebugMacro());
MacinfoDWO->parse(MacinfoDWOData);
return MacinfoDWO.get();
}
const DWARFDebugMacro *DWARFContext::getDebugMacro() {
if (Macro)
return Macro.get();
const DWARFDebugMacro *DWARFContext::getDebugMacinfo() {
if (Macinfo)
return Macinfo.get();
DataExtractor MacinfoData(DObj->getMacinfoSection(), isLittleEndian(), 0);
Macro.reset(new DWARFDebugMacro());
Macro->parse(MacinfoData);
return Macro.get();
Macinfo.reset(new DWARFDebugMacro());
Macinfo->parse(MacinfoData);
return Macinfo.get();
}
template <typename T>