gengtype plugin improvement last4round -patch 4 [filerules]

Laurynas Biveinis laurynas.biveinis@gmail.com
Tue Nov 23 09:33:00 GMT 2010


2010/11/22 H.J. Lu <hjl.tools@gmail.com>:
> Index: gengtype.c
> ===================================================================
> --- gengtype.c  (revision 167038)
> +++ gengtype.c  (working copy)
> @@ -1863,16 +1863,21 @@ struct file_rule_st files_rules[] = {
>    "gtype-desc.c" for common headers and corresponding output
>    files for language-specific header files.  */
>  static outf_p
> -header_dot_h_frul (input_file* inpf, char**poutname, char**pforname)
> +header_dot_h_frul (input_file* inpf, char**poutname,
> +                  char**pforname ATTRIBUTE_UNUSED)
>  {
>   const char *basename = 0;
>   int lang_index = 0;
> +#if ENABLE_CHECKING
>   const char *inpname = get_input_file_name (inpf);
>   DBGPRINTF ("inpf %p inpname %s outname %s forname %s",
>             (void*) inpf, inpname, *poutname, *pforname);
> +#endif

In general, there is no need to surround DBGPRINTF with ENABLE_CHECKING.

 DBGPRINTF ("inpf %p inpname %s outname %s forname %s",
            (void*) inpf, get_input_file_name (inpf), *poutname, *pforname);

>   basename = get_file_basename (inpf);
>   lang_index = get_prefix_langdir_index (basename);
> +#if ENABLE_CHECKING
>   DBGPRINTF ("basename %s lang_index %d", basename, lang_index);
> +#endif

ENABLE_CHECKING should be dropped.

>
>   if (lang_index >= 0)
>     {
> @@ -1907,11 +1912,13 @@ source_dot_c_frul (input_file* inpf, cha
>  {
>   char *newbasename = CONST_CAST (char*, get_file_basename (inpf));
>   char *newoutname = CONST_CAST (char*, get_file_gtfilename (inpf));
> +#if ENABLE_CHECKING
>   const char *inpname = get_input_file_name (inpf);
>   DBGPRINTF ("inpf %p inpname %s original outname %s forname %s",
>             (void*) inpf, inpname, *poutname, *pforname);
>   DBGPRINTF ("newoutname %s", newoutname);
>   DBGPRINTF ("newbasename %s", newbasename);
> +#endif

inpname should be inlined into DBGPRINTF and ENABLE_CHECKING dropped.

A patch to make these changes is pre-approved. Basile, can you take
care of this?

Thanks,
-- 
Laurynas



More information about the Gcc-patches mailing list