New function: for_each_rtx_in_insn
gcc/ 2014-08-18 David Malcolm <dmalcolm@redhat.com> * rtl.h (for_each_rtx_in_insn): New function. * rtlanal.c (for_each_rtx_in_insn): Likewise. From-SVN: r214119
This commit is contained in:
parent
15f8d3ab4a
commit
70e7f57d38
|
@ -1,3 +1,8 @@
|
||||||
|
2014-08-18 David Malcolm <dmalcolm@redhat.com>
|
||||||
|
|
||||||
|
* rtl.h (for_each_rtx_in_insn): New function.
|
||||||
|
* rtlanal.c (for_each_rtx_in_insn): Likewise.
|
||||||
|
|
||||||
2014-08-18 David Malcolm <dmalcolm@redhat.com>
|
2014-08-18 David Malcolm <dmalcolm@redhat.com>
|
||||||
|
|
||||||
* coretypes.h (class rtx_insn): Add forward declaration.
|
* coretypes.h (class rtx_insn): Add forward declaration.
|
||||||
|
|
|
@ -2399,6 +2399,7 @@ extern bool tls_referenced_p (rtx);
|
||||||
|
|
||||||
typedef int (*rtx_function) (rtx *, void *);
|
typedef int (*rtx_function) (rtx *, void *);
|
||||||
extern int for_each_rtx (rtx *, rtx_function, void *);
|
extern int for_each_rtx (rtx *, rtx_function, void *);
|
||||||
|
extern int for_each_rtx_in_insn (rtx_insn **, rtx_function, void *);
|
||||||
|
|
||||||
/* Callback for for_each_inc_dec, to process the autoinc operation OP
|
/* Callback for for_each_inc_dec, to process the autoinc operation OP
|
||||||
within MEM that sets DEST to SRC + SRCOFF, or SRC if SRCOFF is
|
within MEM that sets DEST to SRC + SRCOFF, or SRC if SRCOFF is
|
||||||
|
|
|
@ -3011,6 +3011,22 @@ for_each_rtx (rtx *x, rtx_function f, void *data)
|
||||||
return for_each_rtx_1 (*x, i, f, data);
|
return for_each_rtx_1 (*x, i, f, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Like "for_each_rtx", but for calling on an rtx_insn **. */
|
||||||
|
|
||||||
|
int
|
||||||
|
for_each_rtx_in_insn (rtx_insn **insn, rtx_function f, void *data)
|
||||||
|
{
|
||||||
|
rtx insn_as_rtx = *insn;
|
||||||
|
int result;
|
||||||
|
|
||||||
|
result = for_each_rtx (&insn_as_rtx, f, data);
|
||||||
|
|
||||||
|
if (insn_as_rtx != *insn)
|
||||||
|
*insn = safe_as_a <rtx_insn *> (insn_as_rtx);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Data structure that holds the internal state communicated between
|
/* Data structure that holds the internal state communicated between
|
||||||
|
|
Loading…
Reference in New Issue