[Patch, Fortran] Add end-of-scope finalization (Part 1 of 2)
Tobias Burnus
burnus@net-b.de
Fri Jun 21 15:39:00 GMT 2013
This patch extends the already existing end-of-scope finalization to
nonallocatables.
Note: The patch only handles finalization of unsaved local variables
whose type has a finalizer (including finalizable nonallocatable
components or finalizers in the ancestor). In that case, the finalizer
is invoked and also calls - where applicable - the finalizer of the
allocatable components.
Part 2 will deal with derived-types with allocatable components which
have finalizers (for the case that derived type itself has none). This
requires a change to gfc_deallocate_alloc_comp, which will be done in
part 2.
Build and regtested on x86-64-gnu-linux.
OK for the trunk?
Best regards - and enjoy midsummer (the longest day - or the shortest if
you are in the southern hemisphere),
Tobias
PS: Finalization overview:
Working (except part 2 of this patch set): Finalization for intent(out),
end of scope, deallocate/allocate/move_alloc
Not working: Finalization of the LHS with intrinsic assignment and
function results + structure/array constructors
-------------- next part --------------
A non-text attachment was scrubbed...
Name: finalize-nonalloc.diff
Type: text/x-patch
Size: 7293 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20130621/6c1d1344/attachment.bin>
More information about the Fortran
mailing list