<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br></div><div>On Mar 15, 2015, at 8:34 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><p dir="ltr"><br>
On Mar 14, 2015 11:48 PM, "David Majnemer" <<a href="mailto:david.majnemer@gmail.com">david.majnemer@gmail.com</a>> wrote:<br>
><br>
><br>
><br>
> On Sat, Mar 14, 2015 at 11:39 PM, Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com">dexonsmith@apple.com</a>> wrote:<br>
>><br>
>> +dblaikie<br>
>><br>
>> > On 2015 Mar 14, at 23:11, David Majnemer <<a href="mailto:david.majnemer@gmail.com">david.majnemer@gmail.com</a>> wrote:<br>
>> ><br>
>> > Author: majnemer<br>
>> > Date: Sun Mar 15 01:11:24 2015<br>
>> > New Revision: 232314<br>
>> ><br>
>> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=232314&view=rev">http://llvm.org/viewvc/llvm-project?rev=232314&view=rev</a><br>
>> > Log:<br>
>> > Restore the gcc build<br>
>> ><br>
>> > Modified:<br>
>> >    llvm/trunk/include/llvm/ADT/ImmutableSet.h<br>
>> ><br>
>> > Modified: llvm/trunk/include/llvm/ADT/ImmutableSet.h<br>
>> > URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableSet.h?rev=232314&r1=232313&r2=232314&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableSet.h?rev=232314&r1=232313&r2=232314&view=diff</a><br>
>> > ==============================================================================<br>
>> > --- llvm/trunk/include/llvm/ADT/ImmutableSet.h (original)<br>
>> > +++ llvm/trunk/include/llvm/ADT/ImmutableSet.h Sun Mar 15 01:11:24 2015<br>
>> > @@ -652,6 +652,7 @@ public:<br>
>> >                    Flags=0x3 };<br>
>> ><br>
>> >   typedef ImutAVLTree<ImutInfo> TreeTy;<br>
>> > +  typedef ImutAVLTreeGenericIterator<ImutInfo> Self;<br>
>> ><br>
>> >   ImutAVLTreeGenericIterator() {}<br>
>> >   ImutAVLTreeGenericIterator(const TreeTy *Root) {<br>
>> > @@ -692,15 +693,11 @@ public:<br>
>> >     }<br>
>> >   }<br>
>> ><br>
>> > -  bool operator==(const ImutAVLTreeGenericIterator &x) const {<br>
>> > -    return stack == x.stack;<br>
>> > -  }<br>
>> > +  bool operator==(const Self &x) const { return stack == x.stack; }<br>
>><br>
>> (I'm guessing this was in response to r232312?)<br>
><br>
><br>
> I did this because of a build failure introduced by r232309.<br>
>  <br>
>><br>
>><br>
>> What was the error here?  This code looks correct to me, and I'm surprised<br>
>> GCC has problems.  A comment in the code would be nice, too.<br>
><br>
><br>
> GCC was upset about `typedef ImutAVLTreeGenericIterator<ImutInfo> ImutAVLTreeGenericIterator;`.</p>
<p dir="ltr">I removed this in a follow up commit, didn't I ? I'll double check everything when I get back to a keyboard but the typedef was just left in accidentally.</p></div></blockquote><div>Yeah, you removed it in r232312.  That's why I wasn't sure what GCC could be complaining  about.  </div><blockquote type="cite"><div>
<p dir="ltr">> The diagnostic was something on the order of:<br>
>   declaration of 'typedef ImutAVLTreeGenericIterator<ImutInfo> ImutAVLTreeGenericIterator'<br>
>   changes meaning of 'ImutAVLTreeGenericIterator' from 'struct ImutAVLTreeGenericIterator'<br>
>  <br>
>><br>
>><br>
>> Bike-shed on naming, but maybe `SelfTy` would be more clear?<br>
><br>
><br>
> The original code had `typedef ImutAVLTreeGenericIterator<ImutInfo> _Self;`, either would be fine with me.<br>
>  <br>
>><br>
>><br>
>> ><br>
>> > -  bool operator!=(const ImutAVLTreeGenericIterator &x) const {<br>
>> > -    return !(*this == x);<br>
>> > -  }<br>
>> > +  bool operator!=(const Self &x) const { return !operator==(x); }<br>
>> ><br>
>> > -  ImutAVLTreeGenericIterator &operator++() {<br>
>> > +  Self &operator++() {<br>
>> >     assert(!stack.empty());<br>
>> >     TreeTy* Current = reinterpret_cast<TreeTy*>(stack.back() & ~Flags);<br>
>> >     assert(Current);<br>
>> > @@ -726,7 +723,7 @@ public:<br>
>> >     return *this;<br>
>> >   }<br>
>> ><br>
>> > -  ImutAVLTreeGenericIterator &operator--() {<br>
>> > +  Self &operator--() {<br>
>> >     assert(!stack.empty());<br>
>> >     TreeTy* Current = reinterpret_cast<TreeTy*>(stack.back() & ~Flags);<br>
>> >     assert(Current);<br>
>> > @@ -759,7 +756,7 @@ class ImutAVLTreeInOrderIterator {<br>
>> ><br>
>> > public:<br>
>> >   typedef ImutAVLTree<ImutInfo> TreeTy;<br>
>> > -  typedef ImutAVLTreeInOrderIterator<ImutInfo> ImutAVLTreeGenericIterator;<br>
>> > +  typedef ImutAVLTreeInOrderIterator<ImutInfo> Self;<br>
>> ><br>
>> >   ImutAVLTreeInOrderIterator(const TreeTy* Root) : InternalItr(Root) {<br>
>> >     if (Root)<br>
>> > @@ -768,18 +765,14 @@ public:<br>
>> ><br>
>> >   ImutAVLTreeInOrderIterator() : InternalItr() {}<br>
>> ><br>
>> > -  bool operator==(const ImutAVLTreeGenericIterator &x) const {<br>
>> > -    return InternalItr == x.InternalItr;<br>
>> > -  }<br>
>> > +  bool operator==(const Self &x) const { return InternalItr == x.InternalItr; }<br>
>> ><br>
>> > -  bool operator!=(const ImutAVLTreeGenericIterator &x) const {<br>
>> > -    return !(*this == x);<br>
>> > -  }<br>
>> > +  bool operator!=(const Self &x) const { return !(*this == x); }<br>
>> ><br>
>> >   TreeTy *operator*() const { return *InternalItr; }<br>
>> >   TreeTy *operator->() const { return *InternalItr; }<br>
>> ><br>
>> > -  ImutAVLTreeGenericIterator &operator++() {<br>
>> > +  Self &operator++() {<br>
>> >     do ++InternalItr;<br>
>> >     while (!InternalItr.atEnd() &&<br>
>> >            InternalItr.getVisitState() != InternalIteratorTy::VisitedLeft);<br>
>> > @@ -787,7 +780,7 @@ public:<br>
>> >     return *this;<br>
>> >   }<br>
>> ><br>
>> > -  ImutAVLTreeGenericIterator &operator--() {<br>
>> > +  Self &operator--() {<br>
>> >     do --InternalItr;<br>
>> >     while (!InternalItr.atBeginning() &&<br>
>> >            InternalItr.getVisitState() != InternalIteratorTy::VisitedLeft);<br>
>> ><br>
>> ><br>
>> > _______________________________________________<br>
>> > llvm-commits mailing list<br>
>> > <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
>> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
>><br>
><br>
</p>
</div></blockquote></body></html>