This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gengtype plugin improvement last4round -patch 4 [filerules]


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]