[llvm] 226bddc - [DebugInfo]: Refactored Macinfo section consumption part to allow future
Sourabh Singh Tomar via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 24 18:27:41 PST 2020
Author: Sourabh Singh Tomar
Date: 2020-02-25T07:56:48+05:30
New Revision: 226bddce458b8648a16d49e6415be2ccf9592c0e
URL: https://github.com/llvm/llvm-project/commit/226bddce458b8648a16d49e6415be2ccf9592c0e
DIFF: https://github.com/llvm/llvm-project/commit/226bddce458b8648a16d49e6415be2ccf9592c0e.diff
LOG: [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
Added:
Modified:
llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
index 1b3fffea9586..6de718768d18 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
@@ -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 @@ class DWARFContext : public DIContext {
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();
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
index 7b0be019aed5..73cfd16be9b3 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
@@ -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>
More information about the llvm-commits
mailing list