This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Missed optimization in simple_cst_equal() and has_cleanups()?


>> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]