]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gimple-walk.h: New File.
authorAndrew Macleod <amacleod@gcc.gnu.org>
Wed, 13 Nov 2013 23:54:17 +0000 (23:54 +0000)
committerAndrew Macleod <amacleod@gcc.gnu.org>
Wed, 13 Nov 2013 23:54:17 +0000 (23:54 +0000)
* gimple-walk.h: New File.  Relocate prototypes from gimple.h.
(struct walk_stmt_info):  Relocate here from gimple.h.
* gimple-iterator.h: New File.  Relocate prototypes from gimple.h.
(struct gimple_stmt_iterator_d): Relocate here from gimple.h.
(gsi_start_1, gsi_none, gsi_start_bb, gsi_last_1, gsi_last_bb,
gsi_end_p, gsi_one_before_end_p, gsi_next, gsi_prev, gsi_stmt,
gsi_after_labels, gsi_next_nondebug, gsi_prev_nondebug,
gsi_start_nondebug_bb, gsi_start_nondebug_after_labels_bb,
gsi_last_nondebug_bb, gsi_bb, gsi_seq): Relocate here from gimple.h.
* gimple.h (struct gimple_stmt_iterator_d): Move to gimple-iterator.h.
(gsi_start_1, gsi_none, gsi_start_bb, gsi_last_1, gsi_last_bb,
gsi_end_p, gsi_one_before_end_p, gsi_next, gsi_prev, gsi_stmt,
gsi_after_labels, gsi_next_nondebug, gsi_prev_nondebug,
gsi_start_nondebug_bb, gsi_start_nondebug_after_labels_bb,
gsi_last_nondebug_bb, gsi_bb, gsi_seq): Move to gimple-iterator.h.
(struct walk_stmt_info): Move to gimple-walk.h.
(gimple_seq_set_location): Move to gimple.c
* gimple-walk.c: New File.
(walk_gimple_seq_mod, walk_gimple_seq, walk_gimple_asm, walk_gimple_op,
walk_gimple_stmt, get_base_loadstore, walk_stmt_load_store_addr_ops,
walk_stmt_load_store_ops): Relocate here from gimple.c.
* gimple-iterator.c: Include gimple-iterator.h.
* gimple.c (walk_gimple_seq_mod, walk_gimple_seq, walk_gimple_asm,
walk_gimple_op, walk_gimple_stmt, get_base_loadstore,
walk_stmt_load_store_addr_ops, walk_stmt_load_store_ops): Move to
gimple-walk.c.
(gimple_seq_set_location): Relocate from gimple.h.
* tree-phinodes.h (set_phi_nodes): Move to tree-phinodes.c.
* tree-phinodes.c (set_phi_nodes): Relocate from tree-phinodes.h.
* gengtype.c (open_base_files): Add gimple-iterator.h to include list.
* Makefile.in (OBJS): Add gimple-walk.o

* asan.c: Update Include list as required for gimple-iterator.h and
gimple-walk.h.
* cfgexpand.c: Likewise.
* cfgloop.c: Likewise.
* cfgloopmanip.c: Likewise.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* cgraphunit.c: Likewise.
* gimple-fold.c: Likewise.
* gimple-low.c: Likewise.
* gimple-pretty-print.c: Likewise.
* gimple-ssa-isolate-paths.c: Likewise.
* gimple-ssa-strength-reduction.c: Likewise.
* gimple-streamer-in.c: Likewise.
* gimple-streamer-out.c: Likewise.
* gimplify.c: Likewise.
* graphite-blocking.c: Likewise.
* graphite-clast-to-gimple.c: Likewise.
* graphite-dependences.c: Likewise.
* graphite-interchange.c: Likewise.
* graphite-optimize-isl.c: Likewise.
* graphite-poly.c: Likewise.
* graphite-scop-detection.c: Likewise.
* graphite-sese-to-poly.c: Likewise.
* graphite.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* ipa-profile.c: Likewise.
* ipa-prop.c: Likewise.
* ipa-pure-const.c: Likewise.
* ipa-split.c: Likewise.
* lto-streamer-in.c: Likewise.
* lto-streamer-out.c: Likewise.
* omp-low.c: Likewise.
* predict.c: Likewise.
* profile.c: Likewise.
* sese.c: Likewise.
* tracer.c: Likewise.
* trans-mem.c: Likewise.
* tree-call-cdce.c: Likewise.
* tree-cfg.c: Likewise.
* tree-cfgcleanup.c: Likewise.
* tree-complex.c: Likewise.
* tree-data-ref.c: Likewise.
* tree-dfa.c: Likewise.
* tree-eh.c: Likewise.
* tree-emutls.c: Likewise.
* tree-if-conv.c: Likewise.
* tree-inline.c: Likewise.
* tree-into-ssa.c: Likewise.
* tree-loop-distribution.c: Likewise.
* tree-nested.c: Likewise.
* tree-nrv.c: Likewise.
* tree-object-size.c: Likewise.
* tree-outof-ssa.c: Likewise.
* tree-parloops.c: Likewise.
* tree-predcom.c: Likewise.
* tree-profile.c: Likewise.
* tree-scalar-evolution.c: Likewise.
* tree-sra.c: Likewise.
* tree-ssa-ccp.c: Likewise.
* tree-ssa-coalesce.c: Likewise.
* tree-ssa-copy.c: Likewise.
* tree-ssa-copyrename.c: Likewise.
* tree-ssa-dce.c: Likewise.
* tree-ssa-dom.c: Likewise.
* tree-ssa-dse.c: Likewise.
* tree-ssa-forwprop.c: Likewise.
* tree-ssa-ifcombine.c: Likewise.
* tree-ssa-live.c: Likewise.
* tree-ssa-loop-ch.c: Likewise.
* tree-ssa-loop-im.c: Likewise.
* tree-ssa-loop-ivcanon.c: Likewise.
* tree-ssa-loop-ivopts.c: Likewise.
* tree-ssa-loop-manip.c: Likewise.
* tree-ssa-loop-niter.c: Likewise.
* tree-ssa-loop-prefetch.c: Likewise.
* tree-ssa-loop.c: Likewise.
* tree-ssa-math-opts.c: Likewise.
* tree-ssa-phiopt.c: Likewise.
* tree-ssa-phiprop.c: Likewise.
* tree-ssa-pre.c: Likewise.
* tree-ssa-propagate.c: Likewise.
* tree-ssa-reassoc.c: Likewise.
* tree-ssa-sink.c: Likewise.
* tree-ssa-strlen.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* tree-ssa-tail-merge.c: Likewise.
* tree-ssa-ter.c: Likewise.
* tree-ssa-threadedge.c: Likewise.
* tree-ssa-threadupdate.c: Likewise.
* tree-ssa-uncprop.c: Likewise.
* tree-ssa-uninit.c: Likewise.
* tree-ssa.c: Likewise.
* tree-stdarg.c: Likewise.
* tree-switch-conversion.c: Likewise.
* tree-tailcall.c: Likewise.
* tree-vect-data-refs.c: Likewise.
* tree-vect-generic.c: Likewise.
* tree-vect-loop-manip.c: Likewise.
* tree-vect-loop.c: Likewise.
* tree-vect-patterns.c: Likewise.
* tree-vect-slp.c: Likewise.
* tree-vect-stmts.c: Likewise.
* tree-vectorizer.c: Likewise.
* tree-vrp.c: Likewise.
* tree.c: Likewise.
* tsan.c: Likewise.
* value-prof.c: Likewise.
* vtable-verify.c: Likewise.

* config/aarch64/aarch64-builtins.c: Include gimple-iterator.h.
* config/rs6000/rs6000.c: Include gimple-iterator.h and gimple-walk.h.
* testsuite/g++.dg/plugin/selfassign.c: Include gimple-iterator.h.
* testsuite/gcc.dg/plugin/selfassign.c: Likewise.

From-SVN: r204763

124 files changed:
gcc/ChangeLog
gcc/Makefile.in
gcc/asan.c
gcc/cfgexpand.c
gcc/cfgloop.c
gcc/cfgloopmanip.c
gcc/cgraph.c
gcc/cgraphbuild.c
gcc/cgraphunit.c
gcc/config/aarch64/aarch64-builtins.c
gcc/config/rs6000/rs6000.c
gcc/gengtype.c
gcc/gimple-fold.c
gcc/gimple-iterator.c
gcc/gimple-iterator.h [new file with mode: 0644]
gcc/gimple-low.c
gcc/gimple-pretty-print.c
gcc/gimple-ssa-isolate-paths.c
gcc/gimple-ssa-strength-reduction.c
gcc/gimple-streamer-in.c
gcc/gimple-streamer-out.c
gcc/gimple-walk.c [new file with mode: 0644]
gcc/gimple-walk.h [new file with mode: 0644]
gcc/gimple.c
gcc/gimple.h
gcc/gimplify.c
gcc/graphite-blocking.c
gcc/graphite-clast-to-gimple.c
gcc/graphite-dependences.c
gcc/graphite-interchange.c
gcc/graphite-optimize-isl.c
gcc/graphite-poly.c
gcc/graphite-scop-detection.c
gcc/graphite-sese-to-poly.c
gcc/graphite.c
gcc/ipa-inline-analysis.c
gcc/ipa-profile.c
gcc/ipa-prop.c
gcc/ipa-pure-const.c
gcc/ipa-split.c
gcc/lto-streamer-in.c
gcc/lto-streamer-out.c
gcc/omp-low.c
gcc/predict.c
gcc/profile.c
gcc/sese.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/plugin/selfassign.c
gcc/testsuite/gcc.dg/plugin/selfassign.c
gcc/tracer.c
gcc/trans-mem.c
gcc/tree-call-cdce.c
gcc/tree-cfg.c
gcc/tree-cfgcleanup.c
gcc/tree-complex.c
gcc/tree-data-ref.c
gcc/tree-dfa.c
gcc/tree-eh.c
gcc/tree-emutls.c
gcc/tree-if-conv.c
gcc/tree-inline.c
gcc/tree-into-ssa.c
gcc/tree-loop-distribution.c
gcc/tree-nested.c
gcc/tree-nrv.c
gcc/tree-object-size.c
gcc/tree-outof-ssa.c
gcc/tree-parloops.c
gcc/tree-phinodes.c
gcc/tree-phinodes.h
gcc/tree-predcom.c
gcc/tree-profile.c
gcc/tree-scalar-evolution.c
gcc/tree-sra.c
gcc/tree-ssa-ccp.c
gcc/tree-ssa-coalesce.c
gcc/tree-ssa-copy.c
gcc/tree-ssa-copyrename.c
gcc/tree-ssa-dce.c
gcc/tree-ssa-dom.c
gcc/tree-ssa-dse.c
gcc/tree-ssa-forwprop.c
gcc/tree-ssa-ifcombine.c
gcc/tree-ssa-live.c
gcc/tree-ssa-loop-ch.c
gcc/tree-ssa-loop-im.c
gcc/tree-ssa-loop-ivcanon.c
gcc/tree-ssa-loop-ivopts.c
gcc/tree-ssa-loop-manip.c
gcc/tree-ssa-loop-niter.c
gcc/tree-ssa-loop-prefetch.c
gcc/tree-ssa-loop.c
gcc/tree-ssa-math-opts.c
gcc/tree-ssa-phiopt.c
gcc/tree-ssa-phiprop.c
gcc/tree-ssa-pre.c
gcc/tree-ssa-propagate.c
gcc/tree-ssa-reassoc.c
gcc/tree-ssa-sink.c
gcc/tree-ssa-strlen.c
gcc/tree-ssa-structalias.c
gcc/tree-ssa-tail-merge.c
gcc/tree-ssa-ter.c
gcc/tree-ssa-threadedge.c
gcc/tree-ssa-threadupdate.c
gcc/tree-ssa-uncprop.c
gcc/tree-ssa-uninit.c
gcc/tree-ssa.c
gcc/tree-stdarg.c
gcc/tree-switch-conversion.c
gcc/tree-tailcall.c
gcc/tree-vect-data-refs.c
gcc/tree-vect-generic.c
gcc/tree-vect-loop-manip.c
gcc/tree-vect-loop.c
gcc/tree-vect-patterns.c
gcc/tree-vect-slp.c
gcc/tree-vect-stmts.c
gcc/tree-vectorizer.c
gcc/tree-vrp.c
gcc/tree.c
gcc/tsan.c
gcc/value-prof.c
gcc/vtable-verify.c

index adc637c7a427b586274965ac92bb1ebcfa535743..a8d9c5bd66aa2cc123ad04788144cdd4085cd317 100644 (file)
@@ -1,3 +1,146 @@
+2013-11-13  Andrew MacLeod  <amacleod@redhat,com>
+
+       * gimple-walk.h: New File.  Relocate prototypes from gimple.h.
+       (struct walk_stmt_info):  Relocate here from gimple.h.
+       * gimple-iterator.h: New File.  Relocate prototypes from gimple.h.
+       (struct gimple_stmt_iterator_d): Relocate here from gimple.h.
+       (gsi_start_1, gsi_none, gsi_start_bb, gsi_last_1, gsi_last_bb,
+       gsi_end_p, gsi_one_before_end_p, gsi_next, gsi_prev, gsi_stmt,
+       gsi_after_labels, gsi_next_nondebug, gsi_prev_nondebug,
+       gsi_start_nondebug_bb, gsi_start_nondebug_after_labels_bb,
+       gsi_last_nondebug_bb, gsi_bb, gsi_seq): Relocate here from gimple.h.
+       * gimple.h (struct gimple_stmt_iterator_d): Move to gimple-iterator.h.
+       (gsi_start_1, gsi_none, gsi_start_bb, gsi_last_1, gsi_last_bb,
+       gsi_end_p, gsi_one_before_end_p, gsi_next, gsi_prev, gsi_stmt,
+       gsi_after_labels, gsi_next_nondebug, gsi_prev_nondebug,
+       gsi_start_nondebug_bb, gsi_start_nondebug_after_labels_bb,
+       gsi_last_nondebug_bb, gsi_bb, gsi_seq): Move to gimple-iterator.h.
+       (struct walk_stmt_info): Move to gimple-walk.h.
+       (gimple_seq_set_location): Move to gimple.c
+       * gimple-walk.c: New File.
+       (walk_gimple_seq_mod, walk_gimple_seq, walk_gimple_asm, walk_gimple_op,
+       walk_gimple_stmt, get_base_loadstore, walk_stmt_load_store_addr_ops,
+       walk_stmt_load_store_ops): Relocate here from gimple.c.
+       * gimple-iterator.c: Include gimple-iterator.h.
+       * gimple.c (walk_gimple_seq_mod, walk_gimple_seq, walk_gimple_asm,
+       walk_gimple_op, walk_gimple_stmt, get_base_loadstore,
+       walk_stmt_load_store_addr_ops, walk_stmt_load_store_ops): Move to
+       gimple-walk.c.
+       (gimple_seq_set_location): Relocate from gimple.h.
+       * tree-phinodes.h (set_phi_nodes): Move to tree-phinodes.c.
+       * tree-phinodes.c (set_phi_nodes): Relocate from tree-phinodes.h.
+       * gengtype.c (open_base_files): Add gimple-iterator.h to include list.
+       * Makefile.in (OBJS): Add gimple-walk.o
+       * asan.c: Update Include list as required for gimple-iterator.h and
+       gimple-walk.h.
+       * cfgexpand.c: Likewise.
+       * cfgloop.c: Likewise.
+       * cfgloopmanip.c: Likewise.
+       * cgraph.c: Likewise.
+       * cgraphbuild.c: Likewise.
+       * cgraphunit.c: Likewise.
+       * gimple-fold.c: Likewise.
+       * gimple-low.c: Likewise.
+       * gimple-pretty-print.c: Likewise.
+       * gimple-ssa-isolate-paths.c: Likewise.
+       * gimple-ssa-strength-reduction.c: Likewise.
+       * gimple-streamer-in.c: Likewise.
+       * gimple-streamer-out.c: Likewise.
+       * gimplify.c: Likewise.
+       * graphite-blocking.c: Likewise.
+       * graphite-clast-to-gimple.c: Likewise.
+       * graphite-dependences.c: Likewise.
+       * graphite-interchange.c: Likewise.
+       * graphite-optimize-isl.c: Likewise.
+       * graphite-poly.c: Likewise.
+       * graphite-scop-detection.c: Likewise.
+       * graphite-sese-to-poly.c: Likewise.
+       * graphite.c: Likewise.
+       * ipa-inline-analysis.c: Likewise.
+       * ipa-profile.c: Likewise.
+       * ipa-prop.c: Likewise.
+       * ipa-pure-const.c: Likewise.
+       * ipa-split.c: Likewise.
+       * lto-streamer-in.c: Likewise.
+       * lto-streamer-out.c: Likewise.
+       * omp-low.c: Likewise.
+       * predict.c: Likewise.
+       * profile.c: Likewise.
+       * sese.c: Likewise.
+       * tracer.c: Likewise.
+       * trans-mem.c: Likewise.
+       * tree-call-cdce.c: Likewise.
+       * tree-cfg.c: Likewise.
+       * tree-cfgcleanup.c: Likewise.
+       * tree-complex.c: Likewise.
+       * tree-data-ref.c: Likewise.
+       * tree-dfa.c: Likewise.
+       * tree-eh.c: Likewise.
+       * tree-emutls.c: Likewise.
+       * tree-if-conv.c: Likewise.
+       * tree-inline.c: Likewise.
+       * tree-into-ssa.c: Likewise.
+       * tree-loop-distribution.c: Likewise.
+       * tree-nested.c: Likewise.
+       * tree-nrv.c: Likewise.
+       * tree-object-size.c: Likewise.
+       * tree-outof-ssa.c: Likewise.
+       * tree-parloops.c: Likewise.
+       * tree-predcom.c: Likewise.
+       * tree-profile.c: Likewise.
+       * tree-scalar-evolution.c: Likewise.
+       * tree-sra.c: Likewise.
+       * tree-ssa-ccp.c: Likewise.
+       * tree-ssa-coalesce.c: Likewise.
+       * tree-ssa-copy.c: Likewise.
+       * tree-ssa-copyrename.c: Likewise.
+       * tree-ssa-dce.c: Likewise.
+       * tree-ssa-dom.c: Likewise.
+       * tree-ssa-dse.c: Likewise.
+       * tree-ssa-forwprop.c: Likewise.
+       * tree-ssa-ifcombine.c: Likewise.
+       * tree-ssa-live.c: Likewise.
+       * tree-ssa-loop-ch.c: Likewise.
+       * tree-ssa-loop-im.c: Likewise.
+       * tree-ssa-loop-ivcanon.c: Likewise.
+       * tree-ssa-loop-ivopts.c: Likewise.
+       * tree-ssa-loop-manip.c: Likewise.
+       * tree-ssa-loop-niter.c: Likewise.
+       * tree-ssa-loop-prefetch.c: Likewise.
+       * tree-ssa-loop.c: Likewise.
+       * tree-ssa-math-opts.c: Likewise.
+       * tree-ssa-phiopt.c: Likewise.
+       * tree-ssa-phiprop.c: Likewise.
+       * tree-ssa-pre.c: Likewise.
+       * tree-ssa-propagate.c: Likewise.
+       * tree-ssa-reassoc.c: Likewise.
+       * tree-ssa-sink.c: Likewise.
+       * tree-ssa-strlen.c: Likewise.
+       * tree-ssa-structalias.c: Likewise.
+       * tree-ssa-tail-merge.c: Likewise.
+       * tree-ssa-ter.c: Likewise.
+       * tree-ssa-threadedge.c: Likewise.
+       * tree-ssa-threadupdate.c: Likewise.
+       * tree-ssa-uncprop.c: Likewise.
+       * tree-ssa-uninit.c: Likewise.
+       * tree-ssa.c: Likewise.
+       * tree-stdarg.c: Likewise.
+       * tree-switch-conversion.c: Likewise.
+       * tree-tailcall.c: Likewise.
+       * tree-vect-data-refs.c: Likewise.
+       * tree-vect-generic.c: Likewise.
+       * tree-vect-loop-manip.c: Likewise.
+       * tree-vect-loop.c: Likewise.
+       * tree-vect-patterns.c: Likewise.
+       * tree-vect-slp.c: Likewise.
+       * tree-vect-stmts.c: Likewise.
+       * tree-vectorizer.c: Likewise.
+       * tree-vrp.c: Likewise.
+       * tree.c: Likewise.
+       * tsan.c: Likewise.
+       * value-prof.c: Likewise.
+       * vtable-verify.c: Likewise.
+
 2013-11-13  Steven Bosscher  <steven@gcc.gnu.org>
 
        * gimple-ssa-isolate-paths.c (pass_isolate_erroneous_paths): Comment
index 031446be5ea625bd2df96bc268b3c0ee63aad735..2987506e2983e011a3d8d96903e812ef0331f07c 100644 (file)
@@ -1240,6 +1240,7 @@ OBJS = \
        gimple-ssa-strength-reduction.o \
        gimple-streamer-in.o \
        gimple-streamer-out.o \
+       gimple-walk.o \
        gimplify.o \
        godump.o \
        graph.o \
index 59e26397cb1a434c3ccd29d724c8a6c8aa75ce0a..9b6f96872ec87c2ec738b407acfed34ddf9e8ebc 100644 (file)
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "tree-iterator.h"
 #include "cgraph.h"
 #include "tree-ssanames.h"
index de7a7b3fb0bd23f082cf7e377237569f8a1f66da..9b480a247bbf671522162498781b5cb48192ada2 100644 (file)
@@ -31,6 +31,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks.h"
 #include "bitmap.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "gimple-ssa.h"
 #include "cgraph.h"
 #include "tree-cfg.h"
index 3ff8e841bac098f669eb89017a9faaa3e8faca0e..01f250a1519d3ee5b27a66234194022745c74347 100644 (file)
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "flags.h"
 #include "tree.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "pointer-set.h"
 #include "ggc.h"
index 131c2a043dc0716feaa4f92b630a78acfce7ffeb..6448605823b0bc35412c02937f67f767946a320a 100644 (file)
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "cfgloop.h"
 #include "tree.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "tree-ssa-loop-manip.h"
 #include "dumpfile.h"
 
index b7ec16655f564764a8071864494b6b7c5edc3bec..2841055635f4b19cbad36fe9ca0d6e55a6a190b4 100644 (file)
@@ -40,6 +40,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "cgraph.h"
 #include "intl.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "timevar.h"
 #include "dumpfile.h"
 #include "gimple-ssa.h"
index 21ad0ab2ab68e5f44d1764d50f0a5964f0cab616..7834b065d529d1129c9d80b085ac693e4fc39b91 100644 (file)
@@ -24,6 +24,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "langhooks.h"
 #include "pointer-set.h"
 #include "intl.h"
index 4765e6abb44bf4e65d3e4bfa236321df5b6c5117..51961fc7a792d57b4ba0f3be53e3d859e9cf9d7a 100644 (file)
@@ -165,6 +165,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "output.h"
 #include "rtl.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-into-ssa.h"
index 0df5b3b0d776cecabdc408f12fb3bbd99f3c3a5c..2f1a8d03cb16ab50c045868bb6530524fdcbb27e 100644 (file)
@@ -31,6 +31,7 @@
 #include "diagnostic-core.h"
 #include "optabs.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 
 enum aarch64_simd_builtin_type_mode
 {
index 33547c41dd60b4e293687a519ef55ac2cf70a4c3..c6faa40bf24ac664543f4e0eb22db8197946cc51 100644 (file)
@@ -52,6 +52,8 @@
 #include "cfgloop.h"
 #include "sched-int.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "intl.h"
 #include "params.h"
 #include "tm-constrs.h"
index f35952e5a55583bc8587dc84804ea48f172f6458..ecf1ef00385a7638b0050acff8e8144ca630970b 100644 (file)
@@ -1769,9 +1769,9 @@ open_base_files (void)
       "tree.h", "rtl.h", "function.h", "insn-config.h", "expr.h",
       "hard-reg-set.h", "basic-block.h", "cselib.h", "insn-addr.h",
       "optabs.h", "libfuncs.h", "debug.h", "ggc.h", "cgraph.h",
-      "gimple.h", "gimple-ssa.h", "tree-cfg.h", "tree-phinodes.h",
-      "ssa-iterators.h", "tree-ssanames.h", "tree-ssa-loop.h",
-      "tree-ssa-loop-ivopts.h", "tree-ssa-loop-manip.h",
+      "gimple.h", "gimple-iterator.h", "gimple-ssa.h", "tree-cfg.h",
+      "tree-phinodes.h", "ssa-iterators.h", "tree-ssanames.h",
+      "tree-ssa-loop.h", "tree-ssa-loop-ivopts.h", "tree-ssa-loop-manip.h",
       "tree-ssa-loop-niter.h", "tree-into-ssa.h", "tree-dfa.h", 
       "tree-ssa.h", "reload.h", "cpp-id-data.h", "tree-chrec.h",
       "except.h", "output.h",  "cfgloop.h",
index 1cf8965b7f2d5bc5c16f0ce4655a01da4c4a46ff..f66d3e79e192c6a067c6fbae7e27c864fcf8c287 100644 (file)
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "dumpfile.h"
 #include "bitmap.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-ssanames.h"
 #include "tree-into-ssa.h"
index e430050fcf76f65181de8073df1108061c947347..b945389289103f082cf9649f8273a4070816e819 100644 (file)
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "cgraph.h"
 #include "tree-cfg.h"
diff --git a/gcc/gimple-iterator.h b/gcc/gimple-iterator.h
new file mode 100644 (file)
index 0000000..a9360fd
--- /dev/null
@@ -0,0 +1,288 @@
+/* Header file for gimple iterators.
+   Copyright (C) 2013 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef GCC_GIMPLE_ITERATOR_H
+#define GCC_GIMPLE_ITERATOR_H
+
+/* Iterator object for GIMPLE statement sequences.  */
+
+typedef struct gimple_stmt_iterator_d
+{
+  /* Sequence node holding the current statement.  */
+  gimple_seq_node ptr;
+
+  /* Sequence and basic block holding the statement.  These fields
+     are necessary to handle edge cases such as when statement is
+     added to an empty basic block or when the last statement of a
+     block/sequence is removed.  */
+  gimple_seq *seq;
+  basic_block bb;
+} gimple_stmt_iterator;
+extern void gsi_insert_seq_before_without_update (gimple_stmt_iterator *,
+                                                 gimple_seq,
+                                                 enum gsi_iterator_update);
+extern void gsi_insert_seq_before (gimple_stmt_iterator *, gimple_seq,
+                                  enum gsi_iterator_update);
+extern void gsi_insert_seq_after_without_update (gimple_stmt_iterator *,
+                                                gimple_seq,
+                                                enum gsi_iterator_update);
+extern void gsi_insert_seq_after (gimple_stmt_iterator *, gimple_seq,
+                                 enum gsi_iterator_update);
+extern gimple_seq gsi_split_seq_after (gimple_stmt_iterator);
+extern void gsi_set_stmt (gimple_stmt_iterator *, gimple);
+extern void gsi_split_seq_before (gimple_stmt_iterator *, gimple_seq *);
+extern void gsi_replace (gimple_stmt_iterator *, gimple, bool);
+extern void gsi_replace_with_seq (gimple_stmt_iterator *, gimple_seq, bool);
+extern void gsi_insert_before_without_update (gimple_stmt_iterator *, gimple,
+                                             enum gsi_iterator_update);
+extern void gsi_insert_before (gimple_stmt_iterator *, gimple,
+                              enum gsi_iterator_update);
+extern void gsi_insert_after_without_update (gimple_stmt_iterator *, gimple,
+                                            enum gsi_iterator_update);
+extern void gsi_insert_after (gimple_stmt_iterator *, gimple,
+                             enum gsi_iterator_update);
+extern bool gsi_remove (gimple_stmt_iterator *, bool);
+extern gimple_stmt_iterator gsi_for_stmt (gimple);
+extern void gsi_move_after (gimple_stmt_iterator *, gimple_stmt_iterator *);
+extern void gsi_move_before (gimple_stmt_iterator *, gimple_stmt_iterator *);
+extern void gsi_move_to_bb_end (gimple_stmt_iterator *, basic_block);
+extern void gsi_insert_on_edge (edge, gimple);
+extern void gsi_insert_seq_on_edge (edge, gimple_seq);
+extern basic_block gsi_insert_on_edge_immediate (edge, gimple);
+extern basic_block gsi_insert_seq_on_edge_immediate (edge, gimple_seq);
+extern void gsi_commit_edge_inserts (void);
+extern void gsi_commit_one_edge_insert (edge, basic_block *);
+extern gimple_stmt_iterator gsi_start_phis (basic_block);
+
+/* Return a new iterator pointing to GIMPLE_SEQ's first statement.  */
+
+static inline gimple_stmt_iterator
+gsi_start_1 (gimple_seq *seq)
+{
+  gimple_stmt_iterator i;
+
+  i.ptr = gimple_seq_first (*seq);
+  i.seq = seq;
+  i.bb = i.ptr ? gimple_bb (i.ptr) : NULL;
+
+  return i;
+}
+
+#define gsi_start(x) gsi_start_1 (&(x))
+
+static inline gimple_stmt_iterator
+gsi_none (void)
+{
+  gimple_stmt_iterator i;
+  i.ptr = NULL;
+  i.seq = NULL;
+  i.bb = NULL;
+  return i;
+}
+
+/* Return a new iterator pointing to the first statement in basic block BB.  */
+
+static inline gimple_stmt_iterator
+gsi_start_bb (basic_block bb)
+{
+  gimple_stmt_iterator i;
+  gimple_seq *seq;
+
+  seq = bb_seq_addr (bb);
+  i.ptr = gimple_seq_first (*seq);
+  i.seq = seq;
+  i.bb = bb;
+
+  return i;
+}
+
+/* Return a new iterator initially pointing to GIMPLE_SEQ's last statement.  */
+
+static inline gimple_stmt_iterator
+gsi_last_1 (gimple_seq *seq)
+{
+  gimple_stmt_iterator i;
+
+  i.ptr = gimple_seq_last (*seq);
+  i.seq = seq;
+  i.bb = i.ptr ? gimple_bb (i.ptr) : NULL;
+
+  return i;
+}
+
+#define gsi_last(x) gsi_last_1 (&(x))
+
+/* Return a new iterator pointing to the last statement in basic block BB.  */
+
+static inline gimple_stmt_iterator
+gsi_last_bb (basic_block bb)
+{
+  gimple_stmt_iterator i;
+  gimple_seq *seq;
+
+  seq = bb_seq_addr (bb);
+  i.ptr = gimple_seq_last (*seq);
+  i.seq = seq;
+  i.bb = bb;
+
+  return i;
+}
+
+/* Return true if I is at the end of its sequence.  */
+
+static inline bool
+gsi_end_p (gimple_stmt_iterator i)
+{
+  return i.ptr == NULL;
+}
+
+/* Return true if I is one statement before the end of its sequence.  */
+
+static inline bool
+gsi_one_before_end_p (gimple_stmt_iterator i)
+{
+  return i.ptr != NULL && i.ptr->gsbase.next == NULL;
+}
+
+/* Advance the iterator to the next gimple statement.  */
+
+static inline void
+gsi_next (gimple_stmt_iterator *i)
+{
+  i->ptr = i->ptr->gsbase.next;
+}
+
+/* Advance the iterator to the previous gimple statement.  */
+
+static inline void
+gsi_prev (gimple_stmt_iterator *i)
+{
+  gimple prev = i->ptr->gsbase.prev;
+  if (prev->gsbase.next)
+    i->ptr = prev;
+  else
+    i->ptr = NULL;
+}
+
+/* Return the current stmt.  */
+
+static inline gimple
+gsi_stmt (gimple_stmt_iterator i)
+{
+  return i.ptr;
+}
+
+/* Return a block statement iterator that points to the first non-label
+   statement in block BB.  */
+
+static inline gimple_stmt_iterator
+gsi_after_labels (basic_block bb)
+{
+  gimple_stmt_iterator gsi = gsi_start_bb (bb);
+
+  while (!gsi_end_p (gsi) && gimple_code (gsi_stmt (gsi)) == GIMPLE_LABEL)
+    gsi_next (&gsi);
+
+  return gsi;
+}
+
+/* Advance the iterator to the next non-debug gimple statement.  */
+
+static inline void
+gsi_next_nondebug (gimple_stmt_iterator *i)
+{
+  do
+    {
+      gsi_next (i);
+    }
+  while (!gsi_end_p (*i) && is_gimple_debug (gsi_stmt (*i)));
+}
+
+/* Advance the iterator to the next non-debug gimple statement.  */
+
+static inline void
+gsi_prev_nondebug (gimple_stmt_iterator *i)
+{
+  do
+    {
+      gsi_prev (i);
+    }
+  while (!gsi_end_p (*i) && is_gimple_debug (gsi_stmt (*i)));
+}
+
+/* Return a new iterator pointing to the first non-debug statement in
+   basic block BB.  */
+
+static inline gimple_stmt_iterator
+gsi_start_nondebug_bb (basic_block bb)
+{
+  gimple_stmt_iterator i = gsi_start_bb (bb);
+
+  if (!gsi_end_p (i) && is_gimple_debug (gsi_stmt (i)))
+    gsi_next_nondebug (&i);
+
+  return i;
+}
+
+/* Return a new iterator pointing to the first non-debug non-label statement in
+   basic block BB.  */
+
+static inline gimple_stmt_iterator
+gsi_start_nondebug_after_labels_bb (basic_block bb)
+{
+  gimple_stmt_iterator i = gsi_after_labels (bb);
+
+  if (!gsi_end_p (i) && is_gimple_debug (gsi_stmt (i)))
+    gsi_next_nondebug (&i);
+
+  return i;
+}
+
+/* Return a new iterator pointing to the last non-debug statement in
+   basic block BB.  */
+
+static inline gimple_stmt_iterator
+gsi_last_nondebug_bb (basic_block bb)
+{
+  gimple_stmt_iterator i = gsi_last_bb (bb);
+
+  if (!gsi_end_p (i) && is_gimple_debug (gsi_stmt (i)))
+    gsi_prev_nondebug (&i);
+
+  return i;
+}
+
+/* Return the basic block associated with this iterator.  */
+
+static inline basic_block
+gsi_bb (gimple_stmt_iterator i)
+{
+  return i.bb;
+}
+
+/* Return the sequence associated with this iterator.  */
+
+static inline gimple_seq
+gsi_seq (gimple_stmt_iterator i)
+{
+  return *i.seq;
+}
+
+#endif /* GCC_GIMPLE_ITERATOR_H */
index d527d86ab22c078a653f9c3154aff7fb319601c5..519e984da28f069437c5b7e97848157f38f193f3 100644 (file)
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "tree-iterator.h"
 #include "tree-inline.h"
 #include "flags.h"
index 6842213199af8f1edcdce0176587aaee08b6f130..86c2a55c216cf101e9750193d72707b9a32a9f10 100644 (file)
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "hashtab.h"
 #include "bitmap.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "cgraph.h"
 #include "tree-cfg.h"
index ddce01438e607e8d3a659b226d6825ebd2697f7f..f9bb249436f491f01bff78712108d483f3400b5c 100644 (file)
@@ -27,6 +27,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "flags.h"
 #include "basic-block.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "tree-ssa.h"
 #include "tree-ssanames.h"
 #include "gimple-ssa.h"
index 41f24cc03e59901a52208d66453f90d0cc9ff1c9..35a725054bdfcdb20d90f51b586a4412ec43a90f 100644 (file)
@@ -38,6 +38,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "basic-block.h"
 #include "tree-pass.h"
 #include "cfgloop.h"
index 2dae1e43c0c6dfdbcdc6e1b0261fc3b3aa351e94..6f8f51a18cee220be4fc8b53349dc011203a2ace 100644 (file)
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "diagnostic.h"
 #include "tree.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-phinodes.h"
 #include "tree-ssanames.h"
index e7430a682340c4a062bf49d4de344acbc42f244c..4d0664f3d98e4d002dafd8d097d78abfa04fc0d7 100644 (file)
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "data-streamer.h"
 #include "gimple-streamer.h"
diff --git a/gcc/gimple-walk.c b/gcc/gimple-walk.c
new file mode 100644 (file)
index 0000000..deb4673
--- /dev/null
@@ -0,0 +1,871 @@
+/* Gimple walk support.
+
+   Copyright (C) 2007-2013 Free Software Foundation, Inc.
+   Contributed by Aldy Hernandez <aldyh@redhat.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "tree.h"
+#include "gimple.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
+#include "gimple-walk.h"
+#include "demangle.h"
+
+/* Walk all the statements in the sequence *PSEQ calling walk_gimple_stmt
+   on each one.  WI is as in walk_gimple_stmt.
+
+   If walk_gimple_stmt returns non-NULL, the walk is stopped, and the
+   value is stored in WI->CALLBACK_RESULT.  Also, the statement that
+   produced the value is returned if this statement has not been
+   removed by a callback (wi->removed_stmt).  If the statement has
+   been removed, NULL is returned.
+
+   Otherwise, all the statements are walked and NULL returned.  */
+
+gimple
+walk_gimple_seq_mod (gimple_seq *pseq, walk_stmt_fn callback_stmt,
+                    walk_tree_fn callback_op, struct walk_stmt_info *wi)
+{
+  gimple_stmt_iterator gsi;
+
+  for (gsi = gsi_start (*pseq); !gsi_end_p (gsi); )
+    {
+      tree ret = walk_gimple_stmt (&gsi, callback_stmt, callback_op, wi);
+      if (ret)
+       {
+         /* If CALLBACK_STMT or CALLBACK_OP return a value, WI must exist
+            to hold it.  */
+         gcc_assert (wi);
+         wi->callback_result = ret;
+
+         return wi->removed_stmt ? NULL : gsi_stmt (gsi);
+       }
+
+      if (!wi->removed_stmt)
+       gsi_next (&gsi);
+    }
+
+  if (wi)
+    wi->callback_result = NULL_TREE;
+
+  return NULL;
+}
+
+
+/* Like walk_gimple_seq_mod, but ensure that the head of SEQ isn't
+   changed by the callbacks.  */
+
+gimple
+walk_gimple_seq (gimple_seq seq, walk_stmt_fn callback_stmt,
+                walk_tree_fn callback_op, struct walk_stmt_info *wi)
+{
+  gimple_seq seq2 = seq;
+  gimple ret = walk_gimple_seq_mod (&seq2, callback_stmt, callback_op, wi);
+  gcc_assert (seq2 == seq);
+  return ret;
+}
+
+
+/* Helper function for walk_gimple_stmt.  Walk operands of a GIMPLE_ASM.  */
+
+static tree
+walk_gimple_asm (gimple stmt, walk_tree_fn callback_op,
+                struct walk_stmt_info *wi)
+{
+  tree ret, op;
+  unsigned noutputs;
+  const char **oconstraints;
+  unsigned i, n;
+  const char *constraint;
+  bool allows_mem, allows_reg, is_inout;
+
+  noutputs = gimple_asm_noutputs (stmt);
+  oconstraints = (const char **) alloca ((noutputs) * sizeof (const char *));
+
+  if (wi)
+    wi->is_lhs = true;
+
+  for (i = 0; i < noutputs; i++)
+    {
+      op = gimple_asm_output_op (stmt, i);
+      constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (op)));
+      oconstraints[i] = constraint;
+      parse_output_constraint (&constraint, i, 0, 0, &allows_mem, &allows_reg,
+                              &is_inout);
+      if (wi)
+       wi->val_only = (allows_reg || !allows_mem);
+      ret = walk_tree (&TREE_VALUE (op), callback_op, wi, NULL);
+      if (ret)
+       return ret;
+    }
+
+  n = gimple_asm_ninputs (stmt);
+  for (i = 0; i < n; i++)
+    {
+      op = gimple_asm_input_op (stmt, i);
+      constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (op)));
+      parse_input_constraint (&constraint, 0, 0, noutputs, 0,
+                             oconstraints, &allows_mem, &allows_reg);
+      if (wi)
+       {
+         wi->val_only = (allows_reg || !allows_mem);
+          /* Although input "m" is not really a LHS, we need a lvalue.  */
+         wi->is_lhs = !wi->val_only;
+       }
+      ret = walk_tree (&TREE_VALUE (op), callback_op, wi, NULL);
+      if (ret)
+       return ret;
+    }
+
+  if (wi)
+    {
+      wi->is_lhs = false;
+      wi->val_only = true;
+    }
+
+  n = gimple_asm_nlabels (stmt);
+  for (i = 0; i < n; i++)
+    {
+      op = gimple_asm_label_op (stmt, i);
+      ret = walk_tree (&TREE_VALUE (op), callback_op, wi, NULL);
+      if (ret)
+       return ret;
+    }
+
+  return NULL_TREE;
+}
+
+
+/* Helper function of WALK_GIMPLE_STMT.  Walk every tree operand in
+   STMT.  CALLBACK_OP and WI are as in WALK_GIMPLE_STMT.
+
+   CALLBACK_OP is called on each operand of STMT via walk_tree.
+   Additional parameters to walk_tree must be stored in WI.  For each operand
+   OP, walk_tree is called as:
+
+       walk_tree (&OP, CALLBACK_OP, WI, WI->PSET)
+
+   If CALLBACK_OP returns non-NULL for an operand, the remaining
+   operands are not scanned.
+
+   The return value is that returned by the last call to walk_tree, or
+   NULL_TREE if no CALLBACK_OP is specified.  */
+
+tree
+walk_gimple_op (gimple stmt, walk_tree_fn callback_op,
+               struct walk_stmt_info *wi)
+{
+  struct pointer_set_t *pset = (wi) ? wi->pset : NULL;
+  unsigned i;
+  tree ret = NULL_TREE;
+
+  switch (gimple_code (stmt))
+    {
+    case GIMPLE_ASSIGN:
+      /* Walk the RHS operands.  If the LHS is of a non-renamable type or
+         is a register variable, we may use a COMPONENT_REF on the RHS.  */
+      if (wi)
+       {
+         tree lhs = gimple_assign_lhs (stmt);
+         wi->val_only
+           = (is_gimple_reg_type (TREE_TYPE (lhs)) && !is_gimple_reg (lhs))
+             || gimple_assign_rhs_class (stmt) != GIMPLE_SINGLE_RHS;
+       }
+
+      for (i = 1; i < gimple_num_ops (stmt); i++)
+       {
+         ret = walk_tree (gimple_op_ptr (stmt, i), callback_op, wi,
+                          pset);
+         if (ret)
+           return ret;
+       }
+
+      /* Walk the LHS.  If the RHS is appropriate for a memory, we
+        may use a COMPONENT_REF on the LHS.  */
+      if (wi)
+       {
+          /* If the RHS is of a non-renamable type or is a register variable,
+            we may use a COMPONENT_REF on the LHS.  */
+         tree rhs1 = gimple_assign_rhs1 (stmt);
+         wi->val_only
+           = (is_gimple_reg_type (TREE_TYPE (rhs1)) && !is_gimple_reg (rhs1))
+             || gimple_assign_rhs_class (stmt) != GIMPLE_SINGLE_RHS;
+         wi->is_lhs = true;
+       }
+
+      ret = walk_tree (gimple_op_ptr (stmt, 0), callback_op, wi, pset);
+      if (ret)
+       return ret;
+
+      if (wi)
+       {
+         wi->val_only = true;
+         wi->is_lhs = false;
+       }
+      break;
+
+    case GIMPLE_CALL:
+      if (wi)
+       {
+         wi->is_lhs = false;
+         wi->val_only = true;
+       }
+
+      ret = walk_tree (gimple_call_chain_ptr (stmt), callback_op, wi, pset);
+      if (ret)
+        return ret;
+
+      ret = walk_tree (gimple_call_fn_ptr (stmt), callback_op, wi, pset);
+      if (ret)
+        return ret;
+
+      for (i = 0; i < gimple_call_num_args (stmt); i++)
+       {
+         if (wi)
+           wi->val_only
+             = is_gimple_reg_type (TREE_TYPE (gimple_call_arg (stmt, i)));
+         ret = walk_tree (gimple_call_arg_ptr (stmt, i), callback_op, wi,
+                          pset);
+         if (ret)
+           return ret;
+       }
+
+      if (gimple_call_lhs (stmt))
+       {
+         if (wi)
+           {
+             wi->is_lhs = true;
+             wi->val_only
+               = is_gimple_reg_type (TREE_TYPE (gimple_call_lhs (stmt)));
+           }
+
+         ret = walk_tree (gimple_call_lhs_ptr (stmt), callback_op, wi, pset);
+         if (ret)
+           return ret;
+       }
+
+      if (wi)
+       {
+         wi->is_lhs = false;
+         wi->val_only = true;
+       }
+      break;
+
+    case GIMPLE_CATCH:
+      ret = walk_tree (gimple_catch_types_ptr (stmt), callback_op, wi,
+                      pset);
+      if (ret)
+       return ret;
+      break;
+
+    case GIMPLE_EH_FILTER:
+      ret = walk_tree (gimple_eh_filter_types_ptr (stmt), callback_op, wi,
+                      pset);
+      if (ret)
+       return ret;
+      break;
+
+    case GIMPLE_ASM:
+      ret = walk_gimple_asm (stmt, callback_op, wi);
+      if (ret)
+       return ret;
+      break;
+
+    case GIMPLE_OMP_CONTINUE:
+      ret = walk_tree (gimple_omp_continue_control_def_ptr (stmt),
+                      callback_op, wi, pset);
+      if (ret)
+       return ret;
+
+      ret = walk_tree (gimple_omp_continue_control_use_ptr (stmt),
+                      callback_op, wi, pset);
+      if (ret)
+       return ret;
+      break;
+
+    case GIMPLE_OMP_CRITICAL:
+      ret = walk_tree (gimple_omp_critical_name_ptr (stmt), callback_op, wi,
+                      pset);
+      if (ret)
+       return ret;
+      break;
+
+    case GIMPLE_OMP_FOR:
+      ret = walk_tree (gimple_omp_for_clauses_ptr (stmt), callback_op, wi,
+                      pset);
+      if (ret)
+       return ret;
+      for (i = 0; i < gimple_omp_for_collapse (stmt); i++)
+       {
+         ret = walk_tree (gimple_omp_for_index_ptr (stmt, i), callback_op,
+                          wi, pset);
+         if (ret)
+           return ret;
+         ret = walk_tree (gimple_omp_for_initial_ptr (stmt, i), callback_op,
+                          wi, pset);
+         if (ret)
+           return ret;
+         ret = walk_tree (gimple_omp_for_final_ptr (stmt, i), callback_op,
+                          wi, pset);
+         if (ret)
+           return ret;
+         ret = walk_tree (gimple_omp_for_incr_ptr (stmt, i), callback_op,
+                          wi, pset);
+       }
+      if (ret)
+       return ret;
+      break;
+
+    case GIMPLE_OMP_PARALLEL:
+      ret = walk_tree (gimple_omp_parallel_clauses_ptr (stmt), callback_op,
+                      wi, pset);
+      if (ret)
+       return ret;
+      ret = walk_tree (gimple_omp_parallel_child_fn_ptr (stmt), callback_op,
+                      wi, pset);
+      if (ret)
+       return ret;
+      ret = walk_tree (gimple_omp_parallel_data_arg_ptr (stmt), callback_op,
+                      wi, pset);
+      if (ret)
+       return ret;
+      break;
+
+    case GIMPLE_OMP_TASK:
+      ret = walk_tree (gimple_omp_task_clauses_ptr (stmt), callback_op,
+                      wi, pset);
+      if (ret)
+       return ret;
+      ret = walk_tree (gimple_omp_task_child_fn_ptr (stmt), callback_op,
+                      wi, pset);
+      if (ret)
+       return ret;
+      ret = walk_tree (gimple_omp_task_data_arg_ptr (stmt), callback_op,
+                      wi, pset);
+      if (ret)
+       return ret;
+      ret = walk_tree (gimple_omp_task_copy_fn_ptr (stmt), callback_op,
+                      wi, pset);
+      if (ret)
+       return ret;
+      ret = walk_tree (gimple_omp_task_arg_size_ptr (stmt), callback_op,
+                      wi, pset);
+      if (ret)
+       return ret;
+      ret = walk_tree (gimple_omp_task_arg_align_ptr (stmt), callback_op,
+                      wi, pset);
+      if (ret)
+       return ret;
+      break;
+
+    case GIMPLE_OMP_SECTIONS:
+      ret = walk_tree (gimple_omp_sections_clauses_ptr (stmt), callback_op,
+                      wi, pset);
+      if (ret)
+       return ret;
+
+      ret = walk_tree (gimple_omp_sections_control_ptr (stmt), callback_op,
+                      wi, pset);
+      if (ret)
+       return ret;
+
+      break;
+
+    case GIMPLE_OMP_SINGLE:
+      ret = walk_tree (gimple_omp_single_clauses_ptr (stmt), callback_op, wi,
+                      pset);
+      if (ret)
+       return ret;
+      break;
+
+    case GIMPLE_OMP_TARGET:
+      ret = walk_tree (gimple_omp_target_clauses_ptr (stmt), callback_op, wi,
+                      pset);
+      if (ret)
+       return ret;
+      break;
+
+    case GIMPLE_OMP_TEAMS:
+      ret = walk_tree (gimple_omp_teams_clauses_ptr (stmt), callback_op, wi,
+                      pset);
+      if (ret)
+       return ret;
+      break;
+
+    case GIMPLE_OMP_ATOMIC_LOAD:
+      ret = walk_tree (gimple_omp_atomic_load_lhs_ptr (stmt), callback_op, wi,
+                      pset);
+      if (ret)
+       return ret;
+
+      ret = walk_tree (gimple_omp_atomic_load_rhs_ptr (stmt), callback_op, wi,
+                      pset);
+      if (ret)
+       return ret;
+      break;
+
+    case GIMPLE_OMP_ATOMIC_STORE:
+      ret = walk_tree (gimple_omp_atomic_store_val_ptr (stmt), callback_op,
+                      wi, pset);
+      if (ret)
+       return ret;
+      break;
+
+    case GIMPLE_TRANSACTION:
+      ret = walk_tree (gimple_transaction_label_ptr (stmt), callback_op,
+                      wi, pset);
+      if (ret)
+       return ret;
+      break;
+
+    case GIMPLE_OMP_RETURN:
+      ret = walk_tree (gimple_omp_return_lhs_ptr (stmt), callback_op, wi,
+                      pset);
+      if (ret)
+       return ret;
+      break;
+
+      /* Tuples that do not have operands.  */
+    case GIMPLE_NOP:
+    case GIMPLE_RESX:
+    case GIMPLE_PREDICT:
+      break;
+
+    default:
+      {
+       enum gimple_statement_structure_enum gss;
+       gss = gimple_statement_structure (stmt);
+       if (gss == GSS_WITH_OPS || gss == GSS_WITH_MEM_OPS)
+         for (i = 0; i < gimple_num_ops (stmt); i++)
+           {
+             ret = walk_tree (gimple_op_ptr (stmt, i), callback_op, wi, pset);
+             if (ret)
+               return ret;
+           }
+      }
+      break;
+    }
+
+  return NULL_TREE;
+}
+
+
+/* Walk the current statement in GSI (optionally using traversal state
+   stored in WI).  If WI is NULL, no state is kept during traversal.
+   The callback CALLBACK_STMT is called.  If CALLBACK_STMT indicates
+   that it has handled all the operands of the statement, its return
+   value is returned.  Otherwise, the return value from CALLBACK_STMT
+   is discarded and its operands are scanned.
+
+   If CALLBACK_STMT is NULL or it didn't handle the operands,
+   CALLBACK_OP is called on each operand of the statement via
+   walk_gimple_op.  If walk_gimple_op returns non-NULL for any
+   operand, the remaining operands are not scanned.  In this case, the
+   return value from CALLBACK_OP is returned.
+
+   In any other case, NULL_TREE is returned.  */
+
+tree
+walk_gimple_stmt (gimple_stmt_iterator *gsi, walk_stmt_fn callback_stmt,
+                 walk_tree_fn callback_op, struct walk_stmt_info *wi)
+{
+  gimple ret;
+  tree tree_ret;
+  gimple stmt = gsi_stmt (*gsi);
+
+  if (wi)
+    {
+      wi->gsi = *gsi;
+      wi->removed_stmt = false;
+
+      if (wi->want_locations && gimple_has_location (stmt))
+       input_location = gimple_location (stmt);
+    }
+
+  ret = NULL;
+
+  /* Invoke the statement callback.  Return if the callback handled
+     all of STMT operands by itself.  */
+  if (callback_stmt)
+    {
+      bool handled_ops = false;
+      tree_ret = callback_stmt (gsi, &handled_ops, wi);
+      if (handled_ops)
+       return tree_ret;
+
+      /* If CALLBACK_STMT did not handle operands, it should not have
+        a value to return.  */
+      gcc_assert (tree_ret == NULL);
+
+      if (wi && wi->removed_stmt)
+       return NULL;
+
+      /* Re-read stmt in case the callback changed it.  */
+      stmt = gsi_stmt (*gsi);
+    }
+
+  /* If CALLBACK_OP is defined, invoke it on every operand of STMT.  */
+  if (callback_op)
+    {
+      tree_ret = walk_gimple_op (stmt, callback_op, wi);
+      if (tree_ret)
+       return tree_ret;
+    }
+
+  /* If STMT can have statements inside (e.g. GIMPLE_BIND), walk them.  */
+  switch (gimple_code (stmt))
+    {
+    case GIMPLE_BIND:
+      ret = walk_gimple_seq_mod (gimple_bind_body_ptr (stmt), callback_stmt,
+                                callback_op, wi);
+      if (ret)
+       return wi->callback_result;
+      break;
+
+    case GIMPLE_CATCH:
+      ret = walk_gimple_seq_mod (gimple_catch_handler_ptr (stmt), callback_stmt,
+                                callback_op, wi);
+      if (ret)
+       return wi->callback_result;
+      break;
+
+    case GIMPLE_EH_FILTER:
+      ret = walk_gimple_seq_mod (gimple_eh_filter_failure_ptr (stmt), callback_stmt,
+                            callback_op, wi);
+      if (ret)
+       return wi->callback_result;
+      break;
+
+    case GIMPLE_EH_ELSE:
+      ret = walk_gimple_seq_mod (gimple_eh_else_n_body_ptr (stmt),
+                            callback_stmt, callback_op, wi);
+      if (ret)
+       return wi->callback_result;
+      ret = walk_gimple_seq_mod (gimple_eh_else_e_body_ptr (stmt),
+                            callback_stmt, callback_op, wi);
+      if (ret)
+       return wi->callback_result;
+      break;
+
+    case GIMPLE_TRY:
+      ret = walk_gimple_seq_mod (gimple_try_eval_ptr (stmt), callback_stmt, callback_op,
+                            wi);
+      if (ret)
+       return wi->callback_result;
+
+      ret = walk_gimple_seq_mod (gimple_try_cleanup_ptr (stmt), callback_stmt,
+                            callback_op, wi);
+      if (ret)
+       return wi->callback_result;
+      break;
+
+    case GIMPLE_OMP_FOR:
+      ret = walk_gimple_seq_mod (gimple_omp_for_pre_body_ptr (stmt), callback_stmt,
+                            callback_op, wi);
+      if (ret)
+       return wi->callback_result;
+
+      /* FALL THROUGH.  */
+    case GIMPLE_OMP_CRITICAL:
+    case GIMPLE_OMP_MASTER:
+    case GIMPLE_OMP_TASKGROUP:
+    case GIMPLE_OMP_ORDERED:
+    case GIMPLE_OMP_SECTION:
+    case GIMPLE_OMP_PARALLEL:
+    case GIMPLE_OMP_TASK:
+    case GIMPLE_OMP_SECTIONS:
+    case GIMPLE_OMP_SINGLE:
+    case GIMPLE_OMP_TARGET:
+    case GIMPLE_OMP_TEAMS:
+      ret = walk_gimple_seq_mod (gimple_omp_body_ptr (stmt), callback_stmt,
+                            callback_op, wi);
+      if (ret)
+       return wi->callback_result;
+      break;
+
+    case GIMPLE_WITH_CLEANUP_EXPR:
+      ret = walk_gimple_seq_mod (gimple_wce_cleanup_ptr (stmt), callback_stmt,
+                            callback_op, wi);
+      if (ret)
+       return wi->callback_result;
+      break;
+
+    case GIMPLE_TRANSACTION:
+      ret = walk_gimple_seq_mod (gimple_transaction_body_ptr (stmt),
+                            callback_stmt, callback_op, wi);
+      if (ret)
+       return wi->callback_result;
+      break;
+
+    default:
+      gcc_assert (!gimple_has_substatements (stmt));
+      break;
+    }
+
+  return NULL;
+}
+
+/* From a tree operand OP return the base of a load or store operation
+   or NULL_TREE if OP is not a load or a store.  */
+
+static tree
+get_base_loadstore (tree op)
+{
+  while (handled_component_p (op))
+    op = TREE_OPERAND (op, 0);
+  if (DECL_P (op)
+      || INDIRECT_REF_P (op)
+      || TREE_CODE (op) == MEM_REF
+      || TREE_CODE (op) == TARGET_MEM_REF)
+    return op;
+  return NULL_TREE;
+}
+
+
+/* For the statement STMT call the callbacks VISIT_LOAD, VISIT_STORE and
+   VISIT_ADDR if non-NULL on loads, store and address-taken operands
+   passing the STMT, the base of the operand and DATA to it.  The base
+   will be either a decl, an indirect reference (including TARGET_MEM_REF)
+   or the argument of an address expression.
+   Returns the results of these callbacks or'ed.  */
+
+bool
+walk_stmt_load_store_addr_ops (gimple stmt, void *data,
+                              bool (*visit_load)(gimple, tree, void *),
+                              bool (*visit_store)(gimple, tree, void *),
+                              bool (*visit_addr)(gimple, tree, void *))
+{
+  bool ret = false;
+  unsigned i;
+  if (gimple_assign_single_p (stmt))
+    {
+      tree lhs, rhs;
+      if (visit_store)
+       {
+         lhs = get_base_loadstore (gimple_assign_lhs (stmt));
+         if (lhs)
+           ret |= visit_store (stmt, lhs, data);
+       }
+      rhs = gimple_assign_rhs1 (stmt);
+      while (handled_component_p (rhs))
+       rhs = TREE_OPERAND (rhs, 0);
+      if (visit_addr)
+       {
+         if (TREE_CODE (rhs) == ADDR_EXPR)
+           ret |= visit_addr (stmt, TREE_OPERAND (rhs, 0), data);
+         else if (TREE_CODE (rhs) == TARGET_MEM_REF
+                  && TREE_CODE (TMR_BASE (rhs)) == ADDR_EXPR)
+           ret |= visit_addr (stmt, TREE_OPERAND (TMR_BASE (rhs), 0), data);
+         else if (TREE_CODE (rhs) == OBJ_TYPE_REF
+                  && TREE_CODE (OBJ_TYPE_REF_OBJECT (rhs)) == ADDR_EXPR)
+           ret |= visit_addr (stmt, TREE_OPERAND (OBJ_TYPE_REF_OBJECT (rhs),
+                                                  0), data);
+         else if (TREE_CODE (rhs) == CONSTRUCTOR)
+           {
+             unsigned int ix;
+             tree val;
+
+             FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (rhs), ix, val)
+               if (TREE_CODE (val) == ADDR_EXPR)
+                 ret |= visit_addr (stmt, TREE_OPERAND (val, 0), data);
+               else if (TREE_CODE (val) == OBJ_TYPE_REF
+                        && TREE_CODE (OBJ_TYPE_REF_OBJECT (val)) == ADDR_EXPR)
+                 ret |= visit_addr (stmt,
+                                    TREE_OPERAND (OBJ_TYPE_REF_OBJECT (val),
+                                                  0), data);
+           }
+          lhs = gimple_assign_lhs (stmt);
+         if (TREE_CODE (lhs) == TARGET_MEM_REF
+              && TREE_CODE (TMR_BASE (lhs)) == ADDR_EXPR)
+            ret |= visit_addr (stmt, TREE_OPERAND (TMR_BASE (lhs), 0), data);
+       }
+      if (visit_load)
+       {
+         rhs = get_base_loadstore (rhs);
+         if (rhs)
+           ret |= visit_load (stmt, rhs, data);
+       }
+    }
+  else if (visit_addr
+          && (is_gimple_assign (stmt)
+              || gimple_code (stmt) == GIMPLE_COND))
+    {
+      for (i = 0; i < gimple_num_ops (stmt); ++i)
+       {
+         tree op = gimple_op (stmt, i);
+         if (op == NULL_TREE)
+           ;
+         else if (TREE_CODE (op) == ADDR_EXPR)
+           ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data);
+         /* COND_EXPR and VCOND_EXPR rhs1 argument is a comparison
+            tree with two operands.  */
+         else if (i == 1 && COMPARISON_CLASS_P (op))
+           {
+             if (TREE_CODE (TREE_OPERAND (op, 0)) == ADDR_EXPR)
+               ret |= visit_addr (stmt, TREE_OPERAND (TREE_OPERAND (op, 0),
+                                                      0), data);
+             if (TREE_CODE (TREE_OPERAND (op, 1)) == ADDR_EXPR)
+               ret |= visit_addr (stmt, TREE_OPERAND (TREE_OPERAND (op, 1),
+                                                      0), data);
+           }
+       }
+    }
+  else if (is_gimple_call (stmt))
+    {
+      if (visit_store)
+       {
+         tree lhs = gimple_call_lhs (stmt);
+         if (lhs)
+           {
+             lhs = get_base_loadstore (lhs);
+             if (lhs)
+               ret |= visit_store (stmt, lhs, data);
+           }
+       }
+      if (visit_load || visit_addr)
+       for (i = 0; i < gimple_call_num_args (stmt); ++i)
+         {
+           tree rhs = gimple_call_arg (stmt, i);
+           if (visit_addr
+               && TREE_CODE (rhs) == ADDR_EXPR)
+             ret |= visit_addr (stmt, TREE_OPERAND (rhs, 0), data);
+           else if (visit_load)
+             {
+               rhs = get_base_loadstore (rhs);
+               if (rhs)
+                 ret |= visit_load (stmt, rhs, data);
+             }
+         }
+      if (visit_addr
+         && gimple_call_chain (stmt)
+         && TREE_CODE (gimple_call_chain (stmt)) == ADDR_EXPR)
+       ret |= visit_addr (stmt, TREE_OPERAND (gimple_call_chain (stmt), 0),
+                          data);
+      if (visit_addr
+         && gimple_call_return_slot_opt_p (stmt)
+         && gimple_call_lhs (stmt) != NULL_TREE
+         && TREE_ADDRESSABLE (TREE_TYPE (gimple_call_lhs (stmt))))
+       ret |= visit_addr (stmt, gimple_call_lhs (stmt), data);
+    }
+  else if (gimple_code (stmt) == GIMPLE_ASM)
+    {
+      unsigned noutputs;
+      const char *constraint;
+      const char **oconstraints;
+      bool allows_mem, allows_reg, is_inout;
+      noutputs = gimple_asm_noutputs (stmt);
+      oconstraints = XALLOCAVEC (const char *, noutputs);
+      if (visit_store || visit_addr)
+       for (i = 0; i < gimple_asm_noutputs (stmt); ++i)
+         {
+           tree link = gimple_asm_output_op (stmt, i);
+           tree op = get_base_loadstore (TREE_VALUE (link));
+           if (op && visit_store)
+             ret |= visit_store (stmt, op, data);
+           if (visit_addr)
+             {
+               constraint = TREE_STRING_POINTER
+                   (TREE_VALUE (TREE_PURPOSE (link)));
+               oconstraints[i] = constraint;
+               parse_output_constraint (&constraint, i, 0, 0, &allows_mem,
+                                        &allows_reg, &is_inout);
+               if (op && !allows_reg && allows_mem)
+                 ret |= visit_addr (stmt, op, data);
+             }
+         }
+      if (visit_load || visit_addr)
+       for (i = 0; i < gimple_asm_ninputs (stmt); ++i)
+         {
+           tree link = gimple_asm_input_op (stmt, i);
+           tree op = TREE_VALUE (link);
+           if (visit_addr
+               && TREE_CODE (op) == ADDR_EXPR)
+             ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data);
+           else if (visit_load || visit_addr)
+             {
+               op = get_base_loadstore (op);
+               if (op)
+                 {
+                   if (visit_load)
+                     ret |= visit_load (stmt, op, data);
+                   if (visit_addr)
+                     {
+                       constraint = TREE_STRING_POINTER
+                           (TREE_VALUE (TREE_PURPOSE (link)));
+                       parse_input_constraint (&constraint, 0, 0, noutputs,
+                                               0, oconstraints,
+                                               &allows_mem, &allows_reg);
+                       if (!allows_reg && allows_mem)
+                         ret |= visit_addr (stmt, op, data);
+                     }
+                 }
+             }
+         }
+    }
+  else if (gimple_code (stmt) == GIMPLE_RETURN)
+    {
+      tree op = gimple_return_retval (stmt);
+      if (op)
+       {
+         if (visit_addr
+             && TREE_CODE (op) == ADDR_EXPR)
+           ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data);
+         else if (visit_load)
+           {
+             op = get_base_loadstore (op);
+             if (op)
+               ret |= visit_load (stmt, op, data);
+           }
+       }
+    }
+  else if (visit_addr
+          && gimple_code (stmt) == GIMPLE_PHI)
+    {
+      for (i = 0; i < gimple_phi_num_args (stmt); ++i)
+       {
+         tree op = gimple_phi_arg_def (stmt, i);
+         if (TREE_CODE (op) == ADDR_EXPR)
+           ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data);
+       }
+    }
+  else if (visit_addr
+          && gimple_code (stmt) == GIMPLE_GOTO)
+    {
+      tree op = gimple_goto_dest (stmt);
+      if (TREE_CODE (op) == ADDR_EXPR)
+       ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data);
+    }
+
+  return ret;
+}
+
+/* Like walk_stmt_load_store_addr_ops but with NULL visit_addr.  IPA-CP
+   should make a faster clone for this case.  */
+
+bool
+walk_stmt_load_store_ops (gimple stmt, void *data,
+                         bool (*visit_load)(gimple, tree, void *),
+                         bool (*visit_store)(gimple, tree, void *))
+{
+  return walk_stmt_load_store_addr_ops (stmt, data,
+                                       visit_load, visit_store, NULL);
+}
diff --git a/gcc/gimple-walk.h b/gcc/gimple-walk.h
new file mode 100644 (file)
index 0000000..0b9968a
--- /dev/null
@@ -0,0 +1,99 @@
+/* Header file for gimple statement walk support.
+   Copyright (C) 2013 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef GCC_GIMPLE_WALK_H
+#define GCC_GIMPLE_WALK_H
+
+/* Convenience routines to walk all statements of a gimple function.
+   Note that this is useful exclusively before the code is converted
+   into SSA form.  Once the program is in SSA form, the standard
+   operand interface should be used to analyze/modify statements.  */
+struct walk_stmt_info
+{
+  /* Points to the current statement being walked.  */
+  gimple_stmt_iterator gsi;
+
+  /* Additional data that the callback functions may want to carry
+     through the recursion.  */
+  void *info;
+
+  /* Pointer map used to mark visited tree nodes when calling
+     walk_tree on each operand.  If set to NULL, duplicate tree nodes
+     will be visited more than once.  */
+  struct pointer_set_t *pset;
+
+  /* Operand returned by the callbacks.  This is set when calling
+     walk_gimple_seq.  If the walk_stmt_fn or walk_tree_fn callback
+     returns non-NULL, this field will contain the tree returned by
+     the last callback.  */
+  tree callback_result;
+
+  /* Indicates whether the operand being examined may be replaced
+     with something that matches is_gimple_val (if true) or something
+     slightly more complicated (if false).  "Something" technically
+     means the common subset of is_gimple_lvalue and is_gimple_rhs,
+     but we never try to form anything more complicated than that, so
+     we don't bother checking.
+
+     Also note that CALLBACK should update this flag while walking the
+     sub-expressions of a statement.  For instance, when walking the
+     statement 'foo (&var)', the flag VAL_ONLY will initially be set
+     to true, however, when walking &var, the operand of that
+     ADDR_EXPR does not need to be a GIMPLE value.  */
+  BOOL_BITFIELD val_only : 1;
+
+  /* True if we are currently walking the LHS of an assignment.  */
+  BOOL_BITFIELD is_lhs : 1;
+
+  /* Optional.  Set to true by the callback functions if they made any
+     changes.  */
+  BOOL_BITFIELD changed : 1;
+
+  /* True if we're interested in location information.  */
+  BOOL_BITFIELD want_locations : 1;
+
+  /* True if we've removed the statement that was processed.  */
+  BOOL_BITFIELD removed_stmt : 1;
+};
+
+/* Callback for walk_gimple_stmt.  Called for every statement found
+   during traversal.  The first argument points to the statement to
+   walk.  The second argument is a flag that the callback sets to
+   'true' if it the callback handled all the operands and
+   sub-statements of the statement (the default value of this flag is
+   'false').  The third argument is an anonymous pointer to data
+   to be used by the callback.  */
+typedef tree (*walk_stmt_fn) (gimple_stmt_iterator *, bool *,
+                             struct walk_stmt_info *);
+
+extern gimple walk_gimple_seq_mod (gimple_seq *, walk_stmt_fn, walk_tree_fn,
+                                  struct walk_stmt_info *);
+extern gimple walk_gimple_seq (gimple_seq, walk_stmt_fn, walk_tree_fn,
+                              struct walk_stmt_info *);
+extern tree walk_gimple_op (gimple, walk_tree_fn, struct walk_stmt_info *);
+extern tree walk_gimple_stmt (gimple_stmt_iterator *, walk_stmt_fn,
+                             walk_tree_fn, struct walk_stmt_info *);
+extern bool walk_stmt_load_store_addr_ops (gimple, void *,
+                                          bool (*)(gimple, tree, void *),
+                                          bool (*)(gimple, tree, void *),
+                                          bool (*)(gimple, tree, void *));
+extern bool walk_stmt_load_store_ops (gimple, void *,
+                                     bool (*)(gimple, tree, void *),
+                                     bool (*)(gimple, tree, void *));
+#endif /* GCC_GIMPLE_WALK_H */
index cba3bcedf54de8bbb923298d7c6afe1c7779d146..0e073460110db593ddbb7b42eedfecdb287be2da 100644 (file)
@@ -29,6 +29,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "hard-reg-set.h"
 #include "basic-block.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "gimplify.h"
 #include "diagnostic.h"
 #include "value-prof.h"
@@ -1297,600 +1299,6 @@ gimple_seq_copy (gimple_seq src)
 }
 
 
-/* Walk all the statements in the sequence *PSEQ calling walk_gimple_stmt
-   on each one.  WI is as in walk_gimple_stmt.
-
-   If walk_gimple_stmt returns non-NULL, the walk is stopped, and the
-   value is stored in WI->CALLBACK_RESULT.  Also, the statement that
-   produced the value is returned if this statement has not been
-   removed by a callback (wi->removed_stmt).  If the statement has
-   been removed, NULL is returned.
-
-   Otherwise, all the statements are walked and NULL returned.  */
-
-gimple
-walk_gimple_seq_mod (gimple_seq *pseq, walk_stmt_fn callback_stmt,
-                    walk_tree_fn callback_op, struct walk_stmt_info *wi)
-{
-  gimple_stmt_iterator gsi;
-
-  for (gsi = gsi_start (*pseq); !gsi_end_p (gsi); )
-    {
-      tree ret = walk_gimple_stmt (&gsi, callback_stmt, callback_op, wi);
-      if (ret)
-       {
-         /* If CALLBACK_STMT or CALLBACK_OP return a value, WI must exist
-            to hold it.  */
-         gcc_assert (wi);
-         wi->callback_result = ret;
-
-         return wi->removed_stmt ? NULL : gsi_stmt (gsi);
-       }
-
-      if (!wi->removed_stmt)
-       gsi_next (&gsi);
-    }
-
-  if (wi)
-    wi->callback_result = NULL_TREE;
-
-  return NULL;
-}
-
-
-/* Like walk_gimple_seq_mod, but ensure that the head of SEQ isn't
-   changed by the callbacks.  */
-
-gimple
-walk_gimple_seq (gimple_seq seq, walk_stmt_fn callback_stmt,
-                walk_tree_fn callback_op, struct walk_stmt_info *wi)
-{
-  gimple_seq seq2 = seq;
-  gimple ret = walk_gimple_seq_mod (&seq2, callback_stmt, callback_op, wi);
-  gcc_assert (seq2 == seq);
-  return ret;
-}
-
-
-/* Helper function for walk_gimple_stmt.  Walk operands of a GIMPLE_ASM.  */
-
-static tree
-walk_gimple_asm (gimple stmt, walk_tree_fn callback_op,
-                struct walk_stmt_info *wi)
-{
-  tree ret, op;
-  unsigned noutputs;
-  const char **oconstraints;
-  unsigned i, n;
-  const char *constraint;
-  bool allows_mem, allows_reg, is_inout;
-
-  noutputs = gimple_asm_noutputs (stmt);
-  oconstraints = (const char **) alloca ((noutputs) * sizeof (const char *));
-
-  if (wi)
-    wi->is_lhs = true;
-
-  for (i = 0; i < noutputs; i++)
-    {
-      op = gimple_asm_output_op (stmt, i);
-      constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (op)));
-      oconstraints[i] = constraint;
-      parse_output_constraint (&constraint, i, 0, 0, &allows_mem, &allows_reg,
-                              &is_inout);
-      if (wi)
-       wi->val_only = (allows_reg || !allows_mem);
-      ret = walk_tree (&TREE_VALUE (op), callback_op, wi, NULL);
-      if (ret)
-       return ret;
-    }
-
-  n = gimple_asm_ninputs (stmt);
-  for (i = 0; i < n; i++)
-    {
-      op = gimple_asm_input_op (stmt, i);
-      constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (op)));
-      parse_input_constraint (&constraint, 0, 0, noutputs, 0,
-                             oconstraints, &allows_mem, &allows_reg);
-      if (wi)
-       {
-         wi->val_only = (allows_reg || !allows_mem);
-          /* Although input "m" is not really a LHS, we need a lvalue.  */
-         wi->is_lhs = !wi->val_only;
-       }
-      ret = walk_tree (&TREE_VALUE (op), callback_op, wi, NULL);
-      if (ret)
-       return ret;
-    }
-
-  if (wi)
-    {
-      wi->is_lhs = false;
-      wi->val_only = true;
-    }
-
-  n = gimple_asm_nlabels (stmt);
-  for (i = 0; i < n; i++)
-    {
-      op = gimple_asm_label_op (stmt, i);
-      ret = walk_tree (&TREE_VALUE (op), callback_op, wi, NULL);
-      if (ret)
-       return ret;
-    }
-
-  return NULL_TREE;
-}
-
-
-/* Helper function of WALK_GIMPLE_STMT.  Walk every tree operand in
-   STMT.  CALLBACK_OP and WI are as in WALK_GIMPLE_STMT.
-
-   CALLBACK_OP is called on each operand of STMT via walk_tree.
-   Additional parameters to walk_tree must be stored in WI.  For each operand
-   OP, walk_tree is called as:
-
-       walk_tree (&OP, CALLBACK_OP, WI, WI->PSET)
-
-   If CALLBACK_OP returns non-NULL for an operand, the remaining
-   operands are not scanned.
-
-   The return value is that returned by the last call to walk_tree, or
-   NULL_TREE if no CALLBACK_OP is specified.  */
-
-tree
-walk_gimple_op (gimple stmt, walk_tree_fn callback_op,
-               struct walk_stmt_info *wi)
-{
-  struct pointer_set_t *pset = (wi) ? wi->pset : NULL;
-  unsigned i;
-  tree ret = NULL_TREE;
-
-  switch (gimple_code (stmt))
-    {
-    case GIMPLE_ASSIGN:
-      /* Walk the RHS operands.  If the LHS is of a non-renamable type or
-         is a register variable, we may use a COMPONENT_REF on the RHS.  */
-      if (wi)
-       {
-         tree lhs = gimple_assign_lhs (stmt);
-         wi->val_only
-           = (is_gimple_reg_type (TREE_TYPE (lhs)) && !is_gimple_reg (lhs))
-             || gimple_assign_rhs_class (stmt) != GIMPLE_SINGLE_RHS;
-       }
-
-      for (i = 1; i < gimple_num_ops (stmt); i++)
-       {
-         ret = walk_tree (gimple_op_ptr (stmt, i), callback_op, wi,
-                          pset);
-         if (ret)
-           return ret;
-       }
-
-      /* Walk the LHS.  If the RHS is appropriate for a memory, we
-        may use a COMPONENT_REF on the LHS.  */
-      if (wi)
-       {
-          /* If the RHS is of a non-renamable type or is a register variable,
-            we may use a COMPONENT_REF on the LHS.  */
-         tree rhs1 = gimple_assign_rhs1 (stmt);
-         wi->val_only
-           = (is_gimple_reg_type (TREE_TYPE (rhs1)) && !is_gimple_reg (rhs1))
-             || gimple_assign_rhs_class (stmt) != GIMPLE_SINGLE_RHS;
-         wi->is_lhs = true;
-       }
-
-      ret = walk_tree (gimple_op_ptr (stmt, 0), callback_op, wi, pset);
-      if (ret)
-       return ret;
-
-      if (wi)
-       {
-         wi->val_only = true;
-         wi->is_lhs = false;
-       }
-      break;
-
-    case GIMPLE_CALL:
-      if (wi)
-       {
-         wi->is_lhs = false;
-         wi->val_only = true;
-       }
-
-      ret = walk_tree (gimple_call_chain_ptr (stmt), callback_op, wi, pset);
-      if (ret)
-        return ret;
-
-      ret = walk_tree (gimple_call_fn_ptr (stmt), callback_op, wi, pset);
-      if (ret)
-        return ret;
-
-      for (i = 0; i < gimple_call_num_args (stmt); i++)
-       {
-         if (wi)
-           wi->val_only
-             = is_gimple_reg_type (TREE_TYPE (gimple_call_arg (stmt, i)));
-         ret = walk_tree (gimple_call_arg_ptr (stmt, i), callback_op, wi,
-                          pset);
-         if (ret)
-           return ret;
-       }
-
-      if (gimple_call_lhs (stmt))
-       {
-         if (wi)
-           {
-             wi->is_lhs = true;
-             wi->val_only
-               = is_gimple_reg_type (TREE_TYPE (gimple_call_lhs (stmt)));
-           }
-
-         ret = walk_tree (gimple_call_lhs_ptr (stmt), callback_op, wi, pset);
-         if (ret)
-           return ret;
-       }
-
-      if (wi)
-       {
-         wi->is_lhs = false;
-         wi->val_only = true;
-       }
-      break;
-
-    case GIMPLE_CATCH:
-      ret = walk_tree (gimple_catch_types_ptr (stmt), callback_op, wi,
-                      pset);
-      if (ret)
-       return ret;
-      break;
-
-    case GIMPLE_EH_FILTER:
-      ret = walk_tree (gimple_eh_filter_types_ptr (stmt), callback_op, wi,
-                      pset);
-      if (ret)
-       return ret;
-      break;
-
-    case GIMPLE_ASM:
-      ret = walk_gimple_asm (stmt, callback_op, wi);
-      if (ret)
-       return ret;
-      break;
-
-    case GIMPLE_OMP_CONTINUE:
-      ret = walk_tree (gimple_omp_continue_control_def_ptr (stmt),
-                      callback_op, wi, pset);
-      if (ret)
-       return ret;
-
-      ret = walk_tree (gimple_omp_continue_control_use_ptr (stmt),
-                      callback_op, wi, pset);
-      if (ret)
-       return ret;
-      break;
-
-    case GIMPLE_OMP_CRITICAL:
-      ret = walk_tree (gimple_omp_critical_name_ptr (stmt), callback_op, wi,
-                      pset);
-      if (ret)
-       return ret;
-      break;
-
-    case GIMPLE_OMP_FOR:
-      ret = walk_tree (gimple_omp_for_clauses_ptr (stmt), callback_op, wi,
-                      pset);
-      if (ret)
-       return ret;
-      for (i = 0; i < gimple_omp_for_collapse (stmt); i++)
-       {
-         ret = walk_tree (gimple_omp_for_index_ptr (stmt, i), callback_op,
-                          wi, pset);
-         if (ret)
-           return ret;
-         ret = walk_tree (gimple_omp_for_initial_ptr (stmt, i), callback_op,
-                          wi, pset);
-         if (ret)
-           return ret;
-         ret = walk_tree (gimple_omp_for_final_ptr (stmt, i), callback_op,
-                          wi, pset);
-         if (ret)
-           return ret;
-         ret = walk_tree (gimple_omp_for_incr_ptr (stmt, i), callback_op,
-                          wi, pset);
-       }
-      if (ret)
-       return ret;
-      break;
-
-    case GIMPLE_OMP_PARALLEL:
-      ret = walk_tree (gimple_omp_parallel_clauses_ptr (stmt), callback_op,
-                      wi, pset);
-      if (ret)
-       return ret;
-      ret = walk_tree (gimple_omp_parallel_child_fn_ptr (stmt), callback_op,
-                      wi, pset);
-      if (ret)
-       return ret;
-      ret = walk_tree (gimple_omp_parallel_data_arg_ptr (stmt), callback_op,
-                      wi, pset);
-      if (ret)
-       return ret;
-      break;
-
-    case GIMPLE_OMP_TASK:
-      ret = walk_tree (gimple_omp_task_clauses_ptr (stmt), callback_op,
-                      wi, pset);
-      if (ret)
-       return ret;
-      ret = walk_tree (gimple_omp_task_child_fn_ptr (stmt), callback_op,
-                      wi, pset);
-      if (ret)
-       return ret;
-      ret = walk_tree (gimple_omp_task_data_arg_ptr (stmt), callback_op,
-                      wi, pset);
-      if (ret)
-       return ret;
-      ret = walk_tree (gimple_omp_task_copy_fn_ptr (stmt), callback_op,
-                      wi, pset);
-      if (ret)
-       return ret;
-      ret = walk_tree (gimple_omp_task_arg_size_ptr (stmt), callback_op,
-                      wi, pset);
-      if (ret)
-       return ret;
-      ret = walk_tree (gimple_omp_task_arg_align_ptr (stmt), callback_op,
-                      wi, pset);
-      if (ret)
-       return ret;
-      break;
-
-    case GIMPLE_OMP_SECTIONS:
-      ret = walk_tree (gimple_omp_sections_clauses_ptr (stmt), callback_op,
-                      wi, pset);
-      if (ret)
-       return ret;
-
-      ret = walk_tree (gimple_omp_sections_control_ptr (stmt), callback_op,
-                      wi, pset);
-      if (ret)
-       return ret;
-
-      break;
-
-    case GIMPLE_OMP_SINGLE:
-      ret = walk_tree (gimple_omp_single_clauses_ptr (stmt), callback_op, wi,
-                      pset);
-      if (ret)
-       return ret;
-      break;
-
-    case GIMPLE_OMP_TARGET:
-      ret = walk_tree (gimple_omp_target_clauses_ptr (stmt), callback_op, wi,
-                      pset);
-      if (ret)
-       return ret;
-      break;
-
-    case GIMPLE_OMP_TEAMS:
-      ret = walk_tree (gimple_omp_teams_clauses_ptr (stmt), callback_op, wi,
-                      pset);
-      if (ret)
-       return ret;
-      break;
-
-    case GIMPLE_OMP_ATOMIC_LOAD:
-      ret = walk_tree (gimple_omp_atomic_load_lhs_ptr (stmt), callback_op, wi,
-                      pset);
-      if (ret)
-       return ret;
-
-      ret = walk_tree (gimple_omp_atomic_load_rhs_ptr (stmt), callback_op, wi,
-                      pset);
-      if (ret)
-       return ret;
-      break;
-
-    case GIMPLE_OMP_ATOMIC_STORE:
-      ret = walk_tree (gimple_omp_atomic_store_val_ptr (stmt), callback_op,
-                      wi, pset);
-      if (ret)
-       return ret;
-      break;
-
-    case GIMPLE_TRANSACTION:
-      ret = walk_tree (gimple_transaction_label_ptr (stmt), callback_op,
-                      wi, pset);
-      if (ret)
-       return ret;
-      break;
-
-    case GIMPLE_OMP_RETURN:
-      ret = walk_tree (gimple_omp_return_lhs_ptr (stmt), callback_op, wi,
-                      pset);
-      if (ret)
-       return ret;
-      break;
-
-      /* Tuples that do not have operands.  */
-    case GIMPLE_NOP:
-    case GIMPLE_RESX:
-    case GIMPLE_PREDICT:
-      break;
-
-    default:
-      {
-       enum gimple_statement_structure_enum gss;
-       gss = gimple_statement_structure (stmt);
-       if (gss == GSS_WITH_OPS || gss == GSS_WITH_MEM_OPS)
-         for (i = 0; i < gimple_num_ops (stmt); i++)
-           {
-             ret = walk_tree (gimple_op_ptr (stmt, i), callback_op, wi, pset);
-             if (ret)
-               return ret;
-           }
-      }
-      break;
-    }
-
-  return NULL_TREE;
-}
-
-
-/* Walk the current statement in GSI (optionally using traversal state
-   stored in WI).  If WI is NULL, no state is kept during traversal.
-   The callback CALLBACK_STMT is called.  If CALLBACK_STMT indicates
-   that it has handled all the operands of the statement, its return
-   value is returned.  Otherwise, the return value from CALLBACK_STMT
-   is discarded and its operands are scanned.
-
-   If CALLBACK_STMT is NULL or it didn't handle the operands,
-   CALLBACK_OP is called on each operand of the statement via
-   walk_gimple_op.  If walk_gimple_op returns non-NULL for any
-   operand, the remaining operands are not scanned.  In this case, the
-   return value from CALLBACK_OP is returned.
-
-   In any other case, NULL_TREE is returned.  */
-
-tree
-walk_gimple_stmt (gimple_stmt_iterator *gsi, walk_stmt_fn callback_stmt,
-                 walk_tree_fn callback_op, struct walk_stmt_info *wi)
-{
-  gimple ret;
-  tree tree_ret;
-  gimple stmt = gsi_stmt (*gsi);
-
-  if (wi)
-    {
-      wi->gsi = *gsi;
-      wi->removed_stmt = false;
-
-      if (wi->want_locations && gimple_has_location (stmt))
-       input_location = gimple_location (stmt);
-    }
-
-  ret = NULL;
-
-  /* Invoke the statement callback.  Return if the callback handled
-     all of STMT operands by itself.  */
-  if (callback_stmt)
-    {
-      bool handled_ops = false;
-      tree_ret = callback_stmt (gsi, &handled_ops, wi);
-      if (handled_ops)
-       return tree_ret;
-
-      /* If CALLBACK_STMT did not handle operands, it should not have
-        a value to return.  */
-      gcc_assert (tree_ret == NULL);
-
-      if (wi && wi->removed_stmt)
-       return NULL;
-
-      /* Re-read stmt in case the callback changed it.  */
-      stmt = gsi_stmt (*gsi);
-    }
-
-  /* If CALLBACK_OP is defined, invoke it on every operand of STMT.  */
-  if (callback_op)
-    {
-      tree_ret = walk_gimple_op (stmt, callback_op, wi);
-      if (tree_ret)
-       return tree_ret;
-    }
-
-  /* If STMT can have statements inside (e.g. GIMPLE_BIND), walk them.  */
-  switch (gimple_code (stmt))
-    {
-    case GIMPLE_BIND:
-      ret = walk_gimple_seq_mod (gimple_bind_body_ptr (stmt), callback_stmt,
-                                callback_op, wi);
-      if (ret)
-       return wi->callback_result;
-      break;
-
-    case GIMPLE_CATCH:
-      ret = walk_gimple_seq_mod (gimple_catch_handler_ptr (stmt), callback_stmt,
-                                callback_op, wi);
-      if (ret)
-       return wi->callback_result;
-      break;
-
-    case GIMPLE_EH_FILTER:
-      ret = walk_gimple_seq_mod (gimple_eh_filter_failure_ptr (stmt), callback_stmt,
-                            callback_op, wi);
-      if (ret)
-       return wi->callback_result;
-      break;
-
-    case GIMPLE_EH_ELSE:
-      ret = walk_gimple_seq_mod (gimple_eh_else_n_body_ptr (stmt),
-                            callback_stmt, callback_op, wi);
-      if (ret)
-       return wi->callback_result;
-      ret = walk_gimple_seq_mod (gimple_eh_else_e_body_ptr (stmt),
-                            callback_stmt, callback_op, wi);
-      if (ret)
-       return wi->callback_result;
-      break;
-
-    case GIMPLE_TRY:
-      ret = walk_gimple_seq_mod (gimple_try_eval_ptr (stmt), callback_stmt, callback_op,
-                            wi);
-      if (ret)
-       return wi->callback_result;
-
-      ret = walk_gimple_seq_mod (gimple_try_cleanup_ptr (stmt), callback_stmt,
-                            callback_op, wi);
-      if (ret)
-       return wi->callback_result;
-      break;
-
-    case GIMPLE_OMP_FOR:
-      ret = walk_gimple_seq_mod (gimple_omp_for_pre_body_ptr (stmt), callback_stmt,
-                            callback_op, wi);
-      if (ret)
-       return wi->callback_result;
-
-      /* FALL THROUGH.  */
-    case GIMPLE_OMP_CRITICAL:
-    case GIMPLE_OMP_MASTER:
-    case GIMPLE_OMP_TASKGROUP:
-    case GIMPLE_OMP_ORDERED:
-    case GIMPLE_OMP_SECTION:
-    case GIMPLE_OMP_PARALLEL:
-    case GIMPLE_OMP_TASK:
-    case GIMPLE_OMP_SECTIONS:
-    case GIMPLE_OMP_SINGLE:
-    case GIMPLE_OMP_TARGET:
-    case GIMPLE_OMP_TEAMS:
-      ret = walk_gimple_seq_mod (gimple_omp_body_ptr (stmt), callback_stmt,
-                            callback_op, wi);
-      if (ret)
-       return wi->callback_result;
-      break;
-
-    case GIMPLE_WITH_CLEANUP_EXPR:
-      ret = walk_gimple_seq_mod (gimple_wce_cleanup_ptr (stmt), callback_stmt,
-                            callback_op, wi);
-      if (ret)
-       return wi->callback_result;
-      break;
-
-    case GIMPLE_TRANSACTION:
-      ret = walk_gimple_seq_mod (gimple_transaction_body_ptr (stmt),
-                            callback_stmt, callback_op, wi);
-      if (ret)
-       return wi->callback_result;
-      break;
-
-    default:
-      gcc_assert (!gimple_has_substatements (stmt));
-      break;
-    }
-
-  return NULL;
-}
-
 
 /* Return true if calls C1 and C2 are known to go to the same function.  */
 
@@ -2996,251 +2404,6 @@ gimple_get_alias_set (tree t)
 }
 
 
-/* From a tree operand OP return the base of a load or store operation
-   or NULL_TREE if OP is not a load or a store.  */
-
-static tree
-get_base_loadstore (tree op)
-{
-  while (handled_component_p (op))
-    op = TREE_OPERAND (op, 0);
-  if (DECL_P (op)
-      || INDIRECT_REF_P (op)
-      || TREE_CODE (op) == MEM_REF
-      || TREE_CODE (op) == TARGET_MEM_REF)
-    return op;
-  return NULL_TREE;
-}
-
-/* For the statement STMT call the callbacks VISIT_LOAD, VISIT_STORE and
-   VISIT_ADDR if non-NULL on loads, store and address-taken operands
-   passing the STMT, the base of the operand and DATA to it.  The base
-   will be either a decl, an indirect reference (including TARGET_MEM_REF)
-   or the argument of an address expression.
-   Returns the results of these callbacks or'ed.  */
-
-bool
-walk_stmt_load_store_addr_ops (gimple stmt, void *data,
-                              bool (*visit_load)(gimple, tree, void *),
-                              bool (*visit_store)(gimple, tree, void *),
-                              bool (*visit_addr)(gimple, tree, void *))
-{
-  bool ret = false;
-  unsigned i;
-  if (gimple_assign_single_p (stmt))
-    {
-      tree lhs, rhs;
-      if (visit_store)
-       {
-         lhs = get_base_loadstore (gimple_assign_lhs (stmt));
-         if (lhs)
-           ret |= visit_store (stmt, lhs, data);
-       }
-      rhs = gimple_assign_rhs1 (stmt);
-      while (handled_component_p (rhs))
-       rhs = TREE_OPERAND (rhs, 0);
-      if (visit_addr)
-       {
-         if (TREE_CODE (rhs) == ADDR_EXPR)
-           ret |= visit_addr (stmt, TREE_OPERAND (rhs, 0), data);
-         else if (TREE_CODE (rhs) == TARGET_MEM_REF
-                  && TREE_CODE (TMR_BASE (rhs)) == ADDR_EXPR)
-           ret |= visit_addr (stmt, TREE_OPERAND (TMR_BASE (rhs), 0), data);
-         else if (TREE_CODE (rhs) == OBJ_TYPE_REF
-                  && TREE_CODE (OBJ_TYPE_REF_OBJECT (rhs)) == ADDR_EXPR)
-           ret |= visit_addr (stmt, TREE_OPERAND (OBJ_TYPE_REF_OBJECT (rhs),
-                                                  0), data);
-         else if (TREE_CODE (rhs) == CONSTRUCTOR)
-           {
-             unsigned int ix;
-             tree val;
-
-             FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (rhs), ix, val)
-               if (TREE_CODE (val) == ADDR_EXPR)
-                 ret |= visit_addr (stmt, TREE_OPERAND (val, 0), data);
-               else if (TREE_CODE (val) == OBJ_TYPE_REF
-                        && TREE_CODE (OBJ_TYPE_REF_OBJECT (val)) == ADDR_EXPR)
-                 ret |= visit_addr (stmt,
-                                    TREE_OPERAND (OBJ_TYPE_REF_OBJECT (val),
-                                                  0), data);
-           }
-          lhs = gimple_assign_lhs (stmt);
-         if (TREE_CODE (lhs) == TARGET_MEM_REF
-              && TREE_CODE (TMR_BASE (lhs)) == ADDR_EXPR)
-            ret |= visit_addr (stmt, TREE_OPERAND (TMR_BASE (lhs), 0), data);
-       }
-      if (visit_load)
-       {
-         rhs = get_base_loadstore (rhs);
-         if (rhs)
-           ret |= visit_load (stmt, rhs, data);
-       }
-    }
-  else if (visit_addr
-          && (is_gimple_assign (stmt)
-              || gimple_code (stmt) == GIMPLE_COND))
-    {
-      for (i = 0; i < gimple_num_ops (stmt); ++i)
-       {
-         tree op = gimple_op (stmt, i);
-         if (op == NULL_TREE)
-           ;
-         else if (TREE_CODE (op) == ADDR_EXPR)
-           ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data);
-         /* COND_EXPR and VCOND_EXPR rhs1 argument is a comparison
-            tree with two operands.  */
-         else if (i == 1 && COMPARISON_CLASS_P (op))
-           {
-             if (TREE_CODE (TREE_OPERAND (op, 0)) == ADDR_EXPR)
-               ret |= visit_addr (stmt, TREE_OPERAND (TREE_OPERAND (op, 0),
-                                                      0), data);
-             if (TREE_CODE (TREE_OPERAND (op, 1)) == ADDR_EXPR)
-               ret |= visit_addr (stmt, TREE_OPERAND (TREE_OPERAND (op, 1),
-                                                      0), data);
-           }
-       }
-    }
-  else if (is_gimple_call (stmt))
-    {
-      if (visit_store)
-       {
-         tree lhs = gimple_call_lhs (stmt);
-         if (lhs)
-           {
-             lhs = get_base_loadstore (lhs);
-             if (lhs)
-               ret |= visit_store (stmt, lhs, data);
-           }
-       }
-      if (visit_load || visit_addr)
-       for (i = 0; i < gimple_call_num_args (stmt); ++i)
-         {
-           tree rhs = gimple_call_arg (stmt, i);
-           if (visit_addr
-               && TREE_CODE (rhs) == ADDR_EXPR)
-             ret |= visit_addr (stmt, TREE_OPERAND (rhs, 0), data);
-           else if (visit_load)
-             {
-               rhs = get_base_loadstore (rhs);
-               if (rhs)
-                 ret |= visit_load (stmt, rhs, data);
-             }
-         }
-      if (visit_addr
-         && gimple_call_chain (stmt)
-         && TREE_CODE (gimple_call_chain (stmt)) == ADDR_EXPR)
-       ret |= visit_addr (stmt, TREE_OPERAND (gimple_call_chain (stmt), 0),
-                          data);
-      if (visit_addr
-         && gimple_call_return_slot_opt_p (stmt)
-         && gimple_call_lhs (stmt) != NULL_TREE
-         && TREE_ADDRESSABLE (TREE_TYPE (gimple_call_lhs (stmt))))
-       ret |= visit_addr (stmt, gimple_call_lhs (stmt), data);
-    }
-  else if (gimple_code (stmt) == GIMPLE_ASM)
-    {
-      unsigned noutputs;
-      const char *constraint;
-      const char **oconstraints;
-      bool allows_mem, allows_reg, is_inout;
-      noutputs = gimple_asm_noutputs (stmt);
-      oconstraints = XALLOCAVEC (const char *, noutputs);
-      if (visit_store || visit_addr)
-       for (i = 0; i < gimple_asm_noutputs (stmt); ++i)
-         {
-           tree link = gimple_asm_output_op (stmt, i);
-           tree op = get_base_loadstore (TREE_VALUE (link));
-           if (op && visit_store)
-             ret |= visit_store (stmt, op, data);
-           if (visit_addr)
-             {
-               constraint = TREE_STRING_POINTER
-                   (TREE_VALUE (TREE_PURPOSE (link)));
-               oconstraints[i] = constraint;
-               parse_output_constraint (&constraint, i, 0, 0, &allows_mem,
-                                        &allows_reg, &is_inout);
-               if (op && !allows_reg && allows_mem)
-                 ret |= visit_addr (stmt, op, data);
-             }
-         }
-      if (visit_load || visit_addr)
-       for (i = 0; i < gimple_asm_ninputs (stmt); ++i)
-         {
-           tree link = gimple_asm_input_op (stmt, i);
-           tree op = TREE_VALUE (link);
-           if (visit_addr
-               && TREE_CODE (op) == ADDR_EXPR)
-             ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data);
-           else if (visit_load || visit_addr)
-             {
-               op = get_base_loadstore (op);
-               if (op)
-                 {
-                   if (visit_load)
-                     ret |= visit_load (stmt, op, data);
-                   if (visit_addr)
-                     {
-                       constraint = TREE_STRING_POINTER
-                           (TREE_VALUE (TREE_PURPOSE (link)));
-                       parse_input_constraint (&constraint, 0, 0, noutputs,
-                                               0, oconstraints,
-                                               &allows_mem, &allows_reg);
-                       if (!allows_reg && allows_mem)
-                         ret |= visit_addr (stmt, op, data);
-                     }
-                 }
-             }
-         }
-    }
-  else if (gimple_code (stmt) == GIMPLE_RETURN)
-    {
-      tree op = gimple_return_retval (stmt);
-      if (op)
-       {
-         if (visit_addr
-             && TREE_CODE (op) == ADDR_EXPR)
-           ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data);
-         else if (visit_load)
-           {
-             op = get_base_loadstore (op);
-             if (op)
-               ret |= visit_load (stmt, op, data);
-           }
-       }
-    }
-  else if (visit_addr
-          && gimple_code (stmt) == GIMPLE_PHI)
-    {
-      for (i = 0; i < gimple_phi_num_args (stmt); ++i)
-       {
-         tree op = gimple_phi_arg_def (stmt, i);
-         if (TREE_CODE (op) == ADDR_EXPR)
-           ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data);
-       }
-    }
-  else if (visit_addr
-          && gimple_code (stmt) == GIMPLE_GOTO)
-    {
-      tree op = gimple_goto_dest (stmt);
-      if (TREE_CODE (op) == ADDR_EXPR)
-       ret |= visit_addr (stmt, TREE_OPERAND (op, 0), data);
-    }
-
-  return ret;
-}
-
-/* Like walk_stmt_load_store_addr_ops but with NULL visit_addr.  IPA-CP
-   should make a faster clone for this case.  */
-
-bool
-walk_stmt_load_store_ops (gimple stmt, void *data,
-                         bool (*visit_load)(gimple, tree, void *),
-                         bool (*visit_store)(gimple, tree, void *))
-{
-  return walk_stmt_load_store_addr_ops (stmt, data,
-                                       visit_load, visit_store, NULL);
-}
-
 /* Helper for gimple_ior_addresses_taken_1.  */
 
 static bool
@@ -3688,3 +2851,12 @@ preprocess_case_label_vec_for_gimple (vec<tree> labels,
   if (default_casep)
     *default_casep = default_case;
 }
+
+/* Set the location of all statements in SEQ to LOC.  */
+
+void
+gimple_seq_set_location (gimple_seq seq, location_t loc)
+{
+  for (gimple_stmt_iterator i = gsi_start (seq); !gsi_end_p (i); gsi_next (&i))
+    gimple_set_location (gsi_stmt (i), loc);
+}
index 4f34a9eea92264cc32c733b62c13d7e9aedbbbd7..db24800b43a39f11764a081746ff50beefcd4faf 100644 (file)
@@ -141,21 +141,6 @@ enum plf_mask {
     GF_PLF_2   = 1 << 1
 };
 
-/* Iterator object for GIMPLE statement sequences.  */
-
-struct gimple_stmt_iterator_d
-{
-  /* Sequence node holding the current statement.  */
-  gimple_seq_node ptr;
-
-  /* Sequence and basic block holding the statement.  These fields
-     are necessary to handle edge cases such as when statement is
-     added to an empty basic block or when the last statement of a
-     block/sequence is removed.  */
-  gimple_seq *seq;
-  basic_block bb;
-};
-
 /* Data structure definitions for GIMPLE tuples.  NOTE: word markers
    are for 64 bit hosts.  */
 
@@ -847,13 +832,6 @@ extern bool gimple_compare_field_offset (tree, tree);
 extern tree gimple_unsigned_type (tree);
 extern tree gimple_signed_type (tree);
 extern alias_set_type gimple_get_alias_set (tree);
-extern bool walk_stmt_load_store_addr_ops (gimple, void *,
-                                          bool (*)(gimple, tree, void *),
-                                          bool (*)(gimple, tree, void *),
-                                          bool (*)(gimple, tree, void *));
-extern bool walk_stmt_load_store_ops (gimple, void *,
-                                     bool (*)(gimple, tree, void *),
-                                     bool (*)(gimple, tree, void *));
 extern bool gimple_ior_addresses_taken (bitmap, gimple);
 extern bool gimple_call_builtin_p (gimple, enum built_in_class);
 extern bool gimple_call_builtin_p (gimple, enum built_in_function);
@@ -5223,227 +5201,6 @@ gimple_expr_type (const_gimple stmt)
     return void_type_node;
 }
 
-/* Return a new iterator pointing to GIMPLE_SEQ's first statement.  */
-
-static inline gimple_stmt_iterator
-gsi_start_1 (gimple_seq *seq)
-{
-  gimple_stmt_iterator i;
-
-  i.ptr = gimple_seq_first (*seq);
-  i.seq = seq;
-  i.bb = i.ptr ? gimple_bb (i.ptr) : NULL;
-
-  return i;
-}
-
-#define gsi_start(x) gsi_start_1 (&(x))
-
-static inline gimple_stmt_iterator
-gsi_none (void)
-{
-  gimple_stmt_iterator i;
-  i.ptr = NULL;
-  i.seq = NULL;
-  i.bb = NULL;
-  return i;
-}
-
-/* Return a new iterator pointing to the first statement in basic block BB.  */
-
-static inline gimple_stmt_iterator
-gsi_start_bb (basic_block bb)
-{
-  gimple_stmt_iterator i;
-  gimple_seq *seq;
-
-  seq = bb_seq_addr (bb);
-  i.ptr = gimple_seq_first (*seq);
-  i.seq = seq;
-  i.bb = bb;
-
-  return i;
-}
-
-
-/* Return a new iterator initially pointing to GIMPLE_SEQ's last statement.  */
-
-static inline gimple_stmt_iterator
-gsi_last_1 (gimple_seq *seq)
-{
-  gimple_stmt_iterator i;
-
-  i.ptr = gimple_seq_last (*seq);
-  i.seq = seq;
-  i.bb = i.ptr ? gimple_bb (i.ptr) : NULL;
-
-  return i;
-}
-
-#define gsi_last(x) gsi_last_1 (&(x))
-
-/* Return a new iterator pointing to the last statement in basic block BB.  */
-
-static inline gimple_stmt_iterator
-gsi_last_bb (basic_block bb)
-{
-  gimple_stmt_iterator i;
-  gimple_seq *seq;
-
-  seq = bb_seq_addr (bb);
-  i.ptr = gimple_seq_last (*seq);
-  i.seq = seq;
-  i.bb = bb;
-
-  return i;
-}
-
-
-/* Return true if I is at the end of its sequence.  */
-
-static inline bool
-gsi_end_p (gimple_stmt_iterator i)
-{
-  return i.ptr == NULL;
-}
-
-
-/* Return true if I is one statement before the end of its sequence.  */
-
-static inline bool
-gsi_one_before_end_p (gimple_stmt_iterator i)
-{
-  return i.ptr != NULL && i.ptr->gsbase.next == NULL;
-}
-
-
-/* Advance the iterator to the next gimple statement.  */
-
-static inline void
-gsi_next (gimple_stmt_iterator *i)
-{
-  i->ptr = i->ptr->gsbase.next;
-}
-
-/* Advance the iterator to the previous gimple statement.  */
-
-static inline void
-gsi_prev (gimple_stmt_iterator *i)
-{
-  gimple prev = i->ptr->gsbase.prev;
-  if (prev->gsbase.next)
-    i->ptr = prev;
-  else
-    i->ptr = NULL;
-}
-
-/* Return the current stmt.  */
-
-static inline gimple
-gsi_stmt (gimple_stmt_iterator i)
-{
-  return i.ptr;
-}
-
-/* Return a block statement iterator that points to the first non-label
-   statement in block BB.  */
-
-static inline gimple_stmt_iterator
-gsi_after_labels (basic_block bb)
-{
-  gimple_stmt_iterator gsi = gsi_start_bb (bb);
-
-  while (!gsi_end_p (gsi) && gimple_code (gsi_stmt (gsi)) == GIMPLE_LABEL)
-    gsi_next (&gsi);
-
-  return gsi;
-}
-
-/* Advance the iterator to the next non-debug gimple statement.  */
-
-static inline void
-gsi_next_nondebug (gimple_stmt_iterator *i)
-{
-  do
-    {
-      gsi_next (i);
-    }
-  while (!gsi_end_p (*i) && is_gimple_debug (gsi_stmt (*i)));
-}
-
-/* Advance the iterator to the next non-debug gimple statement.  */
-
-static inline void
-gsi_prev_nondebug (gimple_stmt_iterator *i)
-{
-  do
-    {
-      gsi_prev (i);
-    }
-  while (!gsi_end_p (*i) && is_gimple_debug (gsi_stmt (*i)));
-}
-
-/* Return a new iterator pointing to the first non-debug statement in
-   basic block BB.  */
-
-static inline gimple_stmt_iterator
-gsi_start_nondebug_bb (basic_block bb)
-{
-  gimple_stmt_iterator i = gsi_start_bb (bb);
-
-  if (!gsi_end_p (i) && is_gimple_debug (gsi_stmt (i)))
-    gsi_next_nondebug (&i);
-
-  return i;
-}
-
-/* Return a new iterator pointing to the first non-debug non-label statement in
-   basic block BB.  */
-
-static inline gimple_stmt_iterator
-gsi_start_nondebug_after_labels_bb (basic_block bb)
-{
-  gimple_stmt_iterator i = gsi_after_labels (bb);
-
-  if (!gsi_end_p (i) && is_gimple_debug (gsi_stmt (i)))
-    gsi_next_nondebug (&i);
-
-  return i;
-}
-
-/* Return a new iterator pointing to the last non-debug statement in
-   basic block BB.  */
-
-static inline gimple_stmt_iterator
-gsi_last_nondebug_bb (basic_block bb)
-{
-  gimple_stmt_iterator i = gsi_last_bb (bb);
-
-  if (!gsi_end_p (i) && is_gimple_debug (gsi_stmt (i)))
-    gsi_prev_nondebug (&i);
-
-  return i;
-}
-
-
-/* Return the basic block associated with this iterator.  */
-
-static inline basic_block
-gsi_bb (gimple_stmt_iterator i)
-{
-  return i.bb;
-}
-
-
-/* Return the sequence associated with this iterator.  */
-
-static inline gimple_seq
-gsi_seq (gimple_stmt_iterator i)
-{
-  return *i.seq;
-}
-
-
 enum gsi_iterator_update
 {
   GSI_NEW_STMT,                /* Only valid when single statement is added, move
@@ -5454,112 +5211,8 @@ enum gsi_iterator_update
                           direction.  */
 };
 
-/* In gimple-iterator.c  */
-gimple_stmt_iterator gsi_start_phis (basic_block);
-gimple_seq gsi_split_seq_after (gimple_stmt_iterator);
-void gsi_split_seq_before (gimple_stmt_iterator *, gimple_seq *);
-void gsi_set_stmt (gimple_stmt_iterator *, gimple);
-void gsi_replace (gimple_stmt_iterator *, gimple, bool);
-void gsi_replace_with_seq (gimple_stmt_iterator *, gimple_seq, bool);
-void gsi_insert_before (gimple_stmt_iterator *, gimple,
-                       enum gsi_iterator_update);
-void gsi_insert_before_without_update (gimple_stmt_iterator *, gimple,
-                                       enum gsi_iterator_update);
-void gsi_insert_seq_before (gimple_stmt_iterator *, gimple_seq,
-                            enum gsi_iterator_update);
-void gsi_insert_seq_before_without_update (gimple_stmt_iterator *, gimple_seq,
-                                           enum gsi_iterator_update);
-void gsi_insert_after (gimple_stmt_iterator *, gimple,
-                      enum gsi_iterator_update);
-void gsi_insert_after_without_update (gimple_stmt_iterator *, gimple,
-                                      enum gsi_iterator_update);
-void gsi_insert_seq_after (gimple_stmt_iterator *, gimple_seq,
-                          enum gsi_iterator_update);
-void gsi_insert_seq_after_without_update (gimple_stmt_iterator *, gimple_seq,
-                                          enum gsi_iterator_update);
-bool gsi_remove (gimple_stmt_iterator *, bool);
-gimple_stmt_iterator gsi_for_stmt (gimple);
-void gsi_move_after (gimple_stmt_iterator *, gimple_stmt_iterator *);
-void gsi_move_before (gimple_stmt_iterator *, gimple_stmt_iterator *);
-void gsi_move_to_bb_end (gimple_stmt_iterator *, basic_block);
-void gsi_insert_on_edge (edge, gimple);
-void gsi_insert_seq_on_edge (edge, gimple_seq);
-basic_block gsi_insert_on_edge_immediate (edge, gimple);
-basic_block gsi_insert_seq_on_edge_immediate (edge, gimple_seq);
-void gsi_commit_one_edge_insert (edge, basic_block *);
-void gsi_commit_edge_inserts (void);
 gimple gimple_call_copy_skip_args (gimple, bitmap);
 
-/* Convenience routines to walk all statements of a gimple function.
-   Note that this is useful exclusively before the code is converted
-   into SSA form.  Once the program is in SSA form, the standard
-   operand interface should be used to analyze/modify statements.  */
-struct walk_stmt_info
-{
-  /* Points to the current statement being walked.  */
-  gimple_stmt_iterator gsi;
-
-  /* Additional data that the callback functions may want to carry
-     through the recursion.  */
-  void *info;
-
-  /* Pointer map used to mark visited tree nodes when calling
-     walk_tree on each operand.  If set to NULL, duplicate tree nodes
-     will be visited more than once.  */
-  struct pointer_set_t *pset;
-
-  /* Operand returned by the callbacks.  This is set when calling
-     walk_gimple_seq.  If the walk_stmt_fn or walk_tree_fn callback
-     returns non-NULL, this field will contain the tree returned by
-     the last callback.  */
-  tree callback_result;
-
-  /* Indicates whether the operand being examined may be replaced
-     with something that matches is_gimple_val (if true) or something
-     slightly more complicated (if false).  "Something" technically
-     means the common subset of is_gimple_lvalue and is_gimple_rhs,
-     but we never try to form anything more complicated than that, so
-     we don't bother checking.
-
-     Also note that CALLBACK should update this flag while walking the
-     sub-expressions of a statement.  For instance, when walking the
-     statement 'foo (&var)', the flag VAL_ONLY will initially be set
-     to true, however, when walking &var, the operand of that
-     ADDR_EXPR does not need to be a GIMPLE value.  */
-  BOOL_BITFIELD val_only : 1;
-
-  /* True if we are currently walking the LHS of an assignment.  */
-  BOOL_BITFIELD is_lhs : 1;
-
-  /* Optional.  Set to true by the callback functions if they made any
-     changes.  */
-  BOOL_BITFIELD changed : 1;
-
-  /* True if we're interested in location information.  */
-  BOOL_BITFIELD want_locations : 1;
-
-  /* True if we've removed the statement that was processed.  */
-  BOOL_BITFIELD removed_stmt : 1;
-};
-
-/* Callback for walk_gimple_stmt.  Called for every statement found
-   during traversal.  The first argument points to the statement to
-   walk.  The second argument is a flag that the callback sets to
-   'true' if it the callback handled all the operands and
-   sub-statements of the statement (the default value of this flag is
-   'false').  The third argument is an anonymous pointer to data
-   to be used by the callback.  */
-typedef tree (*walk_stmt_fn) (gimple_stmt_iterator *, bool *,
-                             struct walk_stmt_info *);
-
-gimple walk_gimple_seq (gimple_seq, walk_stmt_fn, walk_tree_fn,
-                       struct walk_stmt_info *);
-gimple walk_gimple_seq_mod (gimple_seq *, walk_stmt_fn, walk_tree_fn,
-                           struct walk_stmt_info *);
-tree walk_gimple_stmt (gimple_stmt_iterator *, walk_stmt_fn, walk_tree_fn,
-                      struct walk_stmt_info *);
-tree walk_gimple_op (gimple, walk_tree_fn, struct walk_stmt_info *);
-
 /* Enum and arrays used for allocation stats.  Keep in sync with
    gimple.c:gimple_alloc_kind_names.  */
 enum gimple_alloc_kind
@@ -5593,15 +5246,6 @@ gimple_alloc_kind (enum gimple_code code)
 
 extern void dump_gimple_statistics (void);
 
-/* Set the location of all statements in SEQ to LOC.  */
-
-static inline void
-gimple_seq_set_location (gimple_seq seq, location_t loc)
-{
-  for (gimple_stmt_iterator i = gsi_start (seq); !gsi_end_p (i); gsi_next (&i))
-    gimple_set_location (gsi_stmt (i), loc);
-}
-
 /* Return true if a location should not be emitted for this statement
    by annotate_all_with_location.  */
 
@@ -5636,5 +5280,6 @@ gimple_set_do_not_emit_location (gimple g)
 
 extern void sort_case_labels (vec<tree> );
 extern void preprocess_case_label_vec_for_gimple (vec<tree> , tree, tree *);
+extern void gimple_seq_set_location (gimple_seq , location_t);
 
 #endif  /* GCC_GIMPLE_H */
index 356fc2b91a8587e983d59f67788d0d6edb2c5bf3..3253f861958d3e4cec8f5cb933324f5e234e21a0 100644 (file)
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "tree-iterator.h"
 #include "tree-inline.h"
 #include "tree-pretty-print.h"
index 1fff36c53bc73e7239db4db138dc25db0fef0515..da457d20da164d0bdbe85c56311390cb117b9263 100644 (file)
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "tree-ssa-loop.h"
 #include "dumpfile.h"
 #include "cfgloop.h"
index 207de4f1fe83788c83b71afa1936af64f691d8a9..38404f4ee408e97588388994da613ddf91cf49cf 100644 (file)
@@ -37,6 +37,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "diagnostic-core.h"
 #include "tree.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-ssa-loop-manip.h"
 #include "tree-ssa-loop.h"
index 417ea2cd153e2309788ec464a1e044dcab9e3523..f9f7004cb1dfb622f7c641c52c4bf5c3e582ea17 100644 (file)
@@ -35,6 +35,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "tree-ssa-loop.h"
 #include "tree-pass.h"
 #include "cfgloop.h"
index 36e1b55757db0bde8216bd6bd2b4b75ea7b555e9..8690313da35dcc8ef33e6be80fb4432cb4b3372f 100644 (file)
@@ -37,6 +37,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "tree-ssa-loop.h"
 #include "dumpfile.h"
 #include "cfgloop.h"
index d039c1b74e1acbd37bdfa41fd7f32276f856fe09..2260c507f8603bae21af868a5a351df67a359a62 100644 (file)
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "tree-ssa-loop.h"
 #include "dumpfile.h"
 #include "cfgloop.h"
index 2749555c3710e95c6768155b2e3917a1cc0b9133..d75359e8537304cb07b179339ee69eebba56a71e 100644 (file)
@@ -37,6 +37,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "diagnostic-core.h"
 #include "tree.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "tree-ssa-loop.h"
 #include "dumpfile.h"
 #include "gimple-pretty-print.h"
index e73a349803a823ea1c1596a1ded8854884f834b2..8ac22db553e45b28d0c2e88de2d0ff1db604dbfd 100644 (file)
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-phinodes.h"
 #include "ssa-iterators.h"
index 9ee75b87d07d25c9364f1028865d9af90021daed..b10bb46e33e096e439cd3aa2c5dbc1278ad5fdd2 100644 (file)
@@ -35,6 +35,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 176c47c980edd2aa625a7fb1371baffb7bc58afb..5223de959d54de67c842d29eb0df6315ca13ea18 100644 (file)
@@ -49,6 +49,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "diagnostic-core.h"
 #include "tree.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "tree-cfg.h"
 #include "tree-ssa-loop.h"
 #include "tree-dump.h"
index 445872387d850b0a78d58cdc4a81d56f753ad04e..2231c77ad66ceed88654d7fdcd77ebbf15b98ee7 100644 (file)
@@ -79,6 +79,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coverage.h"
 #include "ggc.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 1260069207e14d41d8c4442bfeb01180b17a5819..9b8ae3971eafbce7800f1288df4ddfb73a53ece7 100644 (file)
@@ -52,6 +52,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "cgraph.h"
 #include "tree-pass.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "ggc.h"
 #include "flags.h"
 #include "target.h"
index d1d3d71c0afd0e727ade90b78648511ff57fc7e3..327bca9e597b64ea0ec460b2efb839871f58cd8c 100644 (file)
@@ -22,6 +22,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "langhooks.h"
 #include "ggc.h"
 #include "target.h"
index d775b3178bf262656388e784ce437e51b866b8cd..9963b39f46169c49367b9c57e59ce327d67a7693 100644 (file)
@@ -37,6 +37,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "tree-cfg.h"
 #include "tree-ssa-loop-niter.h"
 #include "tree-inline.h"
index df0a44e7d5f34ecdff7701cc3c87f761280f7510..40b876653a897e27ba10dee1b0e1e9a92f2d85da 100644 (file)
@@ -79,6 +79,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "target.h"
 #include "ipa-prop.h"
 #include "gimple-ssa.h"
index ebff04f5cdc6c7dc7b7cfc63015895e2d7cd6a25..449632af38c7a246a6b86563bee3a7710a61fa69 100644 (file)
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "hashtab.h"
 #include "basic-block.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-ssanames.h"
index 55186234d8ca5133cfed439779d248bb07118a00..9a00230d463cff8650d7e3cebe1890b6756db9f5 100644 (file)
@@ -32,6 +32,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "hashtab.h"
 #include "basic-block.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-ssanames.h"
 #include "tree-pass.h"
index e383f9a97f90240cfc8c4791df1e413bbf114818..86f95a1152d98126bd6473c9c727e1d5c5b0e59e 100644 (file)
@@ -28,6 +28,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "rtl.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "tree-iterator.h"
 #include "tree-inline.h"
 #include "langhooks.h"
index 3cfa258abed599f9cded69f51b2cc776474a1118..61cac525991ac43fc06b4babeffb6ebfb7776293 100644 (file)
@@ -51,6 +51,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "target.h"
 #include "cfgloop.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "cgraph.h"
 #include "tree-cfg.h"
index 9e50560830e9d0328162d317465766c619609202..5f73b2ca462d3a9a578b412fc85b8e6b984db6e2 100644 (file)
@@ -62,6 +62,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "value-prof.h"
 #include "tree.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "tree-cfg.h"
 #include "cfgloop.h"
 #include "dumpfile.h"
index cddd9510e36164bea6cfc0e4d50455bd76fa59d4..169ed9a845d7527f598a030caffa3f152f1bd620 100644 (file)
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "tree-pretty-print.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 36f48fd17f9306aee9eb43796149c39ac64c5057..93080a8d0b85ad1820d11b73427b5bec56b7d3d7 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-13  Andrew MacLeod  <amacleod@redhat.com>
+
+       * testsuite/g++.dg/plugin/selfassign.c: Include gimple-iterator.h.
+       * testsuite/gcc.dg/plugin/selfassign.c: Likewise.
+
 2013-11-12  Jeff Law  <law@redhat.com>
 
        * PR middle-end/59119
index 5331f792cb2b5b83ccd6d5fd3c154d41c309c00d..2498153a273fc6981b7451d00c447de30b0188e4 100644 (file)
@@ -11,6 +11,7 @@
 #include "toplev.h"
 #include "basic-block.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "tree.h"
 #include "tree-pass.h"
 #include "intl.h"
index 5331f792cb2b5b83ccd6d5fd3c154d41c309c00d..2498153a273fc6981b7451d00c447de30b0188e4 100644 (file)
@@ -11,6 +11,7 @@
 #include "toplev.h"
 #include "basic-block.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "tree.h"
 #include "tree-pass.h"
 #include "intl.h"
index 86557febab7d6c8104b6468883691c610db86ac5..71a9201fd0941ba392138f381376ee9357e9685b 100644 (file)
@@ -47,6 +47,7 @@
 #include "coverage.h"
 #include "tree-pass.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "tree-cfg.h"
 #include "tree-ssa.h"
 #include "tree-inline.h"
index e821c99c9754ca2d546985485fa3cdb358f96533..195380bee4dbb38886badb1e8228248a810c9155 100644 (file)
@@ -23,6 +23,8 @@
 #include "hash-table.h"
 #include "tree.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "gimple-ssa.h"
 #include "cgraph.h"
 #include "tree-cfg.h"
index eec1b0fb739aa3f1842f14c1e1cdeb58c65a85d1..8e636463deac2f3d60dcdaaf6d5a9a9580f4c93b 100644 (file)
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "gimple-pretty-print.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-ssanames.h"
index 601efd65aa86d9464df645be31cff304c8114a3c..9cdb1a5b9781b1a5a24111c6405e5d1350c53886 100644 (file)
@@ -31,6 +31,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "ggc.h"
 #include "gimple-pretty-print.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "gimple-ssa.h"
 #include "cgraph.h"
 #include "tree-cfg.h"
index 3ca84c575bca96f7ea4372dbc7cd1a58fb6ab3bf..fbda06ab745cad4f9a67e107b566683cfe6f904f 100644 (file)
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ggc.h"
 #include "langhooks.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index b75c732e4f81c2b7d84aa28b11d6ab3102399583..188bf1a9336493a2b1870320623e70fffd47ce81 100644 (file)
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "flags.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index ffa4cbf14d7bca7cf92fa5f5942bc0329e29b91b..2aa58363224ccccb36bf47a0cf4bcefbae4bb50e 100644 (file)
@@ -79,6 +79,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "gimple-pretty-print.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "tree-ssa-loop-niter.h"
 #include "tree-ssa-loop.h"
 #include "tree-ssa.h"
index a31a0a28161a2d6df7e58db6ac213e7dbea2d2a4..91f8c0ef00d1f930d02f47dd23af2d121d3d542e 100644 (file)
@@ -33,6 +33,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "function.h"
 #include "tree-pretty-print.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "gimple-ssa.h"
 #include "tree-phinodes.h"
 #include "ssa-iterators.h"
index a489b61c3f246f10546c701e64fd5631f88ccd46..656ba6f5cb3dd07953c1629f954884dc77c2f119 100644 (file)
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "except.h"
 #include "pointer-set.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "cgraph.h"
 #include "tree-cfg.h"
index b5ca407d62e22fd9c52764f33228ff6ade76a761..11337c0c1273b389a4a7b583c8c2d44a41a43feb 100644 (file)
@@ -22,6 +22,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "tree-pass.h"
 #include "gimple-ssa.h"
 #include "cgraph.h"
index 98cb6ab606fdbb4132c1ae8f7580d6a2ea8d3e75..dc630e2d1146d3ff49d76f9c23f66d777dc59465 100644 (file)
@@ -89,6 +89,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "gimple-pretty-print.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 5d30caa6f6bb333ddb524f96460adbab0546c67f..fe5c0cb73677ee28784cdf40632e55117e42449a 100644 (file)
@@ -35,6 +35,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-iterator.h"
 #include "intl.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 981e9f4bfb4b2cd62b50d81aa19916d5560c8953..e7c5d50da0cd40ea32d5466b1602f6f10cd8e7a5 100644 (file)
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "function.h"
 #include "gimple-pretty-print.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 6adea4d7b34df6a47a0c04e853514f54c372f6fe..75d069bbbf372e17ffb7b98acd6f9f229257d359 100644 (file)
@@ -46,6 +46,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 97e4787e3c7c67d4c8d6165e92cce45d182b86db..f6baf00042d9f8ed2e6c2a8b779fd6334e9cc1f1 100644 (file)
@@ -27,6 +27,8 @@
 #include "tree-dump.h"
 #include "tree-inline.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "tree-iterator.h"
 #include "bitmap.h"
 #include "cgraph.h"
index 1425d195252045cd5d055ec5f82ce941ab5142b5..b333abf395608aba12f1afa1217d0295772a688d 100644 (file)
@@ -26,6 +26,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "tree-pretty-print.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "gimple-ssa.h"
 #include "tree-ssanames.h"
 #include "tree-pass.h"
index 576dcb786ede05e0ff282ce7d718e827e6873a26..965dffa4290f6c645d68c59a39f836553e527b1b 100644 (file)
@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-pretty-print.h"
 #include "bitmap.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-ssanames.h"
 #include "tree-pass.h"
index 4dc3f9e4a8d9cf8ac26eb877cb9861f79899dc4e..eb11c883fb4e309515a3a7c00ff138571d701d6b 100644 (file)
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "bitmap.h"
 #include "sbitmap.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index a17085c869244f8ab240b79ddeca0453498a6b30..3a478f916b0283163b54a6797877f9c624efe0dd 100644 (file)
@@ -24,6 +24,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tree.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 2cef1c4ab232e57a097340a4e5f583aec31f73da..da7bf5be978d566a9999222149def1da796c3c63 100644 (file)
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ggc.h"
 #include "basic-block.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-phinodes.h"
 #include "ssa-iterators.h"
@@ -504,5 +505,18 @@ degenerate_phi_result (gimple phi)
   return (i == gimple_phi_num_args (phi) ? val : NULL);
 }
 
+/* Set PHI nodes of a basic block BB to SEQ.  */
+
+void
+set_phi_nodes (basic_block bb, gimple_seq seq)
+{
+  gimple_stmt_iterator i;
+
+  gcc_checking_assert (!(bb->flags & BB_RTL));
+  bb->il.gimple.phi_nodes = seq;
+  if (seq)
+    for (i = gsi_start (seq); !gsi_end_p (i); gsi_next (&i))
+      gimple_set_bb (gsi_stmt (i), bb);
+}
 
 #include "gt-tree-phinodes.h"
index ae6222b336edd640f785df087090aa5fb3a16e41..4dd5e1362d31f6c8a931efc150a2dc4a2f6bc42d 100644 (file)
@@ -30,21 +30,7 @@ extern void remove_phi_args (edge);
 extern void remove_phi_node (gimple_stmt_iterator *, bool);
 extern void remove_phi_nodes (basic_block);
 extern tree degenerate_phi_result (gimple);
-
-/* Set PHI nodes of a basic block BB to SEQ.  */
-
-static inline void
-set_phi_nodes (basic_block bb, gimple_seq seq)
-{
-  gimple_stmt_iterator i;
-
-  gcc_checking_assert (!(bb->flags & BB_RTL));
-  bb->il.gimple.phi_nodes = seq;
-  if (seq)
-    for (i = gsi_start (seq); !gsi_end_p (i); gsi_next (&i))
-      gimple_set_bb (gsi_stmt (i), bb);
-}
-
+extern void set_phi_nodes (basic_block, gimple_seq);
 
 static inline use_operand_p
 gimple_phi_arg_imm_use_ptr (gimple gs, int i)
index 15aadb03eca75672633ebfcfa8c2f4c1d24d0743..e08e9b6c69730058c6ff99d37d6d1471afba938f 100644 (file)
@@ -192,6 +192,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "cfgloop.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-phinodes.h"
 #include "ssa-iterators.h"
index 9253059010831d6f6a14c5038a50110b5d76cc6d..428ffc7c46454e5a6db69997a8c3ef8ea1b74722 100644 (file)
@@ -35,6 +35,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "coverage.h"
 #include "tree.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "cgraph.h"
 #include "tree-cfg.h"
index 3702922d00161a5618481ff668524900cbc037fa..ffc6d3d09c414eff23486f74d677f860c781eb52 100644 (file)
@@ -260,6 +260,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "hash-table.h"
 #include "gimple-pretty-print.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index a4f627f23c1fda90ad9d84e0426726fb07f4f525..31fcdfeee3f84fbee2c4964109e1a03256388d0e 100644 (file)
@@ -79,6 +79,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "bitmap.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
index 70b22053be7cba419f4b1020c8ed7f03650b0705..c98c742d8b3aff760472870620f1e5efc08cd034 100644 (file)
@@ -120,6 +120,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "function.h"
 #include "gimple-pretty-print.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 252fc33a7f0896fa449a0c21091460c5c30a1be6..942602e5fe3e0ae3559245447e525127582e07fb 100644 (file)
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "bitmap.h"
 #include "dumpfile.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-phinodes.h"
 #include "ssa-iterators.h"
index 15c6896e945188383fee0f0ce738323e09c88c74..0f70372c80ef2809866fe1999ac73043925f5663 100644 (file)
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "function.h"
 #include "gimple-pretty-print.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 30b339def7d2f8c7bad79fdf41250dbee5406fe3..d71802e7a1c488590669a75f94801adbbf1d2195 100644 (file)
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "tree.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "flags.h"
 #include "basic-block.h"
 #include "function.h"
index 7a016f6240d58d96da832feb098dc6beacb95c7e..5da2106b7e7d51b77d71ed222970153e90c2839c 100644 (file)
@@ -51,6 +51,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-pretty-print.h"
 #include "basic-block.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 6a6f027e90cc62ace942ca0ba7104ea95654b95d..0ce24df2abef6c21c0b1613b3d4a6e9a38cc6ce2 100644 (file)
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "function.h"
 #include "gimple-pretty-print.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 202eb3e673b198349d49503b8888a32ceb47d09d..42e2380a0c8ca394712745196dcfc8b81a608c34 100644 (file)
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-pretty-print.h"
 #include "bitmap.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index a6afb47a4dba0f935823b3917f7936678a7d214e..71c56a050ac14f0f748241bbaf20d7536a917712 100644 (file)
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "gimple-pretty-print.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 1786f9c29d38383f540fb9a8b2d3566773d9a139..3fbaba7920b80a3a4b806c4d5d86f3f13b797378 100644 (file)
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "tree-pretty-print.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 17849a21159445a10e90255154d71b07c1c9850e..1657f6f6ca5135707426f6ea030306c6c4f94ab4 100644 (file)
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "bitmap.h"
 #include "sbitmap.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-phinodes.h"
 #include "ssa-iterators.h"
index b74c56de330d804733d806cd3116d22d0fdaecd4..57c1555d28c7e51aa849a1957761a257443c3af5 100644 (file)
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-into-ssa.h"
index 34a37633a481a1f958ad2a1d445efa79ad4abb89..48697c7fa246adfd489357d12fb32123fe07f4df 100644 (file)
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "gimple-pretty-print.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 6f8f04e457ebc10ce334521380559e5ce576b99d..9fd649e6e0930c3013cb84a0f71f08c37150e811 100644 (file)
@@ -41,6 +41,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "gimple-pretty-print.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "cgraph.h"
 #include "tree-cfg.h"
index 894ff2db521049e95ae00f2257437dc3f70d28e4..4eb615f1296bf0ff024a789b96ecd28463c62215 100644 (file)
@@ -70,6 +70,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "gimple-pretty-print.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "cgraph.h"
 #include "tree-cfg.h"
index 123a6e19c98584ba828cefae733aba98d440daf9..66c51280152cfac3854b98d4f0240e6dd4d59280 100644 (file)
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index a6adfc2f1a49b33b82d1bc20cdf67cd0e75c7c6e..79e7eff98b240ed75866fcf7f93f38e619832634 100644 (file)
@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-pretty-print.h"
 #include "intl.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 85a0b0a6f4418071bced669242211d5891ecedbb..edb49dbde8859bf937d901de6472e4048e20ffcf 100644 (file)
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "tree-pretty-print.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-ssa-loop-ivopts.h"
 #include "tree-ssa-loop-manip.h"
index 9bb002868becc921bf6951eedd3f802f7a24914e..20454f2edf498ab8fae6ebf4c70921edceb52ff3 100644 (file)
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "tree-ssa-loop-ivopts.h"
 #include "tree-ssa-loop-manip.h"
 #include "tree-ssa-loop-niter.h"
index 646f8cf1e64089ef7699e5c2b86f80e39f8e7e6e..cd654d2502ec9fc0bf98a00ea793bcef4dfd2553 100644 (file)
@@ -91,6 +91,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "flags.h"
 #include "tree.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index d79e957551616f9b2fd64eaefca7a1f6f7583d79..caa4925cfb503956cc4b8ff3507f382d06c22de2 100644 (file)
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm_p.h"
 #include "basic-block.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 61e38d5e385c0508a21da96d57e49ab2529d0e55..904d0a432ce99739b8db8abdf572e427d8923f45 100644 (file)
@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "gimple-pretty-print.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-phinodes.h"
 #include "ssa-iterators.h"
index 7e83967b0723fc2f123517e85e57c277306ed3b5..5b075077d3e1b8029981bda0f9f042769a0b6f1b 100644 (file)
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-pretty-print.h"
 #include "tree-inline.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 00780b9a74513f0bf03b0c4b249ffe4a89ca18e9..b10544836ff04ccc7973bc6a42cfc0097004a42d 100644 (file)
@@ -31,6 +31,7 @@
 #include "dumpfile.h"
 #include "sbitmap.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 6e9188457f90531abc2f57cfe27e3ab280ad3b9e..d55c943324baac5cbfef65da14539fb89e16cf02 100644 (file)
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-pretty-print.h"
 #include "tree-inline.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index a8b149287c9179d777e80a11367c77f98dda44e4..caf10bb522fc3e55a5f8b5ecf4bdbd7771e579c2 100644 (file)
@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-pretty-print.h"
 #include "tree-inline.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 0a1c4d409194900c4bf4f6c2863df8189f02dcfe..565def76ca11d0d075b168944dcb026e9cca90e6 100644 (file)
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "hash-table.h"
 #include "bitmap.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-phinodes.h"
 #include "ssa-iterators.h"
index 6f3a4cee29f2fcd7101c1afb5debefdc93aea002..d8dbf05c767fea917c2dd7337ebae017731616e0 100644 (file)
@@ -30,6 +30,7 @@
 #include "basic-block.h"
 #include "tree.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "cgraph.h"
 #include "tree-ssanames.h"
index db95ce1059c16b660fd390d31324e70f32007c9f..18c15d9110740ac2ee9574fa9340a213348274e0 100644 (file)
@@ -195,6 +195,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "flags.h"
 #include "function.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 6090c5ff5f536db6f744729df3571981caf030ac..df0c458e0195eb6d277b54dfbbadade6e7ad20e6 100644 (file)
@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-pretty-print.h"
 #include "bitmap.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-phinodes.h"
 #include "ssa-iterators.h"
index 0c9dcda5ef91def38a20fde1e365470213f98e19..c9b2c697d889f31eb03defc34ffd62eb1ade93f2 100644 (file)
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "timevar.h"
 #include "dumpfile.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index ac0d2d3bdd6323a611c3ed5c9bc6fdde2706f231..e819d65e03034e6e449bea46b8ee96401277ce8c 100644 (file)
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "function.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-phinodes.h"
 #include "tree-ssa.h"
index 5255d7fb73829b4dfc8601e38da7799fa46ac1da..25f9f45b285f77e0fcbd64aa17c944b8a4bcfa37 100644 (file)
@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "function.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 5e376a1df51407661d27becb0cbaf5f7d045d51c..a15e37c5151266e7aca91e646daabb8feee4bf57 100644 (file)
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "bitmap.h"
 #include "pointer-set.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-phinodes.h"
 #include "ssa-iterators.h"
index ae8939e2ba9179b583db3fda24a6fb8672c67edc..c774198e9abfd7760cc0b0d2f43c167bd7099f47 100644 (file)
@@ -32,6 +32,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-pretty-print.h"
 #include "pointer-set.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "gimple-ssa.h"
 #include "tree-phinodes.h"
 #include "ssa-iterators.h"
index 2c8aac289b692671da88d901dd2b7accff2b49a8..b0d2dacd8e122b03eda22bcb8761b999c2040584 100644 (file)
@@ -29,6 +29,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "target.h"
 #include "bitmap.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "gimple-ssa.h"
 #include "tree-phinodes.h"
 #include "ssa-iterators.h"
index 7096b3da3de5898751845d4c7a4829647dbf1fa5..e7ffd434888f47771c86cadfe56a7e1b02994231 100644 (file)
@@ -32,6 +32,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
 #include "tree.h"
 #include "basic-block.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "cgraph.h"
 #include "tree-cfg.h"
index 38acf7bb3428c0476c6d6af17c358b4156d69d85..eded4b690efd10bcd778c2c9d0a95934f619876c 100644 (file)
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "function.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index c4797755fde35a918db4325966a5e2fcddbfb57b..7164684c5067dfed51a24eb1fca2f7ae87388dc8 100644 (file)
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "gimple-pretty-print.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-phinodes.h"
 #include "ssa-iterators.h"
index 8fca8c14addc8b545b1c60ec7e994acdaebfdf2e..a82ecb2cd8159787efee11b5532be636c678a1fe 100644 (file)
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "langhooks.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-ssanames.h"
index 15227856033e12b36e1760dd0b6bc01c807e681c..01414ecae9126a405e37be323d3a8382e26a3593 100644 (file)
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "gimple-pretty-print.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 292e771040276e642c3549bde492eb65d512b018..8dd3c430b479713002166df7d4411458d8e4fb4f 100644 (file)
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "gimple-pretty-print.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-phinodes.h"
 #include "ssa-iterators.h"
index 51b96e15408d8ada913c5231e7349a4861e0841e..8cca6c67fc34714d8d6ba325c1dc58bccaf36f16 100644 (file)
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "gimple-pretty-print.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-phinodes.h"
 #include "ssa-iterators.h"
index 825f73a429ab2c8b4521806973e58b58936fee35..247bdfd6669ace9050d9f69bf32e28048cc3a001 100644 (file)
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "gimple-pretty-print.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-phinodes.h"
 #include "ssa-iterators.h"
index b0e0fa99b20ec8f85848521444f2f0a9518a5ae7..9dfa7bdd88ba3e451fda54e281b3879d6cda1dfb 100644 (file)
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "gimple-pretty-print.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index 8e3190fa2c16f3eb5fac6c826af099fcbee3370b..9c2cf5d1ce213553605f20668b8f9fe692a6be31 100644 (file)
@@ -63,6 +63,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "tree-pretty-print.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "gimple-ssa.h"
 #include "cgraph.h"
 #include "tree-phinodes.h"
index 8f8b5ebada78af27a953e167da9fb7d510b2e748..656e8e1c9bcda59dd2e985159114b5bcb5207c86 100644 (file)
@@ -27,6 +27,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "basic-block.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
+#include "gimple-walk.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index dd0371d0c04bf6f51154d2af5844081eac51f916..c4484536e82790a7bcaa4772e0b77851632a12a5 100644 (file)
@@ -49,6 +49,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "basic-block.h"
 #include "bitmap.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "cgraph.h"
 #include "tree-phinodes.h"
index 1d318ea85274ab1e998e5afcb618fdec792857be..0de971319add51b6d09944a494e26ed920282f9f 100644 (file)
@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "basic-block.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "function.h"
 #include "gimple-ssa.h"
 #include "cgraph.h"
index dda302dde53438b35d927ecb226b873126bceaa3..6f822f65bd1a5fab97a2c53162a0cd304bd436ac 100644 (file)
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "regs.h"
 #include "ggc.h"
 #include "gimplify.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-cfg.h"
 #include "tree-phinodes.h"
index fb26978d2736f4b0013dfeec9b60c8432218d08e..ecf1dc25e84e6c92dbe739d6d340e2fb1a6402ca 100644 (file)
@@ -139,6 +139,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree.h"
 #include "basic-block.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimple-ssa.h"
 #include "tree-phinodes.h"
 #include "ssa-iterators.h"