Hello All, [join work by Basile Starynkevitch & Jeremie Salvucci] References: http://gcc.gnu.org/ml/gcc-patches/2010-08/msg02060.html http://gcc.gnu.org/ml/gcc-patches/2010-09/msg00616.html http://gcc.gnu.org/ml/gcc-patches/2010-09/msg00663.html http://gcc.gnu.org/ml/gcc-patches/2010-08/msg02063.html http://gcc.gnu.org/ml/gcc-patches/2010-08/msg02065.html http://gcc.gnu.org/ml/gcc-patches/2010-09/msg01709.html This is a slightly improved version of the patch http://gcc.gnu.org/ml/gcc-patches/2010-08/msg02065.html with Laurynas comments from http://gcc.gnu.org/ml/gcc-patches/2010-09/msg00419.html adressed. As I told before, it improves the core get_output_file_with_visibility function. This version (relative to http://gcc.gnu.org/ml/gcc-patches/2010-08/msg02065.html I did sent before) improved comments and function names, following Laurynas advices; I also avoided calling regexec twice needlessly. I added a lot of explanatory comments. It is made much more modular and less ad hoc by a file rule machinery. We now use regular expressions to match the input file name and compute the associated output name & for name. A detailed comment is available in the patch. The patch relative to http://gcc.gnu.org/ml/gcc-patches/2010-09/msg01709.html is obtained with diff -u -p $(svn stat . |awk '/[AM]/{print $2}') \ --from-file ../thirdround_03_inputfile/ > \ $HOME/Gengtype_Thirdround/patch4_filesrules-relto03.diff ########## gcc/ChangeLog entry ###########" 2010-09-21 Jeremie Salvucci Basile Starynkevitch * gengtype.c: Include xregex.h and obstack.h Added comments about role of get_output_file_with_visibility and our regexpr machinery. (frul_actionrout_t, struct file_rule_st): New. (hader_dot_h_frul, source_dot_c_frul): New functions. (NULL_REGEX, NULL_FRULACT): New. (files_rules): New. (matching_file_name_substitute): New function. (get_output_file_with_visibility): Updated comments and rewritten to use the new files_rules machinery. ####################### For convenience, I am also attaching the cumulated patches against trunk Ok for trunk? Cheers. -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basilestarynkevitchnet mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France *** opinions {are only mine, sont seulement les miennes} ***