From 275b769bf477e9dd3d9b7a9855a8919c40d503bb Mon Sep 17 00:00:00 2001 From: espindola Date: Mon, 29 Jun 2009 21:17:40 +0000 Subject: 2009-06-29 Olatunji Ruwase * doc/plugins.texi: Document PLUGIN_START_UNIT. * toplev.c (compile_file): Call PLUGIN_START_UNIT. * gcc-plugin.h (PLUGIN_START_UNIT): Added new event. * plugin.c (plugin_event_name): Added PLUGIN_START_UNIT. (register_callback): Handle PLUGIN_START_UNIT. (invoke_plugin_callbacks): Handle PLUGIN_START_UNIT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149064 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/plugin.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/plugin.c') diff --git a/gcc/plugin.c b/gcc/plugin.c index 396850a3a97..f6578505b88 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -57,6 +57,7 @@ const char *plugin_event_name[] = "PLUGIN_GGC_MARKING", "PLUGIN_GGC_END", "PLUGIN_REGISTER_GGC_ROOTS", + "PLUGIN_START_UNIT", "PLUGIN_EVENT_LAST" }; @@ -499,6 +500,7 @@ register_callback (const char *plugin_name, ggc_register_root_tab ((const struct ggc_root_tab*) user_data); break; case PLUGIN_FINISH_TYPE: + case PLUGIN_START_UNIT: case PLUGIN_FINISH_UNIT: case PLUGIN_CXX_CP_PRE_GENERICIZE: case PLUGIN_GGC_START: @@ -544,6 +546,7 @@ invoke_plugin_callbacks (enum plugin_event event, void *gcc_data) switch (event) { case PLUGIN_FINISH_TYPE: + case PLUGIN_START_UNIT: case PLUGIN_FINISH_UNIT: case PLUGIN_CXX_CP_PRE_GENERICIZE: case PLUGIN_ATTRIBUTES: -- cgit v1.2.1 From 75abcc2ac0e798311a13d5e40d4597bdab2682d0 Mon Sep 17 00:00:00 2001 From: bstarynk Date: Thu, 9 Jul 2009 17:57:14 +0000 Subject: 2009-07-09 Basile Starynkevitch * gcc/plugin.c (try_init_one_plugin): passes RTLD_GLOBAL to dlopen. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149424 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/plugin.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc/plugin.c') diff --git a/gcc/plugin.c b/gcc/plugin.c index f6578505b88..906068387b7 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -592,7 +592,11 @@ try_init_one_plugin (struct plugin_name_args *plugin) char *err; PTR_UNION_TYPE (plugin_init_func) plugin_init_union; - dl_handle = dlopen (plugin->full_name, RTLD_NOW); + /* We use RTLD_NOW to accelerate binding and detect any mismatch + between the API expected by the plugin and the GCC API; we use + RTLD_GLOBAL which is useful to plugins which themselves call + dlopen. */ + dl_handle = dlopen (plugin->full_name, RTLD_NOW | RTLD_GLOBAL); if (!dl_handle) { error ("Cannot load plugin %s\n%s", plugin->full_name, dlerror ()); -- cgit v1.2.1 From 86b6369622fb5ab4b0fc6e5bd2ff40cb25ad4166 Mon Sep 17 00:00:00 2001 From: baldrick Date: Mon, 28 Sep 2009 08:50:39 +0000 Subject: Add support for using ggc cache tables from plugins. Approved by Ian Lance Taylor. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152232 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/plugin.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gcc/plugin.c') diff --git a/gcc/plugin.c b/gcc/plugin.c index 906068387b7..7d6e85f9cef 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -57,6 +57,7 @@ const char *plugin_event_name[] = "PLUGIN_GGC_MARKING", "PLUGIN_GGC_END", "PLUGIN_REGISTER_GGC_ROOTS", + "PLUGIN_REGISTER_GGC_CACHES", "PLUGIN_START_UNIT", "PLUGIN_EVENT_LAST" }; @@ -499,6 +500,10 @@ register_callback (const char *plugin_name, gcc_assert (!callback); ggc_register_root_tab ((const struct ggc_root_tab*) user_data); break; + case PLUGIN_REGISTER_GGC_CACHES: + gcc_assert (!callback); + ggc_register_cache_tab ((const struct ggc_cache_tab*) user_data); + break; case PLUGIN_FINISH_TYPE: case PLUGIN_START_UNIT: case PLUGIN_FINISH_UNIT: @@ -566,6 +571,7 @@ invoke_plugin_callbacks (enum plugin_event event, void *gcc_data) case PLUGIN_PASS_MANAGER_SETUP: case PLUGIN_EVENT_LAST: case PLUGIN_REGISTER_GGC_ROOTS: + case PLUGIN_REGISTER_GGC_CACHES: default: gcc_assert (false); } -- cgit v1.2.1 From 3efe62a1e32fd627e119c0e14f43a2e8c9149278 Mon Sep 17 00:00:00 2001 From: ian Date: Mon, 28 Sep 2009 23:15:35 +0000 Subject: * tree-pass.h (register_pass_info): New structure. (pass_positioning_ops): Move enum from gcc-plugin.h. (register_pass): New function. * gcc-plugin.h (plugin_pass): Delete structure. (pass_positioning_ops): Delete enum. * plugin.c (regsiter_pass): Delete function. (position_pass): Delete function. (added_pass_nodes): Delete variable. (prev_added_pass_nodes): Delete variable. (pass_list_node): Delete structure. * passes.c (make_pass_instance): New function. (next_pass_1): Change to call make_pass_instance. (pass_list_node): Move structure from gcc-plugin.h. (added_pass_nodes): Move variable from plugin.c. (prev_added_pass_nodes): Move variable from plugin.c. (position_pass): New function. (register_pass): New function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152257 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/plugin.c | 189 +---------------------------------------------------------- 1 file changed, 1 insertion(+), 188 deletions(-) (limited to 'gcc/plugin.c') diff --git a/gcc/plugin.c b/gcc/plugin.c index 7d6e85f9cef..414d5783fa5 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -78,20 +78,6 @@ struct callback_info /* An array of lists of 'callback_info' objects indexed by the event id. */ static struct callback_info *plugin_callbacks[PLUGIN_EVENT_LAST] = { NULL }; -/* List node for an inserted pass instance. We need to keep track of all - the newly-added pass instances (with 'added_pass_nodes' defined below) - so that we can register their dump files after pass-positioning is finished. - Registering dumping files needs to be post-processed or the - static_pass_number of the opt_pass object would be modified and mess up - the dump file names of future pass instances to be added. */ -struct pass_list_node -{ - struct opt_pass *pass; - struct pass_list_node *next; -}; - -static struct pass_list_node *added_pass_nodes = NULL; -static struct pass_list_node *prev_added_pass_node; #ifdef ENABLE_PLUGIN /* Each plugin should define an initialization function with exactly @@ -287,179 +273,6 @@ parse_plugin_arg_opt (const char *arg) XDELETEVEC (name); } - -/* Insert the plugin pass at the proper position. Return true if the pass - is successfully added. - - PLUGIN_PASS_INFO - new pass to be inserted - PASS_LIST - root of the pass list to insert the new pass to */ - -static bool -position_pass (struct plugin_pass *plugin_pass_info, - struct opt_pass **pass_list) -{ - struct opt_pass *pass = *pass_list, *prev_pass = NULL; - bool success = false; - - for ( ; pass; prev_pass = pass, pass = pass->next) - { - /* Check if the current pass is of the same type as the new pass and - matches the name and the instance number of the reference pass. */ - if (pass->type == plugin_pass_info->pass->type - && pass->name - && !strcmp (pass->name, plugin_pass_info->reference_pass_name) - && ((plugin_pass_info->ref_pass_instance_number == 0) - || (plugin_pass_info->ref_pass_instance_number == - pass->static_pass_number) - || (plugin_pass_info->ref_pass_instance_number == 1 - && pass->todo_flags_start & TODO_mark_first_instance))) - { - struct opt_pass *new_pass = plugin_pass_info->pass; - struct pass_list_node *new_pass_node; - - /* The following code (if-statement) is adopted from next_pass_1. */ - if (new_pass->static_pass_number) - { - new_pass = XNEW (struct opt_pass); - memcpy (new_pass, plugin_pass_info->pass, sizeof (*new_pass)); - new_pass->next = NULL; - - new_pass->todo_flags_start &= ~TODO_mark_first_instance; - - plugin_pass_info->pass->static_pass_number -= 1; - new_pass->static_pass_number = - -plugin_pass_info->pass->static_pass_number; - } - else - { - new_pass->todo_flags_start |= TODO_mark_first_instance; - new_pass->static_pass_number = -1; - } - - /* Insert the new pass instance based on the positioning op. */ - switch (plugin_pass_info->pos_op) - { - case PASS_POS_INSERT_AFTER: - new_pass->next = pass->next; - pass->next = new_pass; - - /* Skip newly inserted pass to avoid repeated - insertions in the case where the new pass and the - existing one have the same name. */ - pass = new_pass; - break; - case PASS_POS_INSERT_BEFORE: - new_pass->next = pass; - if (prev_pass) - prev_pass->next = new_pass; - else - *pass_list = new_pass; - break; - case PASS_POS_REPLACE: - new_pass->next = pass->next; - if (prev_pass) - prev_pass->next = new_pass; - else - *pass_list = new_pass; - new_pass->sub = pass->sub; - new_pass->tv_id = pass->tv_id; - pass = new_pass; - break; - default: - error ("Invalid pass positioning operation"); - return false; - } - - /* Save the newly added pass (instance) in the added_pass_nodes - list so that we can register its dump file later. Note that - we cannot register the dump file now because doing so will modify - the static_pass_number of the opt_pass object and therefore - mess up the dump file name of future instances. */ - new_pass_node = XCNEW (struct pass_list_node); - new_pass_node->pass = new_pass; - if (!added_pass_nodes) - added_pass_nodes = new_pass_node; - else - prev_added_pass_node->next = new_pass_node; - prev_added_pass_node = new_pass_node; - - success = true; - } - - if (pass->sub && position_pass (plugin_pass_info, &pass->sub)) - success = true; - } - - return success; -} - - -/* Hook into the pass lists (trees) a new pass registered by a plugin. - - PLUGIN_NAME - display name for the plugin - PASS_INFO - plugin pass information that specifies the opt_pass object, - reference pass, instance number, and how to position - the pass */ - -static void -register_pass (const char *plugin_name, struct plugin_pass *pass_info) -{ - if (!pass_info->pass) - { - error ("No pass specified when registering a new pass in plugin %s", - plugin_name); - return; - } - - if (!pass_info->reference_pass_name) - { - error ("No reference pass specified for positioning the pass " - " from plugin %s", plugin_name); - return; - } - - /* Try to insert the new pass to the pass lists. We need to check all - three lists as the reference pass could be in one (or all) of them. */ - if (!position_pass (pass_info, &all_lowering_passes) - && !position_pass (pass_info, &all_ipa_passes) - && !position_pass (pass_info, &all_passes)) - error ("Failed to position pass %s registered by plugin %s. " - "Cannot find the (specified instance of) reference pass %s", - pass_info->pass->name, plugin_name, pass_info->reference_pass_name); - else - { - /* OK, we have successfully inserted the new pass. We need to register - the dump files for the newly added pass and its duplicates (if any). - Because the registration of plugin passes happens after the - command-line options are parsed, the options that specify single - pass dumping (e.g. -fdump-tree-PASSNAME) cannot be used for new - plugin passes. Therefore we currently can only enable dumping of - new plugin passes when the 'dump-all' flags (e.g. -fdump-tree-all) - are specified. While doing so, we also delete the pass_list_node - objects created during pass positioning. */ - while (added_pass_nodes) - { - struct pass_list_node *next_node = added_pass_nodes->next; - enum tree_dump_index tdi; - register_one_dump_file (added_pass_nodes->pass); - if (added_pass_nodes->pass->type == SIMPLE_IPA_PASS - || added_pass_nodes->pass->type == IPA_PASS) - tdi = TDI_ipa_all; - else if (added_pass_nodes->pass->type == GIMPLE_PASS) - tdi = TDI_tree_all; - else - tdi = TDI_rtl_all; - /* Check if dump-all flag is specified. */ - if (get_dump_file_info (tdi)->state) - get_dump_file_info (added_pass_nodes->pass->static_pass_number) - ->state = get_dump_file_info (tdi)->state; - XDELETE (added_pass_nodes); - added_pass_nodes = next_node; - } - } -} - - /* Register additional plugin information. NAME is the name passed to plugin_init. INFO is the information that should be registered. */ @@ -490,7 +303,7 @@ register_callback (const char *plugin_name, { case PLUGIN_PASS_MANAGER_SETUP: gcc_assert (!callback); - register_pass (plugin_name, (struct plugin_pass *) user_data); + register_pass ((struct register_pass_info *) user_data); break; case PLUGIN_INFO: gcc_assert (!callback); -- cgit v1.2.1 From b48e605377c311f7b5e2da6493c53aba87426cbf Mon Sep 17 00:00:00 2001 From: gerald Date: Sun, 11 Oct 2009 09:17:09 +0000 Subject: * plugin.c (try_init_one_plugin): Improve constness of variable err. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152638 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/plugin.c') diff --git a/gcc/plugin.c b/gcc/plugin.c index 414d5783fa5..18b7c8aecad 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -408,7 +408,7 @@ try_init_one_plugin (struct plugin_name_args *plugin) { void *dl_handle; plugin_init_func plugin_init; - char *err; + const char *err; PTR_UNION_TYPE (plugin_init_func) plugin_init_union; /* We use RTLD_NOW to accelerate binding and detect any mismatch -- cgit v1.2.1 From 329786f768e46cd0451bba1aea787283ea8cdea3 Mon Sep 17 00:00:00 2001 From: espindola Date: Fri, 6 Nov 2009 19:20:39 +0000 Subject: 2009-11-06 Basile Starynkevitch * doc/plugins.texi (Plugin callbacks): added PLUGIN_PRAGMAS. * c-pragma.c: Include "plugin.h". (init_pragma): Invoke PLUGIN_PRAGMAS. * gcc-plugin.h: Added PLUGIN_PRAGMAS. * plugin.c (plugin_event_name): Added PLUGIN_PRAGMAS & the missing PLUGIN_ATTRIBUTES. (register_callback): Added PLUGIN_PRAGMAS. Fixed typo in message error for unknown callback event. (invoke_plugin_callbacks): Added PLUGIN_PRAGMAS. * Makefile.in (c-pragma.o): Added dependency upon plugin.h. (PLUGIN_HEADERS): added plugin.h. 2009-11-06 Basile Starynkevitch * g++.dg/plugin/pragma_plugin-test-1.C: new testcase for PLUGIN_PRAGMAS. * g++.dg/plugin/pragma_plugin.c: new test plugin for PLUGIN_PRAGMAS. * g++.dg/plugin/plugin.exp (plugin_test_list): Add pragma_plugin.c and pragma_plugin-test-1.C. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153975 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/plugin.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gcc/plugin.c') diff --git a/gcc/plugin.c b/gcc/plugin.c index 18b7c8aecad..2d64422787e 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -58,7 +58,9 @@ const char *plugin_event_name[] = "PLUGIN_GGC_END", "PLUGIN_REGISTER_GGC_ROOTS", "PLUGIN_REGISTER_GGC_CACHES", - "PLUGIN_START_UNIT", + "PLUGIN_ATTRIBUTES", + "PLUGIN_START_UNIT", + "PLUGIN_PRAGMAS", "PLUGIN_EVENT_LAST" }; @@ -325,6 +327,7 @@ register_callback (const char *plugin_name, case PLUGIN_GGC_MARKING: case PLUGIN_GGC_END: case PLUGIN_ATTRIBUTES: + case PLUGIN_PRAGMAS: case PLUGIN_FINISH: { struct callback_info *new_callback; @@ -344,7 +347,7 @@ register_callback (const char *plugin_name, break; case PLUGIN_EVENT_LAST: default: - error ("Unkown callback event registered by plugin %s", + error ("Unknown callback event registered by plugin %s", plugin_name); } } @@ -368,6 +371,7 @@ invoke_plugin_callbacks (enum plugin_event event, void *gcc_data) case PLUGIN_FINISH_UNIT: case PLUGIN_CXX_CP_PRE_GENERICIZE: case PLUGIN_ATTRIBUTES: + case PLUGIN_PRAGMAS: case PLUGIN_FINISH: case PLUGIN_GGC_START: case PLUGIN_GGC_MARKING: -- cgit v1.2.1 From b2b1a2097444d24126d636778d16aae1c5d2370e Mon Sep 17 00:00:00 2001 From: bstarynk Date: Thu, 19 Nov 2009 17:21:50 +0000 Subject: 2009-11-19 Basile Starynkevitch * gcc/plugin.c (FMT_FOR_PLUGIN_EVENT): added definition. (dump_active_plugins): output to file everything. Use internationalized dump & FMT_FOR_PLUGIN_EVENT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154337 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/plugin.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'gcc/plugin.c') diff --git a/gcc/plugin.c b/gcc/plugin.c index 2d64422787e..bb967c385fe 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -64,6 +64,9 @@ const char *plugin_event_name[] = "PLUGIN_EVENT_LAST" }; +/* A printf format large enough for the largest event above. */ +#define FMT_FOR_PLUGIN_EVENT "%-26s" + /* Hash table for the plugin_name_args objects created during command-line parsing. */ static htab_t plugin_name_args_tab = NULL; @@ -637,18 +640,18 @@ dump_active_plugins (FILE *file) if (!plugins_active_p ()) return; - fprintf (stderr, "Event\t\t\tPlugins\n"); + fprintf (file, FMT_FOR_PLUGIN_EVENT " | %s\n", _("Event"), _("Plugins")); for (event = PLUGIN_PASS_MANAGER_SETUP; event < PLUGIN_EVENT_LAST; event++) if (plugin_callbacks[event]) { struct callback_info *ci; - fprintf (file, "%s\t", plugin_event_name[event]); + fprintf (file, FMT_FOR_PLUGIN_EVENT " |", plugin_event_name[event]); for (ci = plugin_callbacks[event]; ci; ci = ci->next) - fprintf (file, "%s ", ci->plugin_name); + fprintf (file, " %s", ci->plugin_name); - fprintf (file, "\n"); + putc('\n', file); } } -- cgit v1.2.1 From 48e1416a24d50cacbb2a5e06a9ee61dd8cbee313 Mon Sep 17 00:00:00 2001 From: hjl Date: Wed, 25 Nov 2009 10:55:54 +0000 Subject: Remove trailing white spaces. 2009-11-25 H.J. Lu * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.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-live.h: 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-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: 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-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.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-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154645 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/plugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/plugin.c') diff --git a/gcc/plugin.c b/gcc/plugin.c index bb967c385fe..c43e0c844a1 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -132,7 +132,7 @@ add_new_plugin (const char* plugin_name) void **slot; char *base_name = get_plugin_base_name (plugin_name); - /* If this is the first -fplugin= option we encounter, create + /* If this is the first -fplugin= option we encounter, create 'plugin_name_args_tab' hash table. */ if (!plugin_name_args_tab) plugin_name_args_tab = htab_create (10, htab_hash_string, htab_str_eq, @@ -493,7 +493,7 @@ initialize_plugins (void) return; timevar_push (TV_PLUGIN_INIT); - + #ifdef ENABLE_PLUGIN /* Traverse and initialize each plugin specified in the command-line. */ htab_traverse_noresize (plugin_name_args_tab, init_one_plugin, NULL); -- cgit v1.2.1 From c9036234fbf4b8b9c2b26ea3ba46e3bacd6d46fa Mon Sep 17 00:00:00 2001 From: amylaar Date: Tue, 1 Dec 2009 19:12:29 +0000 Subject: 2009-12-01 Grigori Fursin Joern Rennecke * cgraphunit.c (plugin.h): Include. (ipa_passes): Invoke PLUGIN_ALL_IPA_PASSES_START / PLUGIN_ALL_IPA_PASSES_END at start / end of processing. * gcc-plugin.h (highlev-plugin-common.h, hashtab.h): Include. (enum plugin_event): Define by including plugin.def. Last enumerator is now called PLUGIN_EVENT_FIRST_DYNAMIC. (plugin_event_name): Change type to const char **. (get_event_last, get_named_event_id, unregister_callback): Declare. (register_callback): Change type of event argument to int. (highlev-plugin-common.h): New file. * Makefile.in (GCC_PLUGIN_H): Add highlev-plugin-common.h and $(HASHTAB_H) (tree-optimize.o passes.o): Depend on $(PLUGIN_H). (PLUGIN_HEADERS): Add opts.h, $(PARAMS_H) and plugin.def. (s-header-vars): New rule. (install-plugin): Depend on s-header-vars. Install b-header-vars. * params.c (get_num_compiler_params): New function. * params.h (get_num_compiler_params): Declare. * passes.c (plugin.h): Include. (make_pass_instance): Invoke PLUGIN_NEW_PASS. (do_per_function_toporder, pass_init_dump_file): No longer static. (pass_fini_dump_file): Likewise. (execute_one_pass): Likewise. Invoke PLUGIN_OVERRIDE_GATE and PLUGIN_PASS_EXECUTION. (execute_ipa_pass_list): Invoke PLUGIN_EARLY_GIMPLE_PASSES_START and PLUGIN_EARLY_GIMPLE_PASSES_END. * plugin.c (plugin_event_name_init): New array, defined by including plugin.def. (FMT_FOR_PLUGIN_EVENT): Update. (plugin_event_name): Change type to const char ** and initialize to plugin_event_name_init. (event_tab, event_last, event_horizon): New variable. (get_event_last): New function. (plugin_callbacks_init): New array. (plugin_callbacks: Change type to struct callback_info **. Initialize to plugin_callbacks_init. (htab_event_eq, get_named_event_id, unregister_callback): New function. (invoke_plugin_va_callbacks): Likewise. (register_callback): Change type of event argument to int. Handle new events. Allow dynamic events. (invoke_plugin_callbacks): Likewise. Return success status. (plugins_active_p): Allow dynamic callbacks. * plugin.def: New file. * plugin.h (invoke_plugin_callbacks): Update prototype. (invoke_plugin_va_callbacks): Declare. * tree-optimize.c (plugin.h): Include. (tree_rest_of_compilation): Invoke PLUGIN_ALL_PASSES_START and PLUGIN_ALL_PASSES_END. * tree-pass.h (execute_one_pass, pass_init_dump_file): Declare. (pass_fini_dump_file, do_per_function_toporder): Likewise. * doc/plugin.texi: Document new event types. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154877 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/plugin.c | 190 ++++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 161 insertions(+), 29 deletions(-) (limited to 'gcc/plugin.c') diff --git a/gcc/plugin.c b/gcc/plugin.c index c43e0c844a1..84c9f4434dc 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -44,28 +44,30 @@ along with GCC; see the file COPYING3. If not see #include "plugin-version.h" #endif +#define GCC_PLUGIN_STRINGIFY0(X) #X +#define GCC_PLUGIN_STRINGIFY1(X) GCC_PLUGIN_STRINGIFY0 (X) + /* Event names as strings. Keep in sync with enum plugin_event. */ -const char *plugin_event_name[] = +static const char *plugin_event_name_init[] = { - "PLUGIN_PASS_MANAGER_SETUP", - "PLUGIN_FINISH_TYPE", - "PLUGIN_FINISH_UNIT", - "PLUGIN_CXX_CP_PRE_GENERICIZE", - "PLUGIN_FINISH", - "PLUGIN_INFO", - "PLUGIN_GGC_START", - "PLUGIN_GGC_MARKING", - "PLUGIN_GGC_END", - "PLUGIN_REGISTER_GGC_ROOTS", - "PLUGIN_REGISTER_GGC_CACHES", - "PLUGIN_ATTRIBUTES", - "PLUGIN_START_UNIT", - "PLUGIN_PRAGMAS", - "PLUGIN_EVENT_LAST" +# define DEFEVENT(NAME) GCC_PLUGIN_STRINGIFY1 (NAME), +# include "plugin.def" +# undef DEFEVENT }; /* A printf format large enough for the largest event above. */ -#define FMT_FOR_PLUGIN_EVENT "%-26s" +#define FMT_FOR_PLUGIN_EVENT "%-32s" + +const char **plugin_event_name = plugin_event_name_init; + +/* A hash table to map event names to the position of the names in the + plugin_event_name table. */ +static htab_t event_tab; + +/* Keep track of the limit of allocated events and space ready for + allocating events. */ +static int event_last = PLUGIN_EVENT_FIRST_DYNAMIC; +static int event_horizon = PLUGIN_EVENT_FIRST_DYNAMIC; /* Hash table for the plugin_name_args objects created during command-line parsing. */ @@ -81,7 +83,8 @@ struct callback_info }; /* An array of lists of 'callback_info' objects indexed by the event id. */ -static struct callback_info *plugin_callbacks[PLUGIN_EVENT_LAST] = { NULL }; +static struct callback_info *plugin_callbacks_init[PLUGIN_EVENT_FIRST_DYNAMIC]; +static struct callback_info **plugin_callbacks = plugin_callbacks_init; #ifdef ENABLE_PLUGIN @@ -290,6 +293,71 @@ register_plugin_info (const char* name, struct plugin_info *info) plugin->help = info->help; } +/* Helper function for the event hash table that compares the name of an + existing entry (E1) with the given string (S2). */ + +static int +htab_event_eq (const void *e1, const void *s2) +{ + const char *s1= *(const char * const *) e1; + return !strcmp (s1, (const char *) s2); +} + +/* Look up the event id for NAME. If the name is not found, return -1 + if INSERT is NO_INSERT. */ + +int +get_named_event_id (const char *name, enum insert_option insert) +{ + void **slot; + + if (!event_tab) + { + int i; + + event_tab = htab_create (150, htab_hash_string, htab_event_eq, NULL); + for (i = 0; i < PLUGIN_EVENT_FIRST_DYNAMIC; i++) + { + slot = htab_find_slot (event_tab, plugin_event_name[i], INSERT); + gcc_assert (*slot == HTAB_EMPTY_ENTRY); + *slot = &plugin_event_name[i]; + } + } + slot = htab_find_slot (event_tab, name, insert); + if (slot == NULL) + return -1; + if (*slot != HTAB_EMPTY_ENTRY) + return (const char **) *slot - &plugin_event_name[0]; + + if (event_last >= event_horizon) + { + event_horizon = event_last * 2; + if (plugin_event_name == plugin_event_name_init) + { + plugin_event_name = XNEWVEC (const char *, event_horizon); + memcpy (plugin_event_name, plugin_event_name_init, + sizeof plugin_event_name_init); + plugin_callbacks = XNEWVEC (struct callback_info *, event_horizon); + memcpy (plugin_callbacks, plugin_callbacks_init, + sizeof plugin_callbacks_init); + } + else + { + plugin_event_name + = XRESIZEVEC (const char *, plugin_event_name, event_horizon); + plugin_callbacks = XRESIZEVEC (struct callback_info *, + plugin_callbacks, event_horizon); + } + /* All the pointers in the hash table will need to be updated. */ + htab_delete (event_tab); + event_tab = NULL; + } + else + *slot = &plugin_event_name[event_last]; + plugin_event_name[event_last] = name; + return event_last++; +} + /* Called from the plugin's initialization code. Register a single callback. This function can be called multiple times. @@ -300,7 +368,7 @@ register_plugin_info (const char* name, struct plugin_info *info) void register_callback (const char *plugin_name, - enum plugin_event event, + int event, plugin_callback_func callback, void *user_data) { @@ -322,6 +390,15 @@ register_callback (const char *plugin_name, gcc_assert (!callback); ggc_register_cache_tab ((const struct ggc_cache_tab*) user_data); break; + case PLUGIN_EVENT_FIRST_DYNAMIC: + default: + if (event < PLUGIN_EVENT_FIRST_DYNAMIC || event >= event_last) + { + error ("Unknown callback event registered by plugin %s", + plugin_name); + return; + } + /* Fall through. */ case PLUGIN_FINISH_TYPE: case PLUGIN_START_UNIT: case PLUGIN_FINISH_UNIT: @@ -332,6 +409,15 @@ register_callback (const char *plugin_name, case PLUGIN_ATTRIBUTES: case PLUGIN_PRAGMAS: case PLUGIN_FINISH: + case PLUGIN_ALL_PASSES_START: + case PLUGIN_ALL_PASSES_END: + case PLUGIN_ALL_IPA_PASSES_START: + case PLUGIN_ALL_IPA_PASSES_END: + case PLUGIN_OVERRIDE_GATE: + case PLUGIN_PASS_EXECUTION: + case PLUGIN_EARLY_GIMPLE_PASSES_START: + case PLUGIN_EARLY_GIMPLE_PASSES_END: + case PLUGIN_NEW_PASS: { struct callback_info *new_callback; if (!callback) @@ -348,27 +434,52 @@ register_callback (const char *plugin_name, plugin_callbacks[event] = new_callback; } break; - case PLUGIN_EVENT_LAST: - default: - error ("Unknown callback event registered by plugin %s", - plugin_name); } } +/* Remove a callback for EVENT which has been registered with for a plugin + PLUGIN_NAME. Return PLUGEVT_SUCCESS if a matching callback was + found & removed, PLUGEVT_NO_CALLBACK if the event does not have a matching + callback, and PLUGEVT_NO_SUCH_EVENT if EVENT is invalid. */ +int +unregister_callback (const char *plugin_name, int event) +{ + struct callback_info *callback, **cbp; + + if (event >= event_last) + return PLUGEVT_NO_SUCH_EVENT; + + for (cbp = &plugin_callbacks[event]; (callback = *cbp); cbp = &callback->next) + if (strcmp (callback->plugin_name, plugin_name) == 0) + { + *cbp = callback->next; + return PLUGEVT_SUCCESS; + } + return PLUGEVT_NO_CALLBACK; +} /* Called from inside GCC. Invoke all plug-in callbacks registered with the specified event. + Return PLUGEVT_SUCCESS if at least one callback was called, + PLUGEVT_NO_CALLBACK if there was no callback. EVENT - the event identifier GCC_DATA - event-specific data provided by the compiler */ -void -invoke_plugin_callbacks (enum plugin_event event, void *gcc_data) +int +invoke_plugin_callbacks (int event, void *gcc_data) { + int retval = PLUGEVT_SUCCESS; + timevar_push (TV_PLUGIN_RUN); switch (event) { + case PLUGIN_EVENT_FIRST_DYNAMIC: + default: + gcc_assert (event >= PLUGIN_EVENT_FIRST_DYNAMIC); + gcc_assert (event < event_last); + /* Fall through. */ case PLUGIN_FINISH_TYPE: case PLUGIN_START_UNIT: case PLUGIN_FINISH_UNIT: @@ -379,24 +490,35 @@ invoke_plugin_callbacks (enum plugin_event event, void *gcc_data) case PLUGIN_GGC_START: case PLUGIN_GGC_MARKING: case PLUGIN_GGC_END: + case PLUGIN_ALL_PASSES_START: + case PLUGIN_ALL_PASSES_END: + case PLUGIN_ALL_IPA_PASSES_START: + case PLUGIN_ALL_IPA_PASSES_END: + case PLUGIN_OVERRIDE_GATE: + case PLUGIN_PASS_EXECUTION: + case PLUGIN_EARLY_GIMPLE_PASSES_START: + case PLUGIN_EARLY_GIMPLE_PASSES_END: + case PLUGIN_NEW_PASS: { /* Iterate over every callback registered with this event and call it. */ struct callback_info *callback = plugin_callbacks[event]; + + if (!callback) + retval = PLUGEVT_NO_CALLBACK; for ( ; callback; callback = callback->next) (*callback->func) (gcc_data, callback->user_data); } break; case PLUGIN_PASS_MANAGER_SETUP: - case PLUGIN_EVENT_LAST: case PLUGIN_REGISTER_GGC_ROOTS: case PLUGIN_REGISTER_GGC_CACHES: - default: gcc_assert (false); } timevar_pop (TV_PLUGIN_RUN); + return retval; } #ifdef ENABLE_PLUGIN @@ -621,7 +743,7 @@ plugins_active_p (void) { int event; - for (event = PLUGIN_PASS_MANAGER_SETUP; event < PLUGIN_EVENT_LAST; event++) + for (event = PLUGIN_PASS_MANAGER_SETUP; event < event_last; event++) if (plugin_callbacks[event]) return true; @@ -641,7 +763,7 @@ dump_active_plugins (FILE *file) return; fprintf (file, FMT_FOR_PLUGIN_EVENT " | %s\n", _("Event"), _("Plugins")); - for (event = PLUGIN_PASS_MANAGER_SETUP; event < PLUGIN_EVENT_LAST; event++) + for (event = PLUGIN_PASS_MANAGER_SETUP; event < event_last; event++) if (plugin_callbacks[event]) { struct callback_info *ci; @@ -686,3 +808,13 @@ plugin_default_version_check (struct plugin_gcc_version *gcc_version, return false; return true; } + +/* Return the current value of event_last, so that plugins which provide + additional functionality for events for the benefit of high-level plugins + know how many valid entries plugin_event_name holds. */ + +int +get_event_last (void) +{ + return event_last; +} -- cgit v1.2.1 From c6ba609cc702dc83848ffcb6fa4a9eecf7f6bd85 Mon Sep 17 00:00:00 2001 From: amylaar Date: Fri, 11 Dec 2009 11:11:18 +0000 Subject: * plugin.c (get_named_event_id): Fix hash table rebuild to include dynamically allocated events. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155156 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/plugin.c') diff --git a/gcc/plugin.c b/gcc/plugin.c index 84c9f4434dc..78f99ca5d3b 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -316,7 +316,7 @@ get_named_event_id (const char *name, enum insert_option insert) int i; event_tab = htab_create (150, htab_hash_string, htab_event_eq, NULL); - for (i = 0; i < PLUGIN_EVENT_FIRST_DYNAMIC; i++) + for (i = 0; i < event_last; i++) { slot = htab_find_slot (event_tab, plugin_event_name[i], INSERT); gcc_assert (*slot == HTAB_EMPTY_ENTRY); -- cgit v1.2.1 From 0bac94cb594aa47c9a883f83daeaa628401baf8d Mon Sep 17 00:00:00 2001 From: espindola Date: Mon, 21 Dec 2009 20:37:49 +0000 Subject: 2009-12-21 Brian Hackett * decl.c (finish_function): Rename pre-genericize event. 2009-12-21 Brian Hackett * plugin.def: Rename pre-genericize event. * plugin.c (register_callback, invoke_plugin_callbacks): Same. * c-decl.c (finish_function): Invoke callbacks on above event. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155379 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/plugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/plugin.c') diff --git a/gcc/plugin.c b/gcc/plugin.c index 78f99ca5d3b..25e5b95be8f 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -402,7 +402,7 @@ register_callback (const char *plugin_name, case PLUGIN_FINISH_TYPE: case PLUGIN_START_UNIT: case PLUGIN_FINISH_UNIT: - case PLUGIN_CXX_CP_PRE_GENERICIZE: + case PLUGIN_PRE_GENERICIZE: case PLUGIN_GGC_START: case PLUGIN_GGC_MARKING: case PLUGIN_GGC_END: @@ -483,7 +483,7 @@ invoke_plugin_callbacks (int event, void *gcc_data) case PLUGIN_FINISH_TYPE: case PLUGIN_START_UNIT: case PLUGIN_FINISH_UNIT: - case PLUGIN_CXX_CP_PRE_GENERICIZE: + case PLUGIN_PRE_GENERICIZE: case PLUGIN_ATTRIBUTES: case PLUGIN_PRAGMAS: case PLUGIN_FINISH: -- cgit v1.2.1 From 19bc000dc88439a5b78345f454d688eb00d99ce2 Mon Sep 17 00:00:00 2001 From: doko Date: Mon, 12 Apr 2010 23:58:18 +0000 Subject: gcc/ 2010-04-13 Matthias Klose * gcc.c (cc1_options): Handle -iplugindir before processing the cc1 spec. Only add -iplugindir once. (cpp_unique_options): Add -iplugindir option if -fplugin* options found. * common.opt (iplugindir): Remove `Separate' property, initialize. * plugin.c (default_plugin_dir_name): Error with missing -iplugindir option. * Makefile.in (check-%, check-parallel-%): Create plugin dir. (distclean): Remove plugin dir. 2010-04-13 Basile Starynkevitch * doc/plugins.texi (Loading Plugins): Document short -fplugin=foo option. (Plugin API): Mention default_plugin_dir_name function. * gcc.c (find_file_spec_function): Add new declaration. (static_spec_func): Use it for "find-file". (find_file_spec_function): Add new function. (cc1_options): Add -iplugindir option if -fplugin* options found. * gcc-plugin.h (default_plugin_dir_name): Added new declaration. * plugin.c (add_new_plugin): Updated comment, and handle short plugin name. (default_plugin_dir_name): Added new function. * common.opt (iplugindir): New option to set the plugin directory. gcc/testsuite/ 2010-04-13 Matthias Klose * gcc.dg/plugindir1.c: New testcase. * gcc.dg/plugindir2.c: New testcase. * gcc.dg/plugindir3.c: New testcase. * gcc.dg/plugindir4.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158247 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/plugin.c | 48 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 5 deletions(-) (limited to 'gcc/plugin.c') diff --git a/gcc/plugin.c b/gcc/plugin.c index 25e5b95be8f..9e1b5f4ada1 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -1,5 +1,5 @@ /* Support for GCC plugin mechanism. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -124,16 +124,41 @@ get_plugin_base_name (const char *full_name) } -/* Create a plugin_name_args object for the give plugin and insert it to - the hash table. This function is called when -fplugin=/path/to/NAME.so - option is processed. */ +/* Create a plugin_name_args object for the given plugin and insert it + to the hash table. This function is called when + -fplugin=/path/to/NAME.so or -fplugin=NAME option is processed. */ void add_new_plugin (const char* plugin_name) { struct plugin_name_args *plugin; void **slot; - char *base_name = get_plugin_base_name (plugin_name); + char *base_name; + bool name_is_short; + const char *pc; + + /* Replace short names by their full path when relevant. */ + name_is_short = !IS_ABSOLUTE_PATH (plugin_name); + for (pc = plugin_name; name_is_short && *pc; pc++) + if (*pc == '.' || IS_DIR_SEPARATOR (*pc)) + name_is_short = false; + + if (name_is_short) + { + base_name = CONST_CAST (char*, plugin_name); + /* FIXME: the ".so" suffix is currently builtin, since plugins + only work on ELF host systems like e.g. Linux or Solaris. + When plugins shall be available on non ELF systems such as + Windows or MacOS, this code has to be greatly improved. */ + plugin_name = concat (default_plugin_dir_name (), "/", + plugin_name, ".so", NULL); + if (access (plugin_name, R_OK)) + fatal_error + ("inacessible plugin file %s expanded from short plugin name %s: %m", + plugin_name, base_name); + } + else + base_name = get_plugin_base_name (plugin_name); /* If this is the first -fplugin= option we encounter, create 'plugin_name_args_tab' hash table. */ @@ -809,6 +834,7 @@ plugin_default_version_check (struct plugin_gcc_version *gcc_version, return true; } + /* Return the current value of event_last, so that plugins which provide additional functionality for events for the benefit of high-level plugins know how many valid entries plugin_event_name holds. */ @@ -818,3 +844,15 @@ get_event_last (void) { return event_last; } + + +/* Retrieve the default plugin directory. The gcc driver should have passed + it as -iplugindir to the cc1 program, and it is queriable thru the + -print-file-name=plugin option to gcc. */ +const char* +default_plugin_dir_name (void) +{ + if (!plugindir_string) + fatal_error ("-iplugindir option not passed from the gcc driver"); + return plugindir_string; +} -- cgit v1.2.1 From a3f551d2aa2897518373ac025e3ebac5284aab36 Mon Sep 17 00:00:00 2001 From: rguenth Date: Thu, 29 Apr 2010 09:01:56 +0000 Subject: 2010-04-29 Brian Hackett * plugin.h (invoke_plugin_callbacks): New inline function. * plugin.c (flag_plugin_added): New global flag. (add_new_plugin): Initialize above flag. (invoke_plugin_callbacks): Rename to ... (invoke_plugin_callbacks_full): ... this. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158896 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/plugin.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'gcc/plugin.c') diff --git a/gcc/plugin.c b/gcc/plugin.c index 9e1b5f4ada1..707d2dd5f66 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -86,6 +86,8 @@ struct callback_info static struct callback_info *plugin_callbacks_init[PLUGIN_EVENT_FIRST_DYNAMIC]; static struct callback_info **plugin_callbacks = plugin_callbacks_init; +/* For invoke_plugin_callbacks(), see plugin.h. */ +bool flag_plugin_added = false; #ifdef ENABLE_PLUGIN /* Each plugin should define an initialization function with exactly @@ -137,6 +139,8 @@ add_new_plugin (const char* plugin_name) bool name_is_short; const char *pc; + flag_plugin_added = true; + /* Replace short names by their full path when relevant. */ name_is_short = !IS_ABSOLUTE_PATH (plugin_name); for (pc = plugin_name; name_is_short && *pc; pc++) @@ -483,16 +487,11 @@ unregister_callback (const char *plugin_name, int event) return PLUGEVT_NO_CALLBACK; } -/* Called from inside GCC. Invoke all plug-in callbacks registered with - the specified event. - Return PLUGEVT_SUCCESS if at least one callback was called, - PLUGEVT_NO_CALLBACK if there was no callback. - - EVENT - the event identifier - GCC_DATA - event-specific data provided by the compiler */ +/* Invoke all plugin callbacks registered with the specified event, + called from invoke_plugin_callbacks(). */ int -invoke_plugin_callbacks (int event, void *gcc_data) +invoke_plugin_callbacks_full (int event, void *gcc_data) { int retval = PLUGEVT_SUCCESS; -- cgit v1.2.1 From 1f63d33764ca742bf167b8f4f42ca6e19e355a3b Mon Sep 17 00:00:00 2001 From: jsm28 Date: Tue, 25 May 2010 13:01:45 +0000 Subject: * diagnostic.c: Don't include plugin.h. (diagnostic_report_diagnostic): Don't handle plugins specially here. Pass context to internal_error callback. * diagnostic.h (struct diagnostic_context): Add context parameter to internal_error callback. * plugin.c (warn_if_plugins, plugins_internal_error_function): New. * plugin.h (struct diagnostic_context): Declare. (warn_if_plugins, plugins_internal_error_function): Declare. * toplev.c (general_init): Set global_dc->internal_error. * Makefile.in (diagnostic.o): Update dependencies. ada: * gcc-interface/misc.c (internal_error_function): Add context parameter. Use it to access show_column flag and instead of using global_dc. Call warn_if_plugins. * gcc-interface/Make-lang.in (ada/misc.o): Update dependencies. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159819 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/plugin.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'gcc/plugin.c') diff --git a/gcc/plugin.c b/gcc/plugin.c index 707d2dd5f66..1c737a5cd25 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -810,6 +810,32 @@ debug_active_plugins (void) dump_active_plugins (stderr); } +/* Give a warning if plugins are present, before an ICE message asking + to submit a bug report. */ + +void +warn_if_plugins (void) +{ + if (plugins_active_p ()) + { + fnotice (stderr, "*** WARNING *** there are active plugins, do not report" + " this as a bug unless you can reproduce it without enabling" + " any plugins.\n"); + dump_active_plugins (stderr); + } + +} + +/* Likewise, as a callback from the diagnostics code. */ + +void +plugins_internal_error_function (struct diagnostic_context *context ATTRIBUTE_UNUSED, + const char *msgid ATTRIBUTE_UNUSED, + va_list *ap ATTRIBUTE_UNUSED) +{ + warn_if_plugins (); +} + /* The default version check. Compares every field in VERSION. */ bool -- cgit v1.2.1 From 4b987facd8ba658d00c277a7e9c46548b492854f Mon Sep 17 00:00:00 2001 From: hubicka Date: Sat, 29 May 2010 20:31:45 +0000 Subject: * tree-vrp.c (debug_value_range, debug_all_value_ranges, debug_asserts_for, debug_all_asserts): Annotate with DEBUG_FUNCTION. * tree-into-ssa.c (debug_decl_set, debug_defs_stack, debug_currdefs, debug_tree_ssa, debug_tree_ssa_stats, debug_def_blocks, debug_names_replaced_by, debug_update_ssa): Likewise. * sbitmap.c (debug_sbitmap): Likewise. * genrecog.c (debug_decision, debug_decision_list): Likewise. * tree-pretty-print.c (debug_generic_expr, debug_generic_stmt, debug_tree_chain): Likewise. * tree-loop-distribution.c (debug_rdg_partitions): Likewise. * cgraph.c (debug_cgraph_node, debug_cgraph): Likewise. * optabs.c (debug_optab_libfuncs): Likewise. (verify_loop_closed_ssa): Likewise. * value-prof.c (verify_histograms): Likewise. * reload.c (debug_reload_to_stream, debug_reload): Likewise. * bitmap.c (debug_bitmap_file, debug_bitmap, bitmap_print): Likewise. * cfghooks.c (verify_flow_info): Likewise. * fold-const.c (debug_fold_checksum): Likewise. * omp-low.c (debug_omp_region, debug_all_omp_regions): Likewise. * cfg.c (debug_regset, debug_flow_info, debug_bb, debug_bb_n): Likewise. * omega.c (debug_omega_problem): Likewise. * cgraphunit.c (verify_cgraph_node, verify_cgraph): Likewise. * tree-ssa-ccp.c (debug_lattice_value): Likewise. * dominance.c (verify_dominators, debug_dominance_info, debug_dominance_tree): Likewise. * df-core.c (df_insn_uid_debug, df_insn_debug, df_insn_debug_regno, * df_regno_debug, df_ref_debug, debug_df_insn, debug_df_reg, debug_df_regno, debug_df_ref, debug_df_defno, debug_df_useno, debug_df_chain): Likewise. * tree-ssa-dom.c (debug_dominator_optimization_stats): Likewise. * sel-sched.c (debug_state): Likewise. * tree-ssa-alias.c (debug_alias_info, debug_points_to_info_for): Likewise. * cfganal.c (print_edge_list, verify_edge_list): Likewise. * dwarf2out.c (debug_dwarf_die, debug_dwarf): Likewise. * tree-eh.c (verify_eh_edges, verify_eh_dispatch_edge): Likewise. * gimple-pretty-print.c (debug_gimple_stmt, debug_gimple_seq): Likewise. * c-pretty-print.c (debug_c_tree): Likewise. * sel-sched-dump.c (debug_insn_rtx, debug_vinsn, debug_expr, debug_insn debug_av_set, debug_lv_set, debug_ilist, debug_blist, debug_insn_vector, debug_hard_reg_set, debug_mem_addr_value): Likewise. * ebitmap.c (debug_ebitmap): Likewise. * function.c (debug_find_var_in_block_tree): Likewise. * print-rtl.c (debug_rtx): Likewise. (debug_rtx_count): Likewise. (debug_rtx_list, debug_rtx_range, debug_rtx_find): Likewise. * stor-layout.c (debug_rli): Likewise. * ipa.c (debug_cgraph_node_set, debug_varpool_node_set): Likewise. * tree-data-ref.c (debug_data_references, debug_data_dependence_relations, debug_data_reference, debug_data_dependence_relation, debug_rdg_vertex, debug_rdg_component, debug_rdg): Likewise. * tree-affine.c (debug_aff): Likewise. * tree-dfa.c (debug_referenced_vars, debug_variable, debug_dfa_stats): Likewise. * except.c (debug_eh_tree, verify_eh_tree): Likewise. * emit-rtl.c (verify_rtl_sharing): Likewise. * tree-ssa-pre.c (debug_pre_expr, debug_bitmap_set, debug_value_expressions): Likewise. * tree-ssa-live.c (debug_scope_block, debug_scope_blocks): Likewise. * sese.c (debug_rename_map, debug_ivtype_map): Likewise. * print-tree.c (debug_tree, debug_vec_tree): Likewise. * cfglayout.c (verify_insn_chain): Likewise. * graphite-clast-to-gimple.c (debug_clast_name_indexes, debug_clast_stmt, debug_generated_program): Likewise. * ggc-page.c (debug_print_page_list): Likewise. * tree-ssa-ter.c (debug_ter): Likewise. * graphite-dependences.c (debug_pddr): Likewise. * sched-deps.c (debug_ds): Likewise. * tree-ssa.c (verify_ssa): Likewise. * graphite-poly.c (debug_scattering_function, debug_iteration_domain, debug_scattering_functions, debug_iteration_domains, debug_pdr, debug_pdrs, debug_pbb_domain, debug_pbb, debug_scop_context, debug_scop, debug_cloog, debug_scop_params, debug_lst): Likewise. * tree-inline.c (debug_find_tree): Likewise. * graphite-ppl.c (debug_ppl_linear_expr, debug_ppl_polyhedron_matrix, debug_ppl_powerset_matrix): Likewise. * var-tracking.c (debug_dv): Likewise. * system.h (DEBUG_FUNCTION, DEBUG_VARIABLE): Define. * cfgloop.c (verify_loop_structure): Likewise. * plugin.c (dump_active_plugins, debug_active_plugins): Likewise. * c-common.c (verify_sequence_points): Likewise. * sched-rgn.c (debug_regions, debug_region, debug_candidate, debug_candidates, debug_rgn_dependencies): Likewise. * tree-ssa-structalias.c (debug_constraint, debug_constraints, * debug_constraint_graph, debug_solution_for_var, debug_sa_points_to_info): Likewise. * sched-vis.c (debug_insn_slim, debug_bb_slim, debug_bb_n_slim): Likewie. * tree-cfg.c (debug_cfg_stats, verify_stmts, debug_function, debug_loops, debug_loop, debug_loop_num): Likewise. * passes.c (debug_pass): Likewise. (dump_properties): Likewise; add cfglayout property. (debug_properties): Likewise. * tree-ssa-reassoc.c (debug_ops_vector): Likewise. * varpool.c (debug_varpool): Likewise. * regcprop.c (debug_value_data): Likewise. * tree-ssa-operands.c (verify_imm_links, debug_immediate_uses, debug_immediate_uses_for): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160036 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/plugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/plugin.c') diff --git a/gcc/plugin.c b/gcc/plugin.c index 1c737a5cd25..6de4a8b0739 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -778,7 +778,7 @@ plugins_active_p (void) /* Dump to FILE the names and associated events for all the active plugins. */ -void +DEBUG_FUNCTION void dump_active_plugins (FILE *file) { int event; @@ -804,7 +804,7 @@ dump_active_plugins (FILE *file) /* Dump active plugins to stderr. */ -void +DEBUG_FUNCTION void debug_active_plugins (void) { dump_active_plugins (stderr); -- cgit v1.2.1 From 0b205f4ca112a643f4f1b9c9886648b569e0b380 Mon Sep 17 00:00:00 2001 From: manu Date: Thu, 8 Jul 2010 04:22:54 +0000 Subject: =?UTF-8?q?2010-07-08=20=20Manuel=20L=C3=B3pez-Ib=C3=A1=C3=B1ez=20?= =?UTF-8?q?=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * toplev.h: Do not include diagnostic-core.h. Include diagnostic-core.h in every file that includes toplev.h. * c-tree.h: Do not include toplev.h. * pretty-print.h: Update comment. * Makefile.in: Update dependencies. * alias.c: Include diagnostic-core.h in every file that includes toplev.h. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/arm.c: Likewise. * config/arm/pe.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/cris/cris.c: Likewise. * config/crx/crx.c: Likewise. * config/darwin-c.c: Likewise. * config/darwin.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/h8300/h8300.c: Likewise. * config/host-darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/netware.c: Likewise. * config/i386/nwld.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/i386/winnt-stubs.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64-c.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c-pragma.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68hc11/m68hc11.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep-pragma.c: Likewise. * config/mep/mep.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/picochip/picochip.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390.c: Likewise. * config/score/score.c: Likewise. * config/score/score3.c: Likewise. * config/score/score7.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-base.c: Likewise. * config/sh/symbian-c.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sol2-c.c: Likewise. * config/sol2.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/v850/v850-c.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * convert.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbxout.c: Likewise. * ddg.c: Likewise. * dominance.c: Likewise. * emit-rtl.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * fwprop.c: Likewise. * gcse.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * gimple-low.c: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * implicit-zee.c: Likewise. * integrate.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-iv.c: Likewise. * lto-opts.c: Likewise. * lto-symtab.c: Likewise. * main.c: Likewise. * modulo-sched.c: Likewise. * optabs.c: Likewise. * params.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtlanal.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * simplify-rtx.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * targhooks.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-inline.c: Likewise. * tree-nomudflap.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-phinodes.c: Likewise. * tree-profile.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vrp.c: Likewise. * varasm.c: Likewise. * vec.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. c-family/ * c-common.h: Include diagnostic-core.h. Error if already included. * c-semantics.c: Do not define GCC_DIAG_STYLE here. cp/ * cp-tree.h: Do not include toplev.h. java/ * boehm.c: Include diagnostic-core.h in every file that includes toplev.h. * class.c: Likewise. * constants.c: Likewise. * decl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * mangle.c: Likewise. * mangle_name.c: Likewise. * resource.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. ada/ * gcc-interface/utils.c: Include diagnostic-core.h in every file that includes toplev.h. lto/ * lto-coff.c: Include diagnostic-core.h in every file that includes toplev.h. * lto-elf.c: Likewise. * lto-lang.c: Likewise. * lto-macho.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161943 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/plugin.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/plugin.c') diff --git a/gcc/plugin.c b/gcc/plugin.c index 6de4a8b0739..e7c4cf689fe 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see #endif #include "coretypes.h" +#include "diagnostic-core.h" #include "toplev.h" #include "tree.h" #include "tree-pass.h" -- cgit v1.2.1