PATCH: Generalize tree-dumping infrastructure

Mark Mitchell mark@codesourcery.com
Tue Nov 13 15:03:00 GMT 2001



--On Tuesday, November 20, 2001 04:25:53 PM +1300 Bryce McKinlay 
<bryce@waitaki.otago.ac.nz> wrote:

> This patch generalizes the tree-dump code so that it can be used from
> non-C front ends. With this, I have successfully linked and used
> -fdump-translation-unit from gcj, though it needs a bit more work on the
> Java side before it is really useful.
>
> BTW Should we rename c-dump.{c,h} to tree-dump.{c,h} ?

Yes.

+/* A callback function defined by front-ends to determine type qualifiers
+   in a language-specific way.  */
+
+type_quals_fn lang_type_quals;
+

I think that this wants to go in lang-hooks.  Also, rather than
checking for NULL at the call-site, we should simply ensure that
this is never NULL; the default version should just return TYPE_QUALS.
(This reduces the number of code paths in the compiler, which improves
testability and reliability.)

Also, there's no need to have both cp_type_quals and CP_TYPE_QUALS;
just remove CP_TYPE_QUALS and replace it with cp_type_quals throughout
the C++ front end.

Please resubmit with those changes.

Thanks,

-- 
Mark Mitchell                mark@codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com



More information about the Gcc-patches mailing list