summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/DebugInfo/DWARF
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/DebugInfo/DWARF')
-rw-r--r--llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp36
-rw-r--r--llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp4
2 files changed, 26 insertions, 14 deletions
diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
index 273809fcbd3..0d299c9d840 100644
--- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp
@@ -231,7 +231,8 @@ void TestAllForms() {
std::unique_ptr<DWARFContext> DwarfContext = DWARFContext::create(**Obj);
uint32_t NumCUs = DwarfContext->getNumCompileUnits();
EXPECT_EQ(NumCUs, 1u);
- DWARFCompileUnit *U = DwarfContext->getCompileUnitAtIndex(0);
+ DWARFCompileUnit *U =
+ cast<DWARFCompileUnit>(DwarfContext->getUnitAtIndex(0));
auto DieDG = U->getUnitDIE(false);
EXPECT_TRUE(DieDG.isValid());
@@ -496,7 +497,8 @@ template <uint16_t Version, class AddrType> void TestChildren() {
// Verify the number of compile units is correct.
uint32_t NumCUs = DwarfContext->getNumCompileUnits();
EXPECT_EQ(NumCUs, 1u);
- DWARFCompileUnit *U = DwarfContext->getCompileUnitAtIndex(0);
+ DWARFCompileUnit *U =
+ cast<DWARFCompileUnit>(DwarfContext->getUnitAtIndex(0));
// Get the compile unit DIE is valid.
auto DieDG = U->getUnitDIE(false);
@@ -672,8 +674,10 @@ template <uint16_t Version, class AddrType> void TestReferences() {
// Verify the number of compile units is correct.
uint32_t NumCUs = DwarfContext->getNumCompileUnits();
EXPECT_EQ(NumCUs, 2u);
- DWARFCompileUnit *U1 = DwarfContext->getCompileUnitAtIndex(0);
- DWARFCompileUnit *U2 = DwarfContext->getCompileUnitAtIndex(1);
+ DWARFCompileUnit *U1 =
+ cast<DWARFCompileUnit>(DwarfContext->getUnitAtIndex(0));
+ DWARFCompileUnit *U2 =
+ cast<DWARFCompileUnit>(DwarfContext->getUnitAtIndex(1));
// Get the compile unit DIE is valid.
auto Unit1DieDG = U1->getUnitDIE(false);
@@ -880,7 +884,8 @@ template <uint16_t Version, class AddrType> void TestAddresses() {
// Verify the number of compile units is correct.
uint32_t NumCUs = DwarfContext->getNumCompileUnits();
EXPECT_EQ(NumCUs, 1u);
- DWARFCompileUnit *U = DwarfContext->getCompileUnitAtIndex(0);
+ DWARFCompileUnit *U =
+ cast<DWARFCompileUnit>(DwarfContext->getUnitAtIndex(0));
// Get the compile unit DIE is valid.
auto DieDG = U->getUnitDIE(false);
@@ -1055,7 +1060,8 @@ TEST(DWARFDebugInfo, TestRelations) {
// Verify the number of compile units is correct.
uint32_t NumCUs = DwarfContext->getNumCompileUnits();
EXPECT_EQ(NumCUs, 1u);
- DWARFCompileUnit *U = DwarfContext->getCompileUnitAtIndex(0);
+ DWARFCompileUnit *U =
+ cast<DWARFCompileUnit>(DwarfContext->getUnitAtIndex(0));
// Get the compile unit DIE is valid.
auto CUDie = U->getUnitDIE(false);
@@ -1222,7 +1228,8 @@ TEST(DWARFDebugInfo, TestChildIterators) {
// Verify the number of compile units is correct.
uint32_t NumCUs = DwarfContext->getNumCompileUnits();
EXPECT_EQ(NumCUs, 1u);
- DWARFCompileUnit *U = DwarfContext->getCompileUnitAtIndex(0);
+ DWARFCompileUnit *U =
+ cast<DWARFCompileUnit>(DwarfContext->getUnitAtIndex(0));
// Get the compile unit DIE is valid.
auto CUDie = U->getUnitDIE(false);
@@ -1284,7 +1291,8 @@ TEST(DWARFDebugInfo, TestEmptyChildren) {
// Verify the number of compile units is correct.
uint32_t NumCUs = DwarfContext->getNumCompileUnits();
EXPECT_EQ(NumCUs, 1u);
- DWARFCompileUnit *U = DwarfContext->getCompileUnitAtIndex(0);
+ DWARFCompileUnit *U =
+ cast<DWARFCompileUnit>(DwarfContext->getUnitAtIndex(0));
// Get the compile unit DIE is valid.
auto CUDie = U->getUnitDIE(false);
@@ -1331,7 +1339,8 @@ TEST(DWARFDebugInfo, TestAttributeIterators) {
// Verify the number of compile units is correct.
uint32_t NumCUs = DwarfContext->getNumCompileUnits();
EXPECT_EQ(NumCUs, 1u);
- DWARFCompileUnit *U = DwarfContext->getCompileUnitAtIndex(0);
+ DWARFCompileUnit *U =
+ cast<DWARFCompileUnit>(DwarfContext->getUnitAtIndex(0));
// Get the compile unit DIE is valid.
auto CUDie = U->getUnitDIE(false);
@@ -1399,7 +1408,8 @@ TEST(DWARFDebugInfo, TestFindRecurse) {
// Verify the number of compile units is correct.
uint32_t NumCUs = DwarfContext->getNumCompileUnits();
EXPECT_EQ(NumCUs, 1u);
- DWARFCompileUnit *U = DwarfContext->getCompileUnitAtIndex(0);
+ DWARFCompileUnit *U =
+ cast<DWARFCompileUnit>(DwarfContext->getUnitAtIndex(0));
// Get the compile unit DIE is valid.
auto CUDie = U->getUnitDIE(false);
@@ -1606,7 +1616,8 @@ TEST(DWARFDebugInfo, TestFindAttrs) {
// Verify the number of compile units is correct.
uint32_t NumCUs = DwarfContext->getNumCompileUnits();
EXPECT_EQ(NumCUs, 1u);
- DWARFCompileUnit *U = DwarfContext->getCompileUnitAtIndex(0);
+ DWARFCompileUnit *U =
+ cast<DWARFCompileUnit>(DwarfContext->getUnitAtIndex(0));
// Get the compile unit DIE is valid.
auto CUDie = U->getUnitDIE(false);
@@ -1665,7 +1676,8 @@ TEST(DWARFDebugInfo, TestImplicitConstAbbrevs) {
auto Obj = object::ObjectFile::createObjectFile(FileBuffer);
EXPECT_TRUE((bool)Obj);
std::unique_ptr<DWARFContext> DwarfContext = DWARFContext::create(**Obj);
- DWARFCompileUnit *U = DwarfContext->getCompileUnitAtIndex(0);
+ DWARFCompileUnit *U =
+ cast<DWARFCompileUnit>(DwarfContext->getUnitAtIndex(0));
EXPECT_TRUE((bool)U);
const auto *Abbrevs = U->getAbbreviations();
diff --git a/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp b/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
index 99ed118e539..ad6b1ea84ce 100644
--- a/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
@@ -129,8 +129,8 @@ struct CommonFixture {
Error Unrecoverable;
std::function<void(Error)> RecordUnrecoverable;
- SmallVector<std::unique_ptr<DWARFCompileUnit>, 2> CUs;
- std::deque<DWARFUnitSection<DWARFTypeUnit>> TUs;
+ SmallVector<std::unique_ptr<DWARFUnit>, 2> CUs;
+ std::deque<DWARFUnitSection> TUs;
};
// Fixtures must derive from "Test", but parameterised fixtures from
OpenPOWER on IntegriCloud