[PATCH INSTALLED]: const typedefs part 19/N

Kaveh R. GHAZI ghazi@caip.rutgers.edu
Mon Aug 27 16:08:00 GMT 2007


On Mon, 27 Aug 2007, Daniel Berlin wrote:

> On 8/26/07, Kaveh R. GHAZI <ghazi@caip.rutgers.edu> wrote:
> > This patch constifies cfg_hooks and debug_hooks, plus a bunch of of other
> > random predicates.
> >
> > Bootstrapped on sparc-sun-solaris2.10, no regressions.  I also ran my
> > cross-compile farm to check platforms with other debug-types activating
> > different debugging code in the various *out.c files.  I didn't see any
> > relevant warnings from building cc1 to those targets.
> >
> > Installed on mainline.
> >
> >                 --Kaveh
> >
> const_last_stmt vs last_stmt?
>
> Please, no.
>
> That crosses the line for me from "i don't care if you want to
> constify a bunch of things" to "stop making the code look horrible".
> Really, all something like that will do is confuse people.
>
> Honestly, if you want to have const vs non-const return values, for
> the same function,  we should simply be using C++.


True, I'm faking in C what comes naturally in C++.

Just curious, how serious are you about using C++ and how much support do
you think there is for that?


> If we aren't going to do that, please don't add new functions that
> simply have const_ prefix'd, as it just makes things ugly for no
> discernible gain.
>
> I know most SSA and middle end maintainers  agree here.
>
> I kindly ask you to revert your change to make const_last_stmt and
> last_stmt (and others new functions that are prefix'd with const_)

Ok, I'll revert the const_last_stmt and related bits.  Thanks for the
feedback.

		--Kaveh
--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu



More information about the Gcc-patches mailing list