<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 26 Sep 2014, at 14:34, Frederic Riss <<a href="mailto:friss@apple.com" class="">friss@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Author: friss<br class="">Date: Fri Sep 26 07:34:06 2014<br class="">New Revision: 218514<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=218514&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=218514&view=rev</a><br class="">Log:<br class="">Revert "Store TypeUnits in a SmallVector<DWARFUnitSection> instead of a single DWARFUnitSection."<br class=""><br class="">This reverts commit r218513.<br class=""><br class="">Buildbots using libstdc++ issue an error when trying to copy<br class="">SmallVector<std::unique_ptr<>>. Revert the commit until we have a fix.<br class=""></div></blockquote><div><br class=""></div><div>This wasn’t only libstdc++ in fact, MSVC also chocked and I have one libcxx bot that also failed.</div><div><br class=""></div><div>David, if you look at the commit, you’ll see that I didn’t replace the SmallVectors we talked about by std::vectors. I tried it, but it failed in a very similar way to the builders. I thought this was some libcxx or SmallVector issue and I was going to report it with a reproducer:</div><div><br class=""></div><div>#include <vector></div><div style="margin: 0px;" class="">#include <memory></div><div style="margin: 0px;" class="">#include <llvm/ADT/SmallVector.h></div><div style="margin: 0px; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px;" class="">typedef llvm::SmallVector<std::unique_ptr<int>,1> vec_type;</div><div style="margin: 0px;" class="">std::vector<vec_type> vecvec;</div><p style="margin: 0px; min-height: 13px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px;" class="">void foo() {</div><div style="margin: 0px;" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>vecvec.push_back(vec_type());</div><div style="margin: 0px;" class="">}</div><div class=""><br class=""></div><div class="">Is this code somehow wrong?</div><div class="">This fails to compile for me because the move semantics are lost somewhere and the implicitly deleted unique_ptr copy constructor is called. Note that other permutations of vector and SmallVector seem to work.</div><div class=""><br class=""></div><div class="">If I add explicit default and move constructors to DWARFUnitSection, then I am able to replace the SmallVectors by vectors as we discussed, but I don’t understand why this is necessary. Maybe this would also fix the issue seen on the builders, but in either case I can’t see why the compiler generated constructors don’t work. </div><div class=""><br class=""></div><div class="">For the record, here are some builder logs:</div><div class=""><a href="http://lab.llvm.org:8011/builders/clang-native-arm-cortex-a9/builds/21968/steps/compile/logs/stdio" class="">http://lab.llvm.org:8011/builders/clang-native-arm-cortex-a9/builds/21968/steps/compile/logs/stdio</a></div><div class=""><a href="http://lab.llvm.org:8011/builders/lld-x86_64-freebsd/builds/8474/steps/build_Lld/logs/stdio" class="">http://lab.llvm.org:8011/builders/lld-x86_64-freebsd/builds/8474/steps/build_Lld/logs/stdio</a></div><div class=""><a href="http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/13282/steps/build_Lld/logs/stdio" class="">http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/13282/steps/build_Lld/logs/stdio</a></div><div class=""><br class=""></div><div class="">Fred</div><br class=""><blockquote type="cite" class=""><div class="">Modified:<br class=""> llvm/trunk/lib/DebugInfo/DWARFContext.cpp<br class=""> llvm/trunk/lib/DebugInfo/DWARFContext.h<br class=""><br class="">Modified: llvm/trunk/lib/DebugInfo/DWARFContext.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFContext.cpp?rev=218514&r1=218513&r2=218514&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFContext.cpp?rev=218514&r1=218513&r2=218514&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/DebugInfo/DWARFContext.cpp (original)<br class="">+++ llvm/trunk/lib/DebugInfo/DWARFContext.cpp Fri Sep 26 07:34:06 2014<br class="">@@ -86,17 +86,15 @@ void DWARFContext::dump(raw_ostream &OS,<br class=""><br class=""> if ((DumpType == DIDT_All || DumpType == DIDT_Types) && getNumTypeUnits()) {<br class=""> OS << "\n.debug_types contents:\n";<br class="">- for (const auto &TUS : type_unit_sections())<br class="">- for (const auto &TU : TUS)<br class="">- TU->dump(OS);<br class="">+ for (const auto &TU : type_units())<br class="">+ TU->dump(OS);<br class=""> }<br class=""><br class=""> if ((DumpType == DIDT_All || DumpType == DIDT_TypesDwo) &&<br class=""> getNumDWOTypeUnits()) {<br class=""> OS << "\n.debug_types.dwo contents:\n";<br class="">- for (const auto &DWOTUS : dwo_type_unit_sections())<br class="">- for (const auto &DWOTU : DWOTUS)<br class="">- DWOTU->dump(OS);<br class="">+ for (const auto &DWOTU : dwo_type_units())<br class="">+ DWOTU->dump(OS);<br class=""> }<br class=""><br class=""> if (DumpType == DIDT_All || DumpType == DIDT_Loc) {<br class="">@@ -339,17 +337,15 @@ void DWARFContext::parseTypeUnits() {<br class=""> uint32_t offset = 0;<br class=""> const DataExtractor &DIData =<br class=""> DataExtractor(I.second.Data, isLittleEndian(), 0);<br class="">- TUs.push_back(DWARFUnitSection<DWARFTypeUnit>());<br class="">- auto &TUS = TUs.back();<br class=""> while (DIData.isValidOffset(offset)) {<br class=""> std::unique_ptr<DWARFTypeUnit> TU(new DWARFTypeUnit(*this,<br class=""> getDebugAbbrev(), I.second.Data, getRangeSection(),<br class=""> getStringSection(), StringRef(), getAddrSection(),<br class="">- &I.second.Relocs, isLittleEndian(), TUS));<br class="">+ &I.second.Relocs, isLittleEndian(), TUs));<br class=""> if (!TU->extract(DIData, &offset))<br class=""> break;<br class="">- TUS.push_back(std::move(TU));<br class="">- offset = TUS.back()->getNextUnitOffset();<br class="">+ TUs.push_back(std::move(TU));<br class="">+ offset = TUs.back()->getNextUnitOffset();<br class=""> }<br class=""> }<br class=""> }<br class="">@@ -380,17 +376,15 @@ void DWARFContext::parseDWOTypeUnits() {<br class=""> uint32_t offset = 0;<br class=""> const DataExtractor &DIData =<br class=""> DataExtractor(I.second.Data, isLittleEndian(), 0);<br class="">- DWOTUs.push_back(DWARFUnitSection<DWARFTypeUnit>());<br class="">- auto &TUS = DWOTUs.back();<br class=""> while (DIData.isValidOffset(offset)) {<br class=""> std::unique_ptr<DWARFTypeUnit> TU(new DWARFTypeUnit(*this,<br class=""> getDebugAbbrevDWO(), I.second.Data, getRangeDWOSection(),<br class=""> getStringDWOSection(), getStringOffsetDWOSection(), getAddrSection(),<br class="">- &I.second.Relocs, isLittleEndian(), TUS));<br class="">+ &I.second.Relocs, isLittleEndian(), DWOTUs));<br class=""> if (!TU->extract(DIData, &offset))<br class=""> break;<br class="">- TUS.push_back(std::move(TU));<br class="">- offset = TUS.back()->getNextUnitOffset();<br class="">+ DWOTUs.push_back(std::move(TU));<br class="">+ offset = DWOTUs.back()->getNextUnitOffset();<br class=""> }<br class=""> }<br class=""> }<br class=""><br class="">Modified: llvm/trunk/lib/DebugInfo/DWARFContext.h<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFContext.h?rev=218514&r1=218513&r2=218514&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFContext.h?rev=218514&r1=218513&r2=218514&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/DebugInfo/DWARFContext.h (original)<br class="">+++ llvm/trunk/lib/DebugInfo/DWARFContext.h Fri Sep 26 07:34:06 2014<br class="">@@ -30,7 +30,7 @@ namespace llvm {<br class=""> class DWARFContext : public DIContext {<br class=""><br class=""> DWARFUnitSection<DWARFCompileUnit> CUs;<br class="">- SmallVector<DWARFUnitSection<DWARFTypeUnit>,1> TUs;<br class="">+ DWARFUnitSection<DWARFTypeUnit> TUs;<br class=""> std::unique_ptr<DWARFDebugAbbrev> Abbrev;<br class=""> std::unique_ptr<DWARFDebugLoc> Loc;<br class=""> std::unique_ptr<DWARFDebugAranges> Aranges;<br class="">@@ -38,7 +38,7 @@ class DWARFContext : public DIContext {<br class=""> std::unique_ptr<DWARFDebugFrame> DebugFrame;<br class=""><br class=""> DWARFUnitSection<DWARFCompileUnit> DWOCUs;<br class="">- SmallVector<DWARFUnitSection<DWARFTypeUnit>,1> DWOTUs;<br class="">+ DWARFUnitSection<DWARFTypeUnit> DWOTUs;<br class=""> std::unique_ptr<DWARFDebugAbbrev> AbbrevDWO;<br class=""> std::unique_ptr<DWARFDebugLocDWO> LocDWO;<br class=""><br class="">@@ -77,7 +77,6 @@ public:<br class=""><br class=""> typedef DWARFUnitSection<DWARFCompileUnit>::iterator_range cu_iterator_range;<br class=""> typedef DWARFUnitSection<DWARFTypeUnit>::iterator_range tu_iterator_range;<br class="">- typedef iterator_range<SmallVectorImpl<DWARFUnitSection<DWARFTypeUnit>>::iterator> tu_section_iterator_range;<br class=""><br class=""> /// Get compile units in this context.<br class=""> cu_iterator_range compile_units() {<br class="">@@ -86,9 +85,9 @@ public:<br class=""> }<br class=""><br class=""> /// Get type units in this context.<br class="">- tu_section_iterator_range type_unit_sections() {<br class="">+ tu_iterator_range type_units() {<br class=""> parseTypeUnits();<br class="">- return tu_section_iterator_range(TUs.begin(), TUs.end());<br class="">+ return tu_iterator_range(TUs.begin(), TUs.end());<br class=""> }<br class=""><br class=""> /// Get compile units in the DWO context.<br class="">@@ -98,9 +97,9 @@ public:<br class=""> }<br class=""><br class=""> /// Get type units in the DWO context.<br class="">- tu_section_iterator_range dwo_type_unit_sections() {<br class="">+ tu_iterator_range dwo_type_units() {<br class=""> parseDWOTypeUnits();<br class="">- return tu_section_iterator_range(DWOTUs.begin(), DWOTUs.end());<br class="">+ return tu_iterator_range(DWOTUs.begin(), DWOTUs.end());<br class=""> }<br class=""><br class=""> /// Get the number of compile units in this context.<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@cs.uiuc.edu" class="">llvm-commits@cs.uiuc.edu</a><br class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br class=""></div></blockquote></div><br class=""></body></html>