diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2014-08-28 06:22:46 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2014-08-28 06:22:46 +0000 |
commit | fbf3fc0fc96c5542f982b68873e2ff8330f8c0c6 (patch) | |
tree | a0a43ce42a7cbb6a19cb67420d07965ba0a817a8 /gcc/ddg.c | |
parent | a9052a408154a465587aaa7ee4d91f63ad81b60b (diff) | |
download | gcc-fbf3fc0fc96c5542f982b68873e2ff8330f8c0c6.zip gcc-fbf3fc0fc96c5542f982b68873e2ff8330f8c0c6.tar.gz gcc-fbf3fc0fc96c5542f982b68873e2ff8330f8c0c6.tar.bz2 |
ddg.c: Include rtl-iter.h.
gcc/
* ddg.c: Include rtl-iter.h.
(mark_mem_use_1): Rename to...
(mark_mem_use): ...deleting old mark_mem_use. Use FOR_EACH_SUBRTX
instead of for_each_rtx.
(mem_read_insn_p): Update accordingly.
From-SVN: r214632
Diffstat (limited to 'gcc/ddg.c')
-rw-r--r-- | gcc/ddg.c | 22 |
1 files changed, 10 insertions, 12 deletions
@@ -41,6 +41,7 @@ along with GCC; see the file COPYING3. If not see #include "expr.h" #include "bitmap.h" #include "ddg.h" +#include "rtl-iter.h" #ifdef INSN_SCHEDULING @@ -63,19 +64,16 @@ static void add_edge_to_ddg (ddg_ptr g, ddg_edge_ptr); static bool mem_ref_p; /* Auxiliary function for mem_read_insn_p. */ -static int -mark_mem_use (rtx *x, void *data ATTRIBUTE_UNUSED) -{ - if (MEM_P (*x)) - mem_ref_p = true; - return 0; -} - -/* Auxiliary function for mem_read_insn_p. */ static void -mark_mem_use_1 (rtx *x, void *data) +mark_mem_use (rtx *x, void *) { - for_each_rtx (x, mark_mem_use, data); + subrtx_iterator::array_type array; + FOR_EACH_SUBRTX (iter, array, *x, NONCONST) + if (MEM_P (*x)) + { + mem_ref_p = true; + break; + } } /* Returns nonzero if INSN reads from memory. */ @@ -83,7 +81,7 @@ static bool mem_read_insn_p (rtx_insn *insn) { mem_ref_p = false; - note_uses (&PATTERN (insn), mark_mem_use_1, NULL); + note_uses (&PATTERN (insn), mark_mem_use, NULL); return mem_ref_p; } |