From 2e26931cef101a21fcd4d0931629fdc5fd0a38bd Mon Sep 17 00:00:00 2001 From: Frederic Riss Date: Fri, 26 Sep 2014 12:34:06 +0000 Subject: [PATCH] Revert "Store TypeUnits in a SmallVector instead of a single DWARFUnitSection." This reverts commit r218513. Buildbots using libstdc++ issue an error when trying to copy SmallVector>. Revert the commit until we have a fix. llvm-svn: 218514 --- lib/DebugInfo/DWARFContext.cpp | 26 ++++++++++---------------- lib/DebugInfo/DWARFContext.h | 13 ++++++------- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/lib/DebugInfo/DWARFContext.cpp b/lib/DebugInfo/DWARFContext.cpp index 1f9491002d2..1be0691a1d9 100644 --- a/lib/DebugInfo/DWARFContext.cpp +++ b/lib/DebugInfo/DWARFContext.cpp @@ -86,17 +86,15 @@ void DWARFContext::dump(raw_ostream &OS, DIDumpType DumpType) { if ((DumpType == DIDT_All || DumpType == DIDT_Types) && getNumTypeUnits()) { OS << "\n.debug_types contents:\n"; - for (const auto &TUS : type_unit_sections()) - for (const auto &TU : TUS) - TU->dump(OS); + for (const auto &TU : type_units()) + TU->dump(OS); } if ((DumpType == DIDT_All || DumpType == DIDT_TypesDwo) && getNumDWOTypeUnits()) { OS << "\n.debug_types.dwo contents:\n"; - for (const auto &DWOTUS : dwo_type_unit_sections()) - for (const auto &DWOTU : DWOTUS) - DWOTU->dump(OS); + for (const auto &DWOTU : dwo_type_units()) + DWOTU->dump(OS); } if (DumpType == DIDT_All || DumpType == DIDT_Loc) { @@ -339,17 +337,15 @@ void DWARFContext::parseTypeUnits() { uint32_t offset = 0; const DataExtractor &DIData = DataExtractor(I.second.Data, isLittleEndian(), 0); - TUs.push_back(DWARFUnitSection()); - auto &TUS = TUs.back(); while (DIData.isValidOffset(offset)) { std::unique_ptr TU(new DWARFTypeUnit(*this, getDebugAbbrev(), I.second.Data, getRangeSection(), getStringSection(), StringRef(), getAddrSection(), - &I.second.Relocs, isLittleEndian(), TUS)); + &I.second.Relocs, isLittleEndian(), TUs)); if (!TU->extract(DIData, &offset)) break; - TUS.push_back(std::move(TU)); - offset = TUS.back()->getNextUnitOffset(); + TUs.push_back(std::move(TU)); + offset = TUs.back()->getNextUnitOffset(); } } } @@ -380,17 +376,15 @@ void DWARFContext::parseDWOTypeUnits() { uint32_t offset = 0; const DataExtractor &DIData = DataExtractor(I.second.Data, isLittleEndian(), 0); - DWOTUs.push_back(DWARFUnitSection()); - auto &TUS = DWOTUs.back(); while (DIData.isValidOffset(offset)) { std::unique_ptr TU(new DWARFTypeUnit(*this, getDebugAbbrevDWO(), I.second.Data, getRangeDWOSection(), getStringDWOSection(), getStringOffsetDWOSection(), getAddrSection(), - &I.second.Relocs, isLittleEndian(), TUS)); + &I.second.Relocs, isLittleEndian(), DWOTUs)); if (!TU->extract(DIData, &offset)) break; - TUS.push_back(std::move(TU)); - offset = TUS.back()->getNextUnitOffset(); + DWOTUs.push_back(std::move(TU)); + offset = DWOTUs.back()->getNextUnitOffset(); } } } diff --git a/lib/DebugInfo/DWARFContext.h b/lib/DebugInfo/DWARFContext.h index 972f313c622..f00191acb93 100644 --- a/lib/DebugInfo/DWARFContext.h +++ b/lib/DebugInfo/DWARFContext.h @@ -30,7 +30,7 @@ namespace llvm { class DWARFContext : public DIContext { DWARFUnitSection CUs; - SmallVector,1> TUs; + DWARFUnitSection TUs; std::unique_ptr Abbrev; std::unique_ptr Loc; std::unique_ptr Aranges; @@ -38,7 +38,7 @@ class DWARFContext : public DIContext { std::unique_ptr DebugFrame; DWARFUnitSection DWOCUs; - SmallVector,1> DWOTUs; + DWARFUnitSection DWOTUs; std::unique_ptr AbbrevDWO; std::unique_ptr LocDWO; @@ -77,7 +77,6 @@ public: typedef DWARFUnitSection::iterator_range cu_iterator_range; typedef DWARFUnitSection::iterator_range tu_iterator_range; - typedef iterator_range>::iterator> tu_section_iterator_range; /// Get compile units in this context. cu_iterator_range compile_units() { @@ -86,9 +85,9 @@ public: } /// Get type units in this context. - tu_section_iterator_range type_unit_sections() { + tu_iterator_range type_units() { parseTypeUnits(); - return tu_section_iterator_range(TUs.begin(), TUs.end()); + return tu_iterator_range(TUs.begin(), TUs.end()); } /// Get compile units in the DWO context. @@ -98,9 +97,9 @@ public: } /// Get type units in the DWO context. - tu_section_iterator_range dwo_type_unit_sections() { + tu_iterator_range dwo_type_units() { parseDWOTypeUnits(); - return tu_section_iterator_range(DWOTUs.begin(), DWOTUs.end()); + return tu_iterator_range(DWOTUs.begin(), DWOTUs.end()); } /// Get the number of compile units in this context.