<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="">Looks like the mirror in the lab is not updating again. I’ll ping Galina and see if she can give it a kick. Thanks for the heads up.<div class=""><br class=""></div><div class="">-Mike</div><div class=""><br class=""><div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Mike Edwards<br class=""> Apple, Inc.<br class="">☏ 408-862-7095<br class=""><a href="mailto:medwards@apple.com" class="">medwards@apple.com</a><br class=""><br class=""></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Mar 13, 2017, at 11:50 AM, Adrian Prantl <<a href="mailto:aprantl@apple.com" class="">aprantl@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">+Mike<div class="">Strange, it looks like the green dragon incremental bot didn;t build anything after 9:44AM today.</div><div class=""><br class=""></div><div class="">-- adrian<br class=""><div class=""><blockquote type="cite" class=""><div class="">On Mar 13, 2017, at 11:47 AM, Zachary Turner <<a href="mailto:zturner@google.com" class="">zturner@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I believe I've fixed all of these (including the one you linked to above), but it's taking some time for the builders to cycle.</div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Mon, Mar 13, 2017 at 11:46 AM Adrian Prantl <<a href="mailto:aprantl@apple.com" class="">aprantl@apple.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg">This seems to have broken some bots:<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><a href="http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental_build/36596/consoleFull#67046690349ba4694-19c4-4d7e-bec5-911270d8a58c" class="gmail_msg" target="_blank">http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental_build/36596/consoleFull#67046690349ba4694-19c4-4d7e-bec5-911270d8a58c</a></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">could you please take a look?</div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg">-- adrian</div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Mar 13, 2017, at 9:24 AM, Zachary Turner via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="gmail_msg" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="gmail_msg m_7357135274042866406Apple-interchange-newline"><div class="gmail_msg"><div class="gmail_msg">Author: zturner<br class="gmail_msg">Date: Mon Mar 13 11:24:10 2017<br class="gmail_msg">New Revision: 297633<br class="gmail_msg"><br class="gmail_msg">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=297633&view=rev" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project?rev=297633&view=rev</a><br class="gmail_msg">Log:<br class="gmail_msg">[ADT] Improve the genericity of llvm::enumerate().<br class="gmail_msg"><br class="gmail_msg">There were some issues in the implementation of enumerate()<br class="gmail_msg">preventing it from being used in various contexts. These were<br class="gmail_msg">all related to the fact that it did not supporter llvm's<br class="gmail_msg">iterator_facade_base class. So this patch adds support for that<br class="gmail_msg">and additionally exposes a new helper method to_vector() that<br class="gmail_msg">will evaluate an entire range and store the results in a<br class="gmail_msg">vector.<br class="gmail_msg"><br class="gmail_msg">Differential Revision: <a href="https://reviews.llvm.org/D30853" class="gmail_msg" target="_blank">https://reviews.llvm.org/D30853</a><br class="gmail_msg"><br class="gmail_msg">Modified:<br class="gmail_msg"> llvm/trunk/include/llvm/ADT/STLExtras.h<br class="gmail_msg"> llvm/trunk/unittests/ADT/STLExtrasTest.cpp<br class="gmail_msg"> llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp<br class="gmail_msg"><br class="gmail_msg">Modified: llvm/trunk/include/llvm/ADT/STLExtras.h<br class="gmail_msg">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/STLExtras.h?rev=297633&r1=297632&r2=297633&view=diff" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/STLExtras.h?rev=297633&r1=297632&r2=297633&view=diff</a><br class="gmail_msg">==============================================================================<br class="gmail_msg">--- llvm/trunk/include/llvm/ADT/STLExtras.h (original)<br class="gmail_msg">+++ llvm/trunk/include/llvm/ADT/STLExtras.h Mon Mar 13 11:24:10 2017<br class="gmail_msg">@@ -28,6 +28,7 @@<br class="gmail_msg"> #include <utility> // for std::pair<br class="gmail_msg"><br class="gmail_msg"> #include "llvm/ADT/Optional.h"<br class="gmail_msg">+#include "llvm/ADT/SmallVector.h"<br class="gmail_msg"> #include "llvm/ADT/iterator.h"<br class="gmail_msg"> #include "llvm/ADT/iterator_range.h"<br class="gmail_msg"> #include "llvm/Support/Compiler.h"<br class="gmail_msg">@@ -44,6 +45,10 @@ namespace detail {<br class="gmail_msg"> template <typename RangeT><br class="gmail_msg"> using IterOfRange = decltype(std::begin(std::declval<RangeT &>()));<br class="gmail_msg"><br class="gmail_msg">+template <typename RangeT><br class="gmail_msg">+using ValueOfRange = typename std::remove_reference<decltype(<br class="gmail_msg">+ *std::begin(std::declval<RangeT &>()))>::type;<br class="gmail_msg">+<br class="gmail_msg"> } // End detail namespace<br class="gmail_msg"><br class="gmail_msg"> //===----------------------------------------------------------------------===//<br class="gmail_msg">@@ -883,6 +888,14 @@ auto partition(R &&Range, UnaryPredicate<br class="gmail_msg"> return std::partition(std::begin(Range), std::end(Range), P);<br class="gmail_msg"> }<br class="gmail_msg"><br class="gmail_msg">+/// \brief Given a range of type R, iterate the entire range and return a<br class="gmail_msg">+/// SmallVector with elements of the vector. This is useful, for example,<br class="gmail_msg">+/// when you want to iterate a range and then sort the results.<br class="gmail_msg">+template <unsigned Size, typename R><br class="gmail_msg">+SmallVector<detail::ValueOfRange<R>, Size> to_vector(R &&Range) {<br class="gmail_msg">+ return {std::begin(Range), std::end(Range)};<br class="gmail_msg">+}<br class="gmail_msg">+<br class="gmail_msg"> /// Provide a container algorithm similar to C++ Library Fundamentals v2's<br class="gmail_msg"> /// `erase_if` which is equivalent to:<br class="gmail_msg"> ///<br class="gmail_msg">@@ -977,47 +990,82 @@ template <typename T> struct deref {<br class="gmail_msg"> };<br class="gmail_msg"><br class="gmail_msg"> namespace detail {<br class="gmail_msg">-template <typename R> class enumerator_impl {<br class="gmail_msg">+template <typename R> class enumerator_iter;<br class="gmail_msg">+<br class="gmail_msg">+template <typename R> struct result_pair {<br class="gmail_msg">+ friend class enumerator_iter<R>;<br class="gmail_msg">+<br class="gmail_msg">+ result_pair() : Index(-1) {}<br class="gmail_msg">+ result_pair(std::size_t Index, IterOfRange<R> Iter)<br class="gmail_msg">+ : Index(Index), Iter(Iter) {}<br class="gmail_msg">+<br class="gmail_msg">+ result_pair<R> &operator=(const result_pair<R> &Other) {<br class="gmail_msg">+ Index = Other.Index;<br class="gmail_msg">+ Iter = Other.Iter;<br class="gmail_msg">+ return *this;<br class="gmail_msg">+ }<br class="gmail_msg">+<br class="gmail_msg">+ std::size_t index() const { return Index; }<br class="gmail_msg">+ const ValueOfRange<R> &value() const { return *Iter; }<br class="gmail_msg">+ ValueOfRange<R> &value() { return *Iter; }<br class="gmail_msg">+<br class="gmail_msg">+private:<br class="gmail_msg">+ std::size_t Index;<br class="gmail_msg">+ IterOfRange<R> Iter;<br class="gmail_msg">+};<br class="gmail_msg">+<br class="gmail_msg">+template <typename R><br class="gmail_msg">+class enumerator_iter<br class="gmail_msg">+ : public iterator_facade_base<<br class="gmail_msg">+ enumerator_iter<R>, std::forward_iterator_tag, result_pair<R>,<br class="gmail_msg">+ typename std::iterator_traits<IterOfRange<R>>::difference_type,<br class="gmail_msg">+ typename std::iterator_traits<IterOfRange<R>>::pointer,<br class="gmail_msg">+ typename std::iterator_traits<IterOfRange<R>>::reference> {<br class="gmail_msg">+ using result_type = result_pair<R>;<br class="gmail_msg">+<br class="gmail_msg"> public:<br class="gmail_msg">- template <typename X> struct result_pair {<br class="gmail_msg">- result_pair(std::size_t Index, X Value) : Index(Index), Value(Value) {}<br class="gmail_msg">+ enumerator_iter(std::size_t Index, IterOfRange<R> Iter)<br class="gmail_msg">+ : Result(Index, Iter) {}<br class="gmail_msg"><br class="gmail_msg">- const std::size_t Index;<br class="gmail_msg">- X Value;<br class="gmail_msg">- };<br class="gmail_msg">+ result_type &operator*() { return Result; }<br class="gmail_msg">+ const result_type &operator*() const { return Result; }<br class="gmail_msg"><br class="gmail_msg">- class iterator {<br class="gmail_msg">- typedef<br class="gmail_msg">- typename std::iterator_traits<IterOfRange<R>>::reference iter_reference;<br class="gmail_msg">- typedef result_pair<iter_reference> result_type;<br class="gmail_msg">-<br class="gmail_msg">- public:<br class="gmail_msg">- iterator(IterOfRange<R> &&Iter, std::size_t Index)<br class="gmail_msg">- : Iter(Iter), Index(Index) {}<br class="gmail_msg">-<br class="gmail_msg">- result_type operator*() const { return result_type(Index, *Iter); }<br class="gmail_msg">-<br class="gmail_msg">- iterator &operator++() {<br class="gmail_msg">- ++Iter;<br class="gmail_msg">- ++Index;<br class="gmail_msg">- return *this;<br class="gmail_msg">- }<br class="gmail_msg">-<br class="gmail_msg">- bool operator!=(const iterator &RHS) const { return Iter != RHS.Iter; }<br class="gmail_msg">-<br class="gmail_msg">- private:<br class="gmail_msg">- IterOfRange<R> Iter;<br class="gmail_msg">- std::size_t Index;<br class="gmail_msg">- };<br class="gmail_msg">+ enumerator_iter<R> &operator++() {<br class="gmail_msg">+ assert(Result.Index != -1);<br class="gmail_msg">+ ++Result.Iter;<br class="gmail_msg">+ ++Result.Index;<br class="gmail_msg">+ return *this;<br class="gmail_msg">+ }<br class="gmail_msg">+<br class="gmail_msg">+ bool operator==(const enumerator_iter<R> &RHS) const {<br class="gmail_msg">+ // Don't compare indices here, only iterators. It's possible for an end<br class="gmail_msg">+ // iterator to have different indices depending on whether it was created<br class="gmail_msg">+ // by calling std::end() versus incrementing a valid iterator.<br class="gmail_msg">+ return Result.Iter == RHS.Result.Iter;<br class="gmail_msg">+ }<br class="gmail_msg">+<br class="gmail_msg">+ enumerator_iter<R> &operator=(const enumerator_iter<R> &Other) {<br class="gmail_msg">+ Result = Other.Result;<br class="gmail_msg">+ return *this;<br class="gmail_msg">+ }<br class="gmail_msg"><br class="gmail_msg">+private:<br class="gmail_msg">+ result_type Result;<br class="gmail_msg">+};<br class="gmail_msg">+<br class="gmail_msg">+template <typename R> class enumerator {<br class="gmail_msg"> public:<br class="gmail_msg">- explicit enumerator_impl(R &&Range) : Range(std::forward<R>(Range)) {}<br class="gmail_msg">+ explicit enumerator(R &&Range) : TheRange(std::forward<R>(Range)) {}<br class="gmail_msg"><br class="gmail_msg">- iterator begin() { return iterator(std::begin(Range), 0); }<br class="gmail_msg">- iterator end() { return iterator(std::end(Range), std::size_t(-1)); }<br class="gmail_msg">+ enumerator_iter<R> begin() {<br class="gmail_msg">+ return enumerator_iter<R>(0, std::begin(TheRange));<br class="gmail_msg">+ }<br class="gmail_msg">+ enumerator_iter<R> end() {<br class="gmail_msg">+ return enumerator_iter<R>(-1, std::end(TheRange));<br class="gmail_msg">+ }<br class="gmail_msg"><br class="gmail_msg"> private:<br class="gmail_msg">- R Range;<br class="gmail_msg">+ R TheRange;<br class="gmail_msg"> };<br class="gmail_msg"> }<br class="gmail_msg"><br class="gmail_msg">@@ -1036,8 +1084,8 @@ private:<br class="gmail_msg"> /// Item 2 - C<br class="gmail_msg"> /// Item 3 - D<br class="gmail_msg"> ///<br class="gmail_msg">-template <typename R> detail::enumerator_impl<R> enumerate(R &&Range) {<br class="gmail_msg">- return detail::enumerator_impl<R>(std::forward<R>(Range));<br class="gmail_msg">+template <typename R> detail::enumerator<R> enumerate(R &&TheRange) {<br class="gmail_msg">+ return detail::enumerator<R>(std::forward<R>(TheRange));<br class="gmail_msg"> }<br class="gmail_msg"><br class="gmail_msg"> namespace detail {<br class="gmail_msg"><br class="gmail_msg">Modified: llvm/trunk/unittests/ADT/STLExtrasTest.cpp<br class="gmail_msg">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/STLExtrasTest.cpp?rev=297633&r1=297632&r2=297633&view=diff" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/STLExtrasTest.cpp?rev=297633&r1=297632&r2=297633&view=diff</a><br class="gmail_msg">==============================================================================<br class="gmail_msg">--- llvm/trunk/unittests/ADT/STLExtrasTest.cpp (original)<br class="gmail_msg">+++ llvm/trunk/unittests/ADT/STLExtrasTest.cpp Mon Mar 13 11:24:10 2017<br class="gmail_msg">@@ -48,7 +48,7 @@ TEST(STLExtrasTest, EnumerateLValue) {<br class="gmail_msg"> std::vector<CharPairType> CharResults;<br class="gmail_msg"><br class="gmail_msg"> for (auto X : llvm::enumerate(foo)) {<br class="gmail_msg">- CharResults.emplace_back(X.Index, X.Value);<br class="gmail_msg">+ CharResults.emplace_back(X.index(), X.value());<br class="gmail_msg"> }<br class="gmail_msg"> ASSERT_EQ(3u, CharResults.size());<br class="gmail_msg"> EXPECT_EQ(CharPairType(0u, 'a'), CharResults[0]);<br class="gmail_msg">@@ -60,7 +60,7 @@ TEST(STLExtrasTest, EnumerateLValue) {<br class="gmail_msg"> std::vector<IntPairType> IntResults;<br class="gmail_msg"> const std::vector<int> bar = {1, 2, 3};<br class="gmail_msg"> for (auto X : llvm::enumerate(bar)) {<br class="gmail_msg">- IntResults.emplace_back(X.Index, X.Value);<br class="gmail_msg">+ IntResults.emplace_back(X.index(), X.value());<br class="gmail_msg"> }<br class="gmail_msg"> ASSERT_EQ(3u, IntResults.size());<br class="gmail_msg"> EXPECT_EQ(IntPairType(0u, 1), IntResults[0]);<br class="gmail_msg">@@ -71,7 +71,7 @@ TEST(STLExtrasTest, EnumerateLValue) {<br class="gmail_msg"> IntResults.clear();<br class="gmail_msg"> const std::vector<int> baz{};<br class="gmail_msg"> for (auto X : llvm::enumerate(baz)) {<br class="gmail_msg">- IntResults.emplace_back(X.Index, X.Value);<br class="gmail_msg">+ IntResults.emplace_back(X.index(), X.value());<br class="gmail_msg"> }<br class="gmail_msg"> EXPECT_TRUE(IntResults.empty());<br class="gmail_msg"> }<br class="gmail_msg">@@ -82,7 +82,7 @@ TEST(STLExtrasTest, EnumerateModifyLValu<br class="gmail_msg"> std::vector<char> foo = {'a', 'b', 'c'};<br class="gmail_msg"><br class="gmail_msg"> for (auto X : llvm::enumerate(foo)) {<br class="gmail_msg">- ++X.Value;<br class="gmail_msg">+ ++X.value();<br class="gmail_msg"> }<br class="gmail_msg"> EXPECT_EQ('b', foo[0]);<br class="gmail_msg"> EXPECT_EQ('c', foo[1]);<br class="gmail_msg">@@ -97,7 +97,7 @@ TEST(STLExtrasTest, EnumerateRValueRef)<br class="gmail_msg"> auto Enumerator = llvm::enumerate(std::vector<int>{1, 2, 3});<br class="gmail_msg"><br class="gmail_msg"> for (auto X : llvm::enumerate(std::vector<int>{1, 2, 3})) {<br class="gmail_msg">- Results.emplace_back(X.Index, X.Value);<br class="gmail_msg">+ Results.emplace_back(X.index(), X.value());<br class="gmail_msg"> }<br class="gmail_msg"><br class="gmail_msg"> ASSERT_EQ(3u, Results.size());<br class="gmail_msg">@@ -114,8 +114,8 @@ TEST(STLExtrasTest, EnumerateModifyRValu<br class="gmail_msg"> std::vector<PairType> Results;<br class="gmail_msg"><br class="gmail_msg"> for (auto X : llvm::enumerate(std::vector<char>{'1', '2', '3'})) {<br class="gmail_msg">- ++X.Value;<br class="gmail_msg">- Results.emplace_back(X.Index, X.Value);<br class="gmail_msg">+ ++X.value();<br class="gmail_msg">+ Results.emplace_back(X.index(), X.value());<br class="gmail_msg"> }<br class="gmail_msg"><br class="gmail_msg"> ASSERT_EQ(3u, Results.size());<br class="gmail_msg">@@ -255,6 +255,16 @@ TEST(STLExtrasTest, CountAdaptor) {<br class="gmail_msg"> EXPECT_EQ(1, count(v, 4));<br class="gmail_msg"> }<br class="gmail_msg"><br class="gmail_msg">+TEST(STLExtrasTest, ToVector) {<br class="gmail_msg">+ std::vector<char> v = {'a', 'b', 'c'};<br class="gmail_msg">+ auto Enumerated = to_vector<4>(enumerate(v));<br class="gmail_msg">+ ASSERT_EQ(3, Enumerated.size());<br class="gmail_msg">+ for (size_t I = 0; I < v.size(); ++I) {<br class="gmail_msg">+ EXPECT_EQ(I, Enumerated[I].index());<br class="gmail_msg">+ EXPECT_EQ(v[I], Enumerated[I].value());<br class="gmail_msg">+ }<br class="gmail_msg">+}<br class="gmail_msg">+<br class="gmail_msg"> TEST(STLExtrasTest, ConcatRange) {<br class="gmail_msg"> std::vector<int> Expected = {1, 2, 3, 4, 5, 6, 7, 8};<br class="gmail_msg"> std::vector<int> Test;<br class="gmail_msg"><br class="gmail_msg">Modified: llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp<br class="gmail_msg">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp?rev=297633&r1=297632&r2=297633&view=diff" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp?rev=297633&r1=297632&r2=297633&view=diff</a><br class="gmail_msg">==============================================================================<br class="gmail_msg">--- llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp (original)<br class="gmail_msg">+++ llvm/trunk/utils/TableGen/GlobalISelEmitter.cpp Mon Mar 13 11:24:10 2017<br class="gmail_msg">@@ -582,9 +582,9 @@ private:<br class="gmail_msg"> /// True if the instruction can be built solely by mutating the opcode.<br class="gmail_msg"> bool canMutate() const {<br class="gmail_msg"> for (const auto &Renderer : enumerate(OperandRenderers)) {<br class="gmail_msg">- if (const auto *Copy = dyn_cast<CopyRenderer>(&*Renderer.Value)) {<br class="gmail_msg">+ if (const auto *Copy = dyn_cast<CopyRenderer>(&*Renderer.value())) {<br class="gmail_msg"> if (Matched.getOperand(Copy->getSymbolicName()).getOperandIndex() !=<br class="gmail_msg">- Renderer.Index)<br class="gmail_msg">+ Renderer.index())<br class="gmail_msg"> return false;<br class="gmail_msg"> } else<br class="gmail_msg"> return false;<br class="gmail_msg"><br class="gmail_msg"><br class="gmail_msg">_______________________________________________<br class="gmail_msg">llvm-commits mailing list<br class="gmail_msg"><a href="mailto:llvm-commits@lists.llvm.org" class="gmail_msg" target="_blank">llvm-commits@lists.llvm.org</a><br class="gmail_msg"><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="gmail_msg"></div></div></blockquote></div><br class="gmail_msg"></div></div></blockquote></div>
</div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></body></html>