[llvm] r203757 - Phase 1 of refactoring the MachineRegisterInfo iterators to make them suitable

Hans Wennborg hans at chromium.org
Thu Mar 13 11:27:23 PDT 2014


Hi Owen,

On Wed, Mar 12, 2014 at 11:02 PM, Owen Anderson <resistor at mac.com> wrote:
> Author: resistor
> Date: Thu Mar 13 01:02:25 2014
> New Revision: 203757
>
> URL: http://llvm.org/viewvc/llvm-project?rev=203757&view=rev
> Log:
> Phase 1 of refactoring the MachineRegisterInfo iterators to make them suitable
> for use with C++11 range-based for-loops.
>
> The gist of phase 1 is to remove the skipInstruction() and skipBundle()
> methods from these iterators, instead splitting each iterator into a version
> that walks operands, a version that walks instructions, and a version that
> walks bundles.  This has the result of making some "clever" loops in lib/CodeGen
> more verbose, but also makes their iterator invalidation characteristics much
> more obvious to the casual reader. (Making them concise again in the future is a
> good motivating case for a pre-incrementing range adapter!)
>
> Phase 2 of this undertaking with consist of removing the getOperand() method,
> and changing operator*() of the operand-walker to return a MachineOperand&.  At
> that point, it should be possible to add range views for them that work as one
> might expect.

It seems this causes us to miscompile yasm on Windows (which we build
and use as part of Chromium).

I have no idea what's going on yet, but I'm working on a repro.

 - Hans



More information about the llvm-commits mailing list