ABSTRACT interfaces + PROCEDURE declarations
Paul Thomas
paulthomas2@wanadoo.fr
Thu Aug 16 12:28:00 GMT 2007
Janus,
>
> Paul Thomas did some kind of "quick 'n' dirty" solution for this, i.e.
> he put the interface symbol into the sym->formal field of the
> procedure. This was probably intended mainly for procedure pointers,
> where it could work out. But if the procedure is actually implemented
> by some function or subroutine the sym->formal will be overridden by
> the actual formal args and the information on the interface in lost.
>
It was indeed a quick and dirty solution; however, there is no reason
why it should not work fine, even when the procedure is not a pointer.
After all, the procedure attribute flags that the first formal symbol is
the interface symbol and its formal arguments can be used instead of
that of the procedure. I'm not proposing that you should do that but am
just pointing out that it would work perfectly well
> The cleanest solution for this would probably be to add an extra field
> for the procedure interface somewhere in gfc_symbol or gfc_typespec. I
> had a look at the g95 sources, and they have a "sym->ts.interface"
> field which holds the symbol for the procedure interface. Probably we
> should do the same. What do you think? Should we put this field in
> gfc_symbol or gfc_typespec?
>
Either would be fine. Perhaps it is time to carry out the TODO in
gfortran.h and make a union of 'cl' and 'derived' .... + 'interface'?
Have you made any progress with the TREE-SSA declaration of a procedure
pointer? It is quite obvious, looking back, that I was barking up the
wrong tree completely. Do you want me to do some further investigation?
Cheers
Paul
> Cheers,
> Janus
>
>
>
More information about the Fortran
mailing list