From 2a5e9d165ef6cc2cb3b783b5aa1c4a37dfd166aa Mon Sep 17 00:00:00 2001 From: Joern Rennecke Date: Sat, 19 Dec 2009 02:33:03 +0000 Subject: [PATCH] Makefile.in (PLUGIN_HEADERS): Add more headers. * 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. From-SVN: r155354 --- gcc/ChangeLog | 14 ++++++++++++++ gcc/Makefile.in | 3 ++- gcc/passes.c | 5 +++++ gcc/tree-pass.h | 21 +++++++++++++++++++++ 4 files changed, 42 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 34809207012..2c21b321a4b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2009-12-19 Joern Rennecke + + * 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 * tree-ssa-sccvn.c (copy_nary): New function. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 21be2daef98..10638ef70d4 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -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 diff --git a/gcc/passes.c b/gcc/passes.c index a373a004928..fde3379b7c2 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -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; diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index b997eb126ec..40cfb0f6891 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -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; -- 2.30.2