<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 23:39, Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com" class="">dexonsmith@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">On Sep 26, 2014, at 6:49 AM, Frédéric Riss <<a href="mailto:friss@apple.com" class="">friss@apple.com</a>> wrote:<br class=""><br class=""><blockquote type="cite" class=""><br class="">On 26 Sep 2014, at 14:34, Frederic Riss <<a href="mailto:friss@apple.com" class="">friss@apple.com</a>> wrote:<br class=""><br 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=""></blockquote><br class="">This wasn’t only libstdc++ in fact, MSVC also chocked and I have one libcxx bot that also failed.<br class=""><br class="">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:<br class=""><br class="">#include <vector><br class="">#include <memory><br class="">#include <llvm/ADT/SmallVector.h><br class=""><br class="">typedef llvm::SmallVector<std::unique_ptr<int>,1> vec_type;<br class="">std::vector<vec_type> vecvec;<br class=""><br class="">void foo() {<br class=""><span class="Apple-tab-span" style="white-space: pre;">   </span>vecvec.push_back(vec_type());<br class="">}<br class=""><br class="">Is this code somehow wrong?<br 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.<br class=""><br 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.<span class="Apple-converted-space"> </span><br class=""><br class="">For the record, here are some builder logs:<br 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><br class=""></blockquote><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I looked at this one.  It looks to me like the compiler hasn’t generated</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">a move constructor for `DWARFUnitSection`.  I knew MSVC had issues like</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">this, but maybe GCC has trouble to.  We can’t really trust compilers to</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">auto-generate C++11 constructors properly.</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>By ‘compilers’ you mean clang too ? because there was one clang++ failure in the logs I provided (on freebsd). I suppose it can be an old version that had the same kind of issues.</div><br class=""><blockquote type="cite" class=""><div class=""><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Looking at the code, you probably just need something like this:</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">    DwarfUnitSection(DwarfUnitSection &&X)</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">        : SmallVector<std::unique_ptr<UnitType>>(std::move(X)) {}</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>Yeah, and also add an empty default constructor. I just wanted to make sure that the code in itself wasn’t flawed in a way that I didn’t understand.</div><div><br class=""></div><div>Thanks for looking into it!</div><div>Fred</div><br class=""><blockquote type="cite" class=""><div class=""><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">If MSVC supported it, you could do this instead:</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">    DwarfUnitSection(DwarfUnitSection &&) = default;</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" 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><br class="">http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/13282/steps/build_Lld/logs/stdio<br class=""><br class="">Fred<br class=""><br class=""><blockquote type="cite" 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: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFContext.cpp?rev=218514&r1=218513&r2=218514&view=diff<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: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARFContext.h?rev=218514&r1=218513&r2=218514&view=diff<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="">llvm-commits@cs.uiuc.edu<br class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br class=""></blockquote><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class="">llvm-commits@cs.uiuc.edu<br class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</blockquote></div></blockquote></div><br class=""></body></html>