Finalization and automatic deallocation
Daniel Kraft
domob1812@gmail.com
Sun Jun 15 08:36:00 GMT 2008
Daniel Kraft wrote:
> What I'm thinking of in more detail: Port the gfc_finalize_expr &
> friends to working on trees together with gfc_symbol's representing
> their original derived-type rather than gfc_expr's so those can be used
> from trans; if this is ok, I'm also thinking of adding a new
> gfortran-internal statement-type EXEC_FINALIZE that can be added to the
> tree during resolution where appropriate so we still can implement some
> things in resolution when they are easier there. Those statements will
> then be converted to GIMPLE during trans using the ported
> finalization-method.
Just another thought: What do you think about moving auto-deallocation
logic from trans to resolution? I think it should be very much the same
like finalization to generate EXEC_DEALLOCATE statements there at the
needed places. And doing so could allow us to keep finalization in
resolution phase and still have no duplication. It could even be easier
to do auto-deallocation there.
After some more thoughts I think that finalization is really done easier
in resolution because much information needed (beyond the derived-type
an expression is of) will not (or I don't think it will) available in
trans, like expression rank (or is it available from a raw tree).
If you think this could be a good solution, I'll try to finish
finalization in resolution with possible duplication regarding
auto-deallocation first (the patch is already growing big I think), and
in the next step I can try to merge auto-deallocation from trans into my
finalization logic during resolution.
If I find time, I'll try to finish finalization as described above; but
I'd be happy to hear your comments as I'm not really aware of most the
details of gfortran...
Cheers,
Daniel
--
Done: Bar-Sam-Val-Wiz, Dwa-Elf-Hum-Orc, Cha-Law, Fem-Mal
Underway: Ran-Gno-Neu-Fem
To go: Arc-Cav-Hea-Kni-Mon-Pri-Rog-Tou
More information about the Fortran
mailing list