aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2020-09-18 11:17:56 -0700
committerDavid Blaikie <dblaikie@gmail.com>2020-09-18 11:18:23 -0700
commit51a505340dfdfdfd9ab32c7267a74db3cdeefa56 (patch)
treee66bb85ffb27077c3c93d88d827565f0e7f75890 /llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
parentf7a53d82c0902147909f28a9295a9d00b4b27d38 (diff)
downloadllvm-51a505340dfdfdfd9ab32c7267a74db3cdeefa56.zip
llvm-51a505340dfdfdfd9ab32c7267a74db3cdeefa56.tar.gz
llvm-51a505340dfdfdfd9ab32c7267a74db3cdeefa56.tar.bz2
DebugInfo: Simplify line table parsing to take all the units together, rather than CUs and TUs separately
Diffstat (limited to 'llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp')
-rw-r--r--llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
index 26fb8e8..987e0e4 100644
--- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
@@ -86,7 +86,7 @@ struct CommonFixture {
generate();
- return DWARFDebugLine::SectionParser(LineData, *Context, CUs, TUs);
+ return DWARFDebugLine::SectionParser(LineData, *Context, Units);
}
void recordRecoverable(Error Err) {
@@ -114,8 +114,7 @@ struct CommonFixture {
Error Unrecoverable;
std::function<void(Error)> RecordUnrecoverable;
- SmallVector<std::unique_ptr<DWARFUnit>, 2> CUs;
- SmallVector<std::unique_ptr<DWARFUnit>, 2> TUs;
+ SmallVector<std::unique_ptr<DWARFUnit>, 2> Units;
};
// Fixtures must derive from "Test", but parameterised fixtures from
@@ -1087,7 +1086,7 @@ TEST_F(DebugLineBasicFixture, ParserAlwaysDoneForEmptySection) {
return;
generate();
- DWARFDebugLine::SectionParser Parser(LineData, *Context, CUs, TUs);
+ DWARFDebugLine::SectionParser Parser(LineData, *Context, Units);
EXPECT_TRUE(Parser.done());
}
@@ -1101,7 +1100,7 @@ TEST_F(DebugLineBasicFixture, ParserMarkedAsDoneForBadLengthWhenParsing) {
Gen->addLineTable();
generate();
- DWARFDebugLine::SectionParser Parser(LineData, *Context, CUs, TUs);
+ DWARFDebugLine::SectionParser Parser(LineData, *Context, Units);
Parser.parseNext(RecordRecoverable, RecordUnrecoverable);
EXPECT_EQ(Parser.getOffset(), 0u);
@@ -1124,7 +1123,7 @@ TEST_F(DebugLineBasicFixture, ParserMarkedAsDoneForBadLengthWhenSkipping) {
Gen->addLineTable();
generate();
- DWARFDebugLine::SectionParser Parser(LineData, *Context, CUs, TUs);
+ DWARFDebugLine::SectionParser Parser(LineData, *Context, Units);
Parser.skip(RecordRecoverable, RecordUnrecoverable);
EXPECT_EQ(Parser.getOffset(), 0u);
@@ -1148,7 +1147,7 @@ TEST_F(DebugLineBasicFixture, ParserReportsFirstErrorInEachTableWhenParsing) {
LT2.setCustomPrologue({{2, LineTable::Long}, {1, LineTable::Half}});
generate();
- DWARFDebugLine::SectionParser Parser(LineData, *Context, CUs, TUs);
+ DWARFDebugLine::SectionParser Parser(LineData, *Context, Units);
Parser.parseNext(RecordRecoverable, RecordUnrecoverable);
ASSERT_FALSE(Parser.done());
Parser.parseNext(RecordRecoverable, RecordUnrecoverable);
@@ -1177,7 +1176,7 @@ TEST_F(DebugLineBasicFixture, ParserReportsNonPrologueProblemsWhenParsing) {
LT2.addByte(0xbb);
generate();
- DWARFDebugLine::SectionParser Parser(LineData, *Context, CUs, TUs);
+ DWARFDebugLine::SectionParser Parser(LineData, *Context, Units);
Parser.parseNext(RecordRecoverable, RecordUnrecoverable);
EXPECT_FALSE(Unrecoverable);
ASSERT_FALSE(Parser.done());
@@ -1207,7 +1206,7 @@ TEST_F(DebugLineBasicFixture,
LT2.setCustomPrologue({{2, LineTable::Long}, {1, LineTable::Half}});
generate();
- DWARFDebugLine::SectionParser Parser(LineData, *Context, CUs, TUs);
+ DWARFDebugLine::SectionParser Parser(LineData, *Context, Units);
Parser.skip(RecordRecoverable, RecordUnrecoverable);
ASSERT_FALSE(Parser.done());
Parser.skip(RecordRecoverable, RecordUnrecoverable);
@@ -1231,7 +1230,7 @@ TEST_F(DebugLineBasicFixture, ParserIgnoresNonPrologueErrorsWhenSkipping) {
LT.addExtendedOpcode(42, DW_LNE_end_sequence, {});
generate();
- DWARFDebugLine::SectionParser Parser(LineData, *Context, CUs, TUs);
+ DWARFDebugLine::SectionParser Parser(LineData, *Context, Units);
Parser.skip(RecordRecoverable, RecordUnrecoverable);
EXPECT_TRUE(Parser.done());
@@ -1290,7 +1289,7 @@ TEST_F(DebugLineBasicFixture, VerboseOutput) {
generate();
- DWARFDebugLine::SectionParser Parser(LineData, *Context, CUs, TUs);
+ DWARFDebugLine::SectionParser Parser(LineData, *Context, Units);
std::string Output;
raw_string_ostream OS(Output);
Parser.parseNext(RecordRecoverable, RecordUnrecoverable, &OS,
@@ -1527,7 +1526,7 @@ struct TruncatedOpcodeFixtureBase : public CommonFixture {
void runTest(uint8_t OpcodeValue) {
generate();
- DWARFDebugLine::SectionParser Parser(LineData, *Context, CUs, TUs);
+ DWARFDebugLine::SectionParser Parser(LineData, *Context, Units);
std::string Output;
raw_string_ostream OS(Output);
Parser.parseNext(RecordRecoverable, RecordUnrecoverable, &OS,