On 08/06/14 11:19, David Malcolm wrote:
Yet more scaffolding: convert the NEXT_INSN/PREV_INSN macros
and their SET_* variants into functions.

Convert the rvalue-style functions into returning
rtx_insn * rather than plain rtx.

For now, this is done by adding a checked cast, but I hope this can
eventually become a field lookup.  The lvalue forms for now return an rtx&
to allow in-place modification.

gcc/
        * rtl.h (PREV_INSN): Convert to an inline function.  Strengthen
        the return type from rtx to rtx_insn *,  which will enable various
        conversions in followup patches.  For now this is is done by a
        checked cast.
        (NEXT_INSN): Likewise.
        (SET_PREV_INSN): Convert to an inilne function.  This is intended
        for use as an lvalue, and so returns an rtx& to allow in-place
        modification.
        (SET_NEXT_INSN): Likewise.
OK.

FWIW, I do think that after this series is done that we should look very closely at moving those fields out of the rtunion array and just have them first class fields in their classes.

I can see a day where I say foo->uid or foo->next/prev and be exceedingly happy. And if we keep "rtx_real_insn" as a concept, then foo.pattern ;-)

Jeff

Reply via email to