Fwd: [Patch, Fortran] PR 43199 - Handle class%component references when reading .mod files

Paul Richard Thomas paul.richard.thomas@gmail.com
Mon Mar 1 08:26:00 GMT 2010


Dear Tobias

It´s the
   if (e->symtree->n.sym->ts.type == BT_CLASS)
     as = e->symtree->n.sym->ts.u.derived->components->as;

that bothers me :-)

Maybe we need a macro to obtain the $data field?  I´m mainly after
something thats a bit easier to read and interpret, rather than
expecting changes in the API.

Anyway, since there are already so many instances of this, perhaps it
is better to continue as you were.

Thanks for the patch!

Cheers

Paul

On Sun, Feb 28, 2010 at 9:57 PM, Tobias Burnus <burnus@net-b.de> wrote:
> Dear Paul,
>
> Paul Richard Thomas wrote:
>> It is my intention to go through the OOP implementation routing out
>> references to derived->components->.... in favour of using gfc_find_component
>> (derived, "$data", true, true) just so as not to weld in and bolt down
>> the representation of CLASS.  Could you do so here, please?
>>
>
> Well, I somehow find it a bit clumsy as one has to convert a pointer to
> a name, does string comparisons, goes back to a symbol; somehow
> gfc_find_component sounds like the wrong tool for this special task of
> fixing expressions after a module read. I will try to get something
> working, but a first try with the approach below ends with the
>
> Error: Derived type 's' at (1) is being used before it is defined
>
> for the test case included in the previous patch / PR 43199.
>
> Thus, I still prefer my previous patch which was approved by Janus on
> #gfortran (unmodified version).
> :-)
>
> Tobias
>



-- 
The knack of flying is learning how to throw yourself at the ground and miss.
       --Hitchhikers Guide to the Galaxy



More information about the Gcc-patches mailing list