aboutsummaryrefslogtreecommitdiff
path: root/gcc/plugin.c
AgeCommit message (Collapse)AuthorFilesLines
2009-12-21decl.c (finish_function): Rename pre-genericize event.Brian Hackett1-2/+2
2009-12-21 Brian Hackett <bhackett1024@gmail.com> * decl.c (finish_function): Rename pre-genericize event. 2009-12-21 Brian Hackett <bhackett1024@gmail.com> * plugin.def: Rename pre-genericize event. * plugin.c (register_callback, invoke_plugin_callbacks): Same. * c-decl.c (finish_function): Invoke callbacks on above event. From-SVN: r155379
2009-12-11plugin.c (get_named_event_id): Fix hash table rebuild to include dynamically ↵Joern Rennecke1-1/+1
allocated events. * plugin.c (get_named_event_id): Fix hash table rebuild to include dynamically allocated events. From-SVN: r155156
2009-12-01cgraphunit.c (plugin.h): Include.Grigori Fursin1-29/+161
2009-12-01 Grigori Fursin <grigori.fursin@inria.fr> Joern Rennecke <amylaar@spamcop.net> * 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. Co-Authored-By: Joern Rennecke <amylaar@spamcop.net> From-SVN: r154877
2009-11-25Remove trailing white spaces.H.J. Lu1-2/+2
2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * 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. From-SVN: r154645
2009-11-19plugin.c (FMT_FOR_PLUGIN_EVENT): added definition.Basile Starynkevitch1-4/+7
2009-11-19 Basile Starynkevitch <basile@starynkevitch.net> * gcc/plugin.c (FMT_FOR_PLUGIN_EVENT): added definition. (dump_active_plugins): output to file everything. Use internationalized dump & FMT_FOR_PLUGIN_EVENT. From-SVN: r154337
2009-11-06plugins.texi (Plugin callbacks): added PLUGIN_PRAGMAS.Basile Starynkevitch1-2/+6
2009-11-06 Basile Starynkevitch <basile@starynkevitch.net> * 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 <basile@starynkevitch.net> * 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. From-SVN: r153975
2009-10-11plugin.c (try_init_one_plugin): Improve constness of variable err.Gerald Pfeifer1-1/+1
* plugin.c (try_init_one_plugin): Improve constness of variable err. From-SVN: r152638
2009-09-28tree-pass.h (register_pass_info): New structure.Sriraman Tallam1-188/+1
* 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. From-SVN: r152257
2009-09-28Add support for using ggc cache tables from plugins.Duncan Sands1-0/+6
Approved by Ian Lance Taylor. From-SVN: r152232
2009-07-09plugin.c (try_init_one_plugin): passes RTLD_GLOBAL to dlopen.Basile Starynkevitch1-1/+5
2009-07-09 Basile Starynkevitch <basile@starynkevitch.net> * gcc/plugin.c (try_init_one_plugin): passes RTLD_GLOBAL to dlopen. From-SVN: r149424
2009-06-29plugins.texi: Document PLUGIN_START_UNIT.Olatunji Ruwase1-0/+3
2009-06-29 Olatunji Ruwase <tjruwase@google.com> * 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. From-SVN: r149064
2009-06-18plugins.texi: Document plugin_is_GPL_compatible.Diego Novillo1-1/+10
* doc/plugins.texi: Document plugin_is_GPL_compatible. * plugin.c (str_license): Declare. (try_init_one_plugin): Assert that the symbol 'plugin_is_GPL_compatible' exists. testsuite/ChangeLog * gcc.dg/plugin/selfassign.c: Declare plugin_is_GPL_compatible. * gcc.dg/plugin/ggcplug.c: Likewise. * gcc.dg/plugin/one_time_plugin.c: Likewise. * g++.dg/plugin/selfassign.c: Likewise. * g++.dg/plugin/attribute_plugin.c: Likewise. * g++.dg/plugin/dumb_plugin.c: Likewise. From-SVN: r148667
2009-06-16[multiple changes]Olatunji Ruwase1-0/+5
2009-06-16 Olatunji Ruwase <tjruwase@google.com> * plugin.c(position_pass): Skip newly inserted pass during list traversal to avoid repeated insertion. 2009-06-05 Olatunji Ruwase <tjruwase@google.com> * gcc.dg/plugin/one_time_plugin.c: New test. * gcc.dg/plugin/one_time-test-1.c: New test. * gcc.dg/plugin/plugin.exp: Added one_time_plugin.c test. From-SVN: r148566
2009-05-26plugins.texi (Loading plugins): typo.Basile Starynkevitch1-0/+19
2009-05-26 Basile Starynkevitch <basile@starynkevitch.net> * gcc/doc/plugins.texi (Loading plugins): typo. (Plugin callbacks): Documented PLUGIN_INFO, PLUGIN_GGC_START, PLUGIN_GGC_MARKING, PLUGIN_GGC_END, PLUGIN_REGISTER_GGC_ROOTS. (Interacting with the GCC Garbage Collector): Added new section. (Giving information about a plugin): Added new section for PLUGIN_INFO. * gcc/testsuite/gcc.dg/plugin/plugin.exp: Added ggcplug.c test plugin with ggcplug-test-1.c for testing PLUGIN_GGC_MARKING etc... * gcc/testsuite/gcc.dg/plugin/ggcplug-test-1.c: Added new file. * gcc/testsuite/gcc.dg/plugin/ggcplug.c: Added new file. * gcc/ggc.h (ggc_register_root_tab): Added declaration. * gcc/gcc-plugin.h (PLUGIN_GGC_START, PLUGIN_GGC_MARKING) (PLUGIN_GGC_END, PLUGIN_REGISTER_GGC_ROOTS): Added new events. (register_callback): Improved comment in declaration. * gcc/ggc-common.c (const_ggc_root_tab_t) Added new typedef for vectors. (extra_root_vec) Added static variable for dynamic roots registration. (ggc_register_root_tab) Added new routine. (ggc_mark_roots) Added iteration inside extra_root_vec, and invoke PLUGIN_GGC_MARKING event. * gcc/ggc-zone.c: Include plugin.h. (ggc_collect): Invoke PLUGIN_GGC_START & PLUGIN_GGC_END events. * gcc/ggc-page.c: Include plugin.h. (ggc_collect): Invoke PLUGIN_GGC_START & PLUGIN_GGC_END events. * gcc/plugin.c (plugin_event_name): added names of PLUGIN_GGC_START, PLUGIN_GGC_MARKING, PLUGIN_GGC_END, PLUGIN_REGISTER_GGC_ROOTS (register_callback): check lack of callbacks for pseudo-events. Added handling of PLUGIN_REGISTER_GGC_ROOTS, PLUGIN_GGC_START, PLUGIN_GGC_MARKING, PLUGIN_GGC_END. (invoke_plugin_callbacks): Handle PLUGIN_GGC_START, PLUGIN_GGC_MARKING, PLUGIN_GGC_END, PLUGIN_REGISTER_GGC_ROOTS. * gcc/Makefile.in (ggc-common.o, ggc-zone.o, ggc-page.o): Added dependency on plugin.h. (plugin.o): Added dependency on ggc.h... From-SVN: r147878
2009-05-21plugin.c (try_init_one_plugin): Updated to new plugin_init API.Taras Glek1-15/+1
gcc/ChangeLog * plugin.c (try_init_one_plugin): Updated to new plugin_init API. * gcc-plugin.h (plugin_init): Updated signature. * gcc-plugin.h (plugin_name_args): Moved to this header. * doc/plugins.texi (plugin_init): Updated documention to reflect API change. * doc/plugins.texi (plugin_name_args): Added to documention. gcc/testsuite/ChangeLog * gcc.dg/plugin/selfassign.c (plugin_init): Updated to new plugin_init signature. * g++.dg/plugin/selfassign.c (plugin_init): Updated to new plugin_init signature. * g++.dg/plugin/dumb_plugin.c (plugin_init): Updated to new plugin_init signature. * g++.dg/plugin/attribute_plugin.c (plugin_init): Updated to new plugin_init signature. From-SVN: r147772
2009-05-14passes.c (finish_optimization_passes): Change i to int.Ian Lance Taylor1-2/+2
./: * passes.c (finish_optimization_passes): Change i to int. * plugin.c (plugins_active_p): Change event to int. (dump_active_plugins): Likewise. * reginfo.c (invalid_mode_change_p): Change to to unsigned int. Add cast. * tree.c (tree_range_check_failed): Change c to unsigned int. (omp_clause_range_check_failed): Likewise. (build_common_builtin_nodes): Change mode to int. Add cast. * config/ia64/ia64.c (is_emitted): Change r to unsigned int. (ia64_hard_regno_rename_ok, ia64_eh_uses): Likewise. * c-typeck.c (build_unary_op): If -Wc++-compat, warn about using ++ or -- with a variable of enum type. cp/: * class.c (layout_class_type): Change itk to unsigned int. * decl.c (finish_enum): Change itk to unsigned int. * parser.c (cp_parser_check_decl_spec): Change ds to int. Remove casts. fortran/: * decl.c (match_attr_spec): Change d to unsigned int. * dump-parse-tree.c (show_namespace): Change op to int. Add cast. * interface.c (gfc_check_interfaces): Change i to int. Add casts. * module.c (read_module): Change i to int. Add cast. (write_module): Change i to int. * symbol.c (gfc_get_namespace): Change in to int. (gfc_free_namespace): Change i to int. * trans-io.c (gfc_build_io_library_fndecls): Change ptype to unsigned int. Add cast. * trans-types.c (gfc_init_kinds): Change mode to unsigned int. Add casts. testsuite/: * gcc.dg/Wcxx-compat-9.c: New testcase. From-SVN: r147544
2009-05-142009-05-13 Taras Glek <tglek@mozilla.com>Taras Glek1-0/+2
gcc/ * attribs.c moved out attribute registration into register_attribute * doc/plugins.texi Documented register_attribute and PLUGIN_ATTRIBUTES * gcc-plugin.h Added forward decl for register_attribute * plugin.c Added PLUGIN_ATTRIBUTES boilerplate * plugin.h Added PLUGIN_ATTRIBUTES gcc/testsuite/ * g++.dg/plugin/attribute_plugin-test-1.C Testcase input for custom attributes and decl smashing * g++.dg/plugin/attribute_plugin.c Testcase plugin to test user attributes * g++.dg/plugin/dumb_plugin.c Fixed typo * g++.dg/plugin/plugin.exp Added attribute_plugin test From-SVN: r147516
2009-05-06plugin-support.exp: New file containing support procs for plugin testcases.Le-Chun Wu1-1/+0
2009-05-06 Le-Chun Wu <lcwu@google.com> * lib/plugin-support.exp: New file containing support procs for plugin testcases. * lib/target-supports.exp (check_plugin_available): New proc. * gcc.dg/plugin/plugin.exp: New driver script for gcc testcases. * gcc.dg/plugin/selfassign.c: New plugin source file. * gcc.dg/plugin/self-assign-test-1.c: New test. * gcc.dg/plugin/self-assign-test-2.c: Likewise. * g++.dg/README: Add description for plugin test. * g++.dg/dg.exp: Exclude plugin tests from the general test list. * g++.dg/plugin/plugin.exp: New driver script for g++ testcases. * g++.dg/plugin/selfassign.c: New plugin source file. * g++.dg/plugin/self-assign-test-1.C: New test. * g++.dg/plugin/self-assign-test-2.C: Likewise. * g++.dg/plugin/self-assign-test-3.C: Likewise. * g++.dg/plugin/dumb_plugin.c: New plugin source file. * g++.dg/plugin/dumb-plugin-test-1.C: New test. From-SVN: r147185
2009-04-30plugin.c: Include plugin-version.h only if ENABLE_PLUGIN is defined.Rafael Avila de Espindola1-0/+2
2009-04-30 Rafael Avila de Espindola <espindola@google.com> * plugin.c: Include plugin-version.h only if ENABLE_PLUGIN is defined. From-SVN: r146998
2009-04-29Makefile.in (PLUGIN_VERSION_H): New.Rafael Avila de Espindola1-16/+12
2009-04-29 Rafael Avila de Espindola <espindola@google.com> * Makefile.in (PLUGIN_VERSION_H): New. (OBJS-common): Remove plugin-version.o. (plugin.o): Depend on (PLUGIN_VERSION_H). (plugin-version.o): Remove. * configure: Regenerate * configure.ac: Create plugin-version.h. * gcc-plugin.h (plugin_gcc_version): Remove. (plugin_default_version_check): Change signature. * plugin-version.c: Remove. * plugin.c: Include plugin-version.h. (str_plugin_gcc_version_name): Remove. (try_init_one_plugin): Pass gcc version to plugin_init. (plugin_default_version_check): Both gcc and plugin versions are now arguments. From-SVN: r146962
2009-04-17Makefile.in (REVISION_s): Always include quotes.Rafael Avila de Espindola1-1/+31
2009-04-17 Rafael Avila de Espindola <espindola@google.com> * Makefile.in (REVISION_s): Always include quotes. Change ifdef to use REVISION_c. (OBJS-common): Add plugin-version.o. (plugin-version.o): New. * gcc-plugin.h (plugin_gcc_version): New. (plugin_default_version_check): New. (plugin_init_func, plugin_init): Add version argument. * plugin-version.c: New. * plugin.c (str_plugin_gcc_version_name): New. (try_init_one_plugin): Read plugin_gcc_version from the plugin and pass it to the init function. (plugin_default_version_check): New. From-SVN: r146274
2009-04-16common.opt (fhelp): Add Var(help_flag).Rafael Avila de Espindola1-0/+47
2009-04-16 Rafael Avila de Espindola <espindola@google.com> * common.opt (fhelp): Add Var(help_flag). * gcc-plugin.h (plugin_info): Add help. * plugin.c (plugin_name_args): Add help. (register_plugin_info): Set plugin->help. (print_help_one_plugin): New. (print_plugins_help): New. * plugin.h (print_plugins_help): New. * toplev.c (toplev_main): Call print_plugins_help if needed. From-SVN: r146195
2009-04-16gcc-plugin.h (plugin_event): Add PLUGIN_INFO.Rafael Avila de Espindola1-19/+107
2009-04-16 Rafael Avila de Espindola <espindola@google.com> * gcc-plugin.h (plugin_event): Add PLUGIN_INFO. (plugin_info): New. * opts.c (common_handle_option): Don't call print_version. * plugin.c (plugin_name_args): Add version. (register_plugin_info): New. (register_callback): Handle PLUGIN_INFO. (try_init_one_plugin): New. (init_one_plugin): Use try_init_one_plugin. Only free plugin_name_args if failed to init. (finalize_one_plugin): New. (finalize_plugins): New. (print_one_plugin): New. (print_plugins_versions): New. * plugin.h (print_plugins_versions): New. (finalize_plugins): New. * toplev.c (compile_file): Don't call initialize_plugins. (print_version): Call print_plugins_versions. (toplev_main): Call initialize_plugins. Print version if needed. Call finalize_plugins. From-SVN: r146187
2009-04-14diagnostic.c (diagnostic_report_diagnostic): Do not warn about loaded ↵Diego Novillo1-1/+1
plugins for DK_ERROR and DK_WARNING. * diagnostic.c (diagnostic_report_diagnostic): Do not warn about loaded plugins for DK_ERROR and DK_WARNING. * c-decl.c (declspecs_add_type): Move call to invoke_plugin_callbacks ... * c-parser.c (c_parser_declspecs): ... here. * plugin.c (dump_active_plugins): Tidy output. cp/ChangeLog * parser.c (cp_parser_type_specifier_seq): Move call to invoke_plugin_callbacks ... (cp_parser_type_specifier_seq): ... here. From-SVN: r146078
2009-04-14[multiple changes]Diego Novillo1-0/+672
2009-04-14 Diego Novillo <dnovillo@google.com> Le-Chun Wu <lcwu@google.com> * configure.ac: Add --enable-plugin support. Define ENABLE_PLUGIN and PLUGINLIBS when specified. * Makefile.in (PLUGIN_H): Define. Export ENABLE_PLUGIN and GMPINC to site.exp. Add PLUGINLIBS to link command. Add/modify dependencies for plugin.o and files including plugin.h. (plugin.o): New. * config.in: Regenerate. * opts.c (common_handle_option): Handle OPT_fplugin_ and OPT_fplugin_arg_. 2009-04-14 Le-Chun Wu <lcwu@google.com> * tree-pass.h (register_one_dump_file): Add a prototype for register_one_dump_file. * toplev.c (compile_file): Call initialize_plugins. (do_compile): Call invoke_plugin_callbacks. (toplev_main): Call invoke_plugin_callbacks. * common.opt: Add -fplugin= and -fplugin-arg-. * gcc-plugin.h: New public header file for plugins to include. * plugin.c: New source file. * plugin.h: New internal header file. * passes.c (register_one_dump_file): Make it external. * c-parser.c (c_parser_declspecs): Call invoke_plugin_callbacks. 2009-04-14 Diego Novillo <dnovillo@google.com> * doc/plugins.texi: New. * doc/gccint.texi: Add reference to Plugins chapter. * doc/invoke.texi: Document -fplugin and -fplugin-arg * diagnostic.c (diagnostic_report_diagnostic): Warn about loaded plugins, if any. * timevar.def (TV_PLUGIN_INIT): Define. (TV_PLUGIN_RUN): Define. * plugin.c: Include timevar.h (plugins_active_p): New. (dump_active_plugins): New. (debug_active_plugins): New. cp/ChangeLog 2009-04-14 Le-Chun Wu <lcwu@google.com> * Make-lang.in: Modify dependencies of files including plugin.h. * decl.c (finish_function): Call invoke_plugin_callbacks. * parser.c (cp_parser_type_specifier): Call invoke_plugin_callbacks. From-SVN: r146059