[llvm] r294349 - ADT: Add explicit conversions for reverse ilist iterators

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 8 09:23:54 PST 2017


Great, thanks!

> On 2017-Feb-08, at 09:15, Hans Wennborg <hans at chromium.org> wrote:
> 
> Okay, you sold me :-) Merged together with r294357 in r294477.
> 
> Committed your release notes in r294478.
> 
> Thanks,
> Hans
> 
> On Tue, Feb 7, 2017 at 6:00 PM, Duncan P. N. Exon Smith
> <dexonsmith at apple.com> wrote:
>> It's fixing an API regression; previously, ilist::reverse_iterator had an explicit conversion constructor (with these semantics) from ilist::iterator.  Since I removed it, there have been a number of complaints that it *should* exist in its old form.
>> 
>> Those upgrading from LLVM 3.9 to LLVM 4.0 will have less code to update if we take this patch, and the instructions for how to update it are simpler as a result of it.
>> 
>>> On 2017-Feb-07, at 15:03, Hans Wennborg <hans at chromium.org> wrote:
>>> 
>>> Since it's not fixing a regression from 3.9, I'd prefer not to merge
>>> it at this stage, but let it be part of the next release instead.
>>> 
>>> On Tue, Feb 7, 2017 at 2:48 PM, Duncan P. N. Exon Smith
>>> <dexonsmith at apple.com> wrote:
>>>> Hans, can we take this commit (r294349) and David's fixup in r294357 into the LLVM 4.0 branch?
>>>> 
>>>> I've also attached a patch for the release notes that attempt to summarize the ilist changes.
>>>> 
>>>> Thanks!
>>>> Duncan
>>>> 
>>>> 
>>>> 
>>>> 
>>>>> On 2017-Feb-07, at 13:03, Duncan P. N. Exon Smith via llvm-commits <llvm-commits at lists.llvm.org> wrote:
>>>>> 
>>>>> Author: dexonsmith
>>>>> Date: Tue Feb  7 15:03:50 2017
>>>>> New Revision: 294349
>>>>> 
>>>>> URL: http://llvm.org/viewvc/llvm-project?rev=294349&view=rev
>>>>> Log:
>>>>> ADT: Add explicit conversions for reverse ilist iterators
>>>>> 
>>>>> Add explicit conversions between forward and reverse ilist iterators.
>>>>> These follow the conversion conventions of std::reverse_iterator, which
>>>>> are off-by-one: the newly-constructed "reverse" iterator dereferences to
>>>>> the previous node of the one sent in.  This has the benefit of
>>>>> converting reverse ranges in place:
>>>>> - If [I, E) is a valid range,
>>>>> - then [reverse(E), reverse(I)) gives the same range in reverse order.
>>>>> 
>>>>> ilist_iterator::getReverse() is unchanged: it returns a reverse iterator
>>>>> to the *same* node.
>>>>> 
>>>>> Modified:
>>>>>  llvm/trunk/include/llvm/ADT/ilist_iterator.h
>>>>>  llvm/trunk/include/llvm/CodeGen/MachineInstrBundleIterator.h
>>>>>  llvm/trunk/unittests/ADT/IListIteratorTest.cpp
>>>>>  llvm/trunk/unittests/CodeGen/MachineInstrBundleIteratorTest.cpp



More information about the llvm-commits mailing list