This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Missed optimization in simple_cst_equal() and has_cleanups()?
- To: mrs at wrs dot com (Mike Stump)
- Subject: Re: Missed optimization in simple_cst_equal() and has_cleanups()?
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Date: Tue, 25 Aug 98 19:34:05 +0200
- Cc: egcs at cygnus dot com, grahams at rcp dot co dot uk
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <199808251221.FAA23345@kankakee.wrs.com>
>> There are a couple of routines in tree.c (simple_cst_equal,
>> has_cleanups) which try to answer a couple of simple
>> questions. These routine return either a definative yes/no or a
>> "don't know". They return a "don't know" if they encounter a
>> language specific tree code.
>> If instead of returning "don't know" the question was passed onto
>> the language specific code to supply the answer
> In general, it was done this way because the primary
> maintainer at the time (kenner, rms) didn't understand
> some of the concepts of object oriented design. I
> consider it mostly a legacy issue now. If one visualizes
> the code in C++, one realizes this could just be a virtual
> function... :-) I don't think the concept of a virtual
> function is entirely without merit.
Hmmm, perhaps it's just my bias with imperative programming, but I
don't see the need for object oriented design here. As far as I
know it is quite common that compiler backends "call back" routines
in the (various) frontends to decide stuff that's language
dependent; it's one way to implement language dependent alias
analysis, for example: (backend): Hey frontend, I've two items X
and Y here, do you think that - according to your language rules -
they can overlap (Yes/No/Dunno).
Cheers,
Toon.