I have enhanced the dump infrastructure in r191883, r191884. These
patches updated the tree/rtl dump facility so that passes do not
reference the dump file directly, but instead use a different (and
hopefully cleaner) API.
Instead of this
if (dump_file)
fprintf (dump_file, ...);
the new style looks like this
if (dump_kind_p (...))
dump_printf (...)
[...]
Since the number of existing dump call sites is quite large, currently
both old *and* new schemes are in use. The plan is to gradually
transition passes to use the new dump infrastructure and deprecate the
old dump style. This will also provide better optimization reports in
future.