summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARFContext.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-04-30 00:09:19 +0000
committerAlexey Samsonov <samsonov@google.com>2014-04-30 00:09:19 +0000
commit110d595d48033ab2c7dfba0efe833ccc4faf7d6f (patch)
treefaecc4bff99f8a346fa51a88dea5439bce378292 /llvm/lib/DebugInfo/DWARFContext.cpp
parentfb693085683836d52d7edec3de7a13dd77926ea7 (diff)
downloadbcm5719-llvm-110d595d48033ab2c7dfba0efe833ccc4faf7d6f.tar.gz
bcm5719-llvm-110d595d48033ab2c7dfba0efe833ccc4faf7d6f.zip
[DWARF parser] Cleanup code in DWARFDebugLine.
Streamline parsing and dumping line tables: Prefer composition to multiple inheritance in DWARFDebugLine::ParsingState. Get rid of the weird concept of "DumpingState" structure. was: DWARFDebugLine::DumpingState state(OS); DWARFDebugLine::parseStatementTable(..., state); now: DWARFDebugLine::LineTable LineTable; LineTable.parse(...); LineTable.dump(OS); No functionality change. llvm-svn: 207599
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFContext.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARFContext.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/lib/DebugInfo/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARFContext.cpp
index 6503207dae0..3d04e73903e 100644
--- a/llvm/lib/DebugInfo/DWARFContext.cpp
+++ b/llvm/lib/DebugInfo/DWARFContext.cpp
@@ -130,8 +130,9 @@ void DWARFContext::dump(raw_ostream &OS, DIDumpType DumpType) {
if (stmtOffset != -1U) {
DataExtractor lineData(getLineSection().Data, isLittleEndian(),
savedAddressByteSize);
- DWARFDebugLine::DumpingState state(OS);
- DWARFDebugLine::parseStatementTable(lineData, &getLineSection().Relocs, &stmtOffset, state);
+ DWARFDebugLine::LineTable LineTable;
+ LineTable.parse(lineData, &getLineSection().Relocs, &stmtOffset);
+ LineTable.dump(OS);
}
}
}
@@ -141,9 +142,11 @@ void DWARFContext::dump(raw_ostream &OS, DIDumpType DumpType) {
unsigned stmtOffset = 0;
DataExtractor lineData(getLineDWOSection().Data, isLittleEndian(),
savedAddressByteSize);
- DWARFDebugLine::DumpingState state(OS);
- while (state.Prologue.parse(lineData, &stmtOffset))
- state.finalize();
+ DWARFDebugLine::LineTable LineTable;
+ while (LineTable.Prologue.parse(lineData, &stmtOffset)) {
+ LineTable.dump(OS);
+ LineTable.clear();
+ }
}
if (DumpType == DIDT_All || DumpType == DIDT_Str) {
OpenPOWER on IntegriCloud