Hello, The following patch add support for PLUGIN_PRE_GENERICIZE callback.
The add_sysdata_pre_genericize patch add a field (sysdata_pre_genericize) in initial system data, allowing to register a closure to be called on PLUGIN_PRE_GENERICIZE event. This patch must be first applied and a make warmelt-upgrade must be run in order to regenerate generated melt files.
The add_pre_genericize_hook patch add a function (in melt-runtime.c) to be called on PLUGIN_PRE_GENERICIZE, which call the closure sysdata_pre_genericize defined by the users.
Thanks Pierre Vittet
2011-07-15 Pierre Vittet <pier...@pvittet.com> * melt-runtime.h (enum FSYDAT*): Add a FSYSDAT_PRE_GENERICIZE field. * melt/warmelt-first.melt (class_system_data): add a sysdata_pre_genericize field.
Index: gcc/melt/warmelt-first.melt =================================================================== --- gcc/melt/warmelt-first.melt (revision 176032) +++ gcc/melt/warmelt-first.melt (working copy) @@ -441,6 +441,8 @@ don't instanciate this class!}# sysdata_stdout ;raw file for stdout sysdata_stderr ;raw file for stderr sysdata_dumpfile ;raw file for dump_file + sysdata_pre_genericize ;closure to be called for PLUGIN_PRE_GENERICIZE: + ;look at gcc/c-decl.c. sysdata_unit_starter ;closure to be called at ;compilation unit start sysdata_unit_finisher ;closure to be called at Index: gcc/melt-runtime.h =================================================================== --- gcc/melt-runtime.h (revision 176032) +++ gcc/melt-runtime.h (working copy) @@ -2324,6 +2324,7 @@ enum FSYSDAT_STDOUT, /* raw boxed file for stdout */ FSYSDAT_STDERR, /* raw boxed file for stderr */ FSYSDAT_DUMPFILE, /* raw boxed file for dump_file */ + FSYSDAT_PRE_GENERICIZE, /* closure for PLUGIN_PRE_GENERICIZE */ FSYSDAT_UNIT_STARTER, /* closure for start of compilation unit */ FSYSDAT_UNIT_FINISHER, /* closure for start of compilation unit */ FSYSDAT_OPTION_SET, /* closure to set options */
2011-07-15 Pierre Vittet <pier...@pvittet.com> * melt-runtime.c (melt_really_initialize): Register a new Callback to PLUGIN_PRE_GENERICIZE. (melt_pre_genericize_callback): New function, use field sysdata_pre_genericize to transmit the callbacks.
2011-07-15 Pierre Vittet <pier...@pvittet.com> * melt-runtime.c (melt_really_initialize): Register a new Callback to PLUGIN_PRE_GENERICIZE. (melt_pre_genericize_callback): New function, use field sysdata_pre_genericize to transmit the callbacks.