[PATCH] Name unnamed passes and change duplicate pass names
Paolo Bonzini
bonzini@gnu.org
Fri May 15 06:17:00 GMT 2009
I cannot approve it, but having done approx. half of the dump file
system, I think this is good to go
except for...
> +/* True if a set of TODO flags include any option that will output to
> + a dump file. */
> +
> +static bool
> +todo_includes_dump (unsigned int flags)
> +
> +static bool
> +needs_dump_file (struct opt_pass *pass)
making these two functions inline.
But...
> - if (pass->name && pass->name[0] != '*')
> + gcc_assert (pass->name);
> + if (needs_dump_file (pass) && pass->name[0] != '*')
what if you call those passes like "*all_optimizations" and just write
if (pass->name[0] != '*')
(No need to assert, it will crash on the following access).
> - if (pass->name)
> + if (needs_dump_file (pass))
and write here also just
if (pass->name[0] != '*')
> if (!quiet_flag && !cfun)
> - fprintf (stderr, " <%s>", pass->name ? pass->name : "");
> + fprintf (stderr, " <%s>", pass->name);
Everything else should be okay instead.
Sorry for not remembering about this detail! If maintainers decide
the other way round, the asterisk thing can be removed (but that's a
followup patch). I'm ambivalent.
Paolo
More information about the Gcc-patches
mailing list