OSDN Git Service

* Makefile.in (PLUGIN_HEADERS): Add more headers.
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 19 Dec 2009 02:33:03 +0000 (02:33 +0000)
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 19 Dec 2009 02:33:03 +0000 (02:33 +0000)
        * tree-pass.h (GCC_PASS_LISTS): Define.
        (PASS_LIST_NO_all_lowering_passes): New enumeration value.
        (PASS_LIST_NO_all_small_ipa_passes): Likewise.
        (PASS_LIST_NO_all_regular_ipa_passes): Likewise.
        (PASS_LIST_NO_all_lto_gen_passes): Likewise.
        (PASS_LIST_NO_all_passes): Likewise.
        (PASS_LIST_NUM): Likewise.
        (gcc_pass_lists): Declare.
        * passes.c (gcc_pass_lists): Define.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155354 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/Makefile.in
gcc/passes.c
gcc/tree-pass.h

index 3480920..2c21b32 100644 (file)
@@ -1,3 +1,17 @@
+2009-12-19  Joern Rennecke  <amylaar@spamcop.net>
+
+       * Makefile.in (PLUGIN_HEADERS): Add more headers.
+
+       * tree-pass.h (GCC_PASS_LISTS): Define.
+       (PASS_LIST_NO_all_lowering_passes): New enumeration value.
+       (PASS_LIST_NO_all_small_ipa_passes): Likewise.
+       (PASS_LIST_NO_all_regular_ipa_passes): Likewise.
+       (PASS_LIST_NO_all_lto_gen_passes): Likewise.
+       (PASS_LIST_NO_all_passes): Likewise.
+       (PASS_LIST_NUM): Likewise.
+       (gcc_pass_lists): Declare.
+       * passes.c (gcc_pass_lists): Define.
+
 2009-12-18  Richard Guenther  <rguenther@suse.de>
 
        * tree-ssa-sccvn.c (copy_nary): New function.
index 21be2da..10638ef 100644 (file)
@@ -4275,7 +4275,8 @@ PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
   tree-iterator.h $(PLUGIN_H) $(TREE_FLOW_H) langhooks.h incpath.h \
   tree-ssa-sccvn.h real.h output.h $(IPA_UTILS_H) \
   $(C_PRAGMA_H)  $(CPPLIB_H)  $(FUNCTION_H) \
-  cppdefault.h flags.h $(MD5_H) params.def params.h prefix.h tree-inline.h
+  cppdefault.h flags.h $(MD5_H) params.def params.h prefix.h tree-inline.h \
+  $(IPA_PROP_H) $(RTL_H) $(TM_P_H) $(CFGLOOP_H) $(EMIT_RTL_H)
 
 # generate the 'build fragment' b-header-vars
 s-header-vars: Makefile
index a373a00..fde3379 100644 (file)
@@ -337,6 +337,11 @@ struct rtl_opt_pass pass_postreload =
 struct opt_pass *all_passes, *all_small_ipa_passes, *all_lowering_passes,
   *all_regular_ipa_passes, *all_lto_gen_passes;
 
+/* This is used by plugins, and should also be used in register_pass.  */
+#define DEF_PASS_LIST(LIST) &LIST,
+struct opt_pass **gcc_pass_lists[] = { GCC_PASS_LISTS NULL };
+#undef DEF_PASS_LIST
+
 /* A map from static pass id to optimization pass.  */
 struct opt_pass **passes_by_id;
 int passes_by_id_size;
index b997eb1..40cfb0f 100644 (file)
@@ -562,6 +562,27 @@ extern struct gimple_opt_pass pass_convert_switch;
 extern struct opt_pass *all_passes, *all_small_ipa_passes, *all_lowering_passes,
                        *all_regular_ipa_passes, *all_lto_gen_passes;
 
+/* Define a list of pass lists so that both passes.c and plugins can easily
+   find all the pass lists.  */
+#define GCC_PASS_LISTS \
+  DEF_PASS_LIST (all_lowering_passes) \
+  DEF_PASS_LIST (all_small_ipa_passes) \
+  DEF_PASS_LIST (all_regular_ipa_passes) \
+  DEF_PASS_LIST (all_lto_gen_passes) \
+  DEF_PASS_LIST (all_passes)
+
+#define DEF_PASS_LIST(LIST) PASS_LIST_NO_##LIST,
+enum
+{
+  GCC_PASS_LISTS
+  PASS_LIST_NUM
+};
+#undef DEF_PASS_LIST
+
+/* This is used by plugins, and should also be used in
+   passes.c:register_pass.  */
+extern struct opt_pass **gcc_pass_lists[];
+
 /* Current optimization pass.  */
 extern struct opt_pass *current_pass;