[llvm] r175382 - Add support for updating the LiveIntervals of registers used by 'exotic'

Jakob Stoklund Olesen stoklund at 2pi.dk
Sat Feb 16 19:46:08 PST 2013


On Feb 16, 2013, at 7:12 PM, Cameron Zwarich <zwarich at apple.com> wrote:

> Switching to forward iterators still requires all of the callers to do stuff like this:
> 
>    iterator Begin = getFirstTerminator();
>    if (Begin != begin())
>      --Begin;
>    iterator End = end();
>    if (End != begin())
>      --End;

I am not sure why that would be necessary.

The function's traversing the range of instructions backwards is an implementation detail. It shouldn't be exposed in the function prototype at all. To repair the terminators, you should simply call repairIntervalsInRange(getFirstTerminator(), end()), with a standard half-open range.

If the function takes a standard half-open range of forward iterators [Begin; End), this loop will visit the instructions in that range backwards:

for (iterator I = End; I != Begin;) {
 --I;
 use(I);
}

Am I misunderstanding what you're trying to do?

/jakob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130216/9dcd7d4e/attachment.html>


More information about the llvm-commits mailing list