gfortran.h: New statement-type ST_FINAL for FINAL declarations.
authorDaniel Kraft <d@domob.eu>
Mon, 2 Jun 2008 20:03:03 +0000 (22:03 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Mon, 2 Jun 2008 20:03:03 +0000 (22:03 +0200)
commit345235247ae4c80dcd98e7630d35be32533a35a1
treef807af3263648b3c930fb63529f59d6393a35f3e
parent236ec2d7eeb645497c80e1e67cde4c490cce44a1
gfortran.h: New statement-type ST_FINAL for FINAL declarations.

2008-06-02  Daniel Kraft  <d@domob.eu>

        * gfortran.h:  New statement-type ST_FINAL for FINAL declarations.
        (struct gfc_symbol):  New member f2k_derived.
        (struct gfc_namespace):  New member finalizers, for use in the above
        mentioned f2k_derived namespace.
        (struct gfc_finalizer):  New type defined for finalizers linked list.
        * match.h (gfc_match_final_decl):  New function header.
        * decl.c (gfc_match_derived_decl):  Create f2k_derived namespace
        on constructed symbol node.
        (gfc_match_final_decl):  New function to match a FINAL declaration line.
        * parse.c (decode_statement):  match-call for keyword FINAL.
        (parse_derived):  Parse CONTAINS section and accept FINAL statements.
        * resolve.c (gfc_resolve_finalizers):  New function to resolve
        (that is in this case, check) a list of finalizer procedures.
        (resolve_fl_derived):  Call gfc_resolve_finalizers here.
        * symbol.c (gfc_get_namespace):  Initialize new finalizers to NULL.
        (gfc_free_namespace):  Free finalizers list.
        (gfc_new_symbol):  Initialize new f2k_derived to NULL.
        (gfc_free_symbol):  Free f2k_derived namespace.
        (gfc_free_finalizer):  New function to free a single gfc_finalizer node.
        (gfc_free_finalizer_list):  New function to free a linked list of
        gfc_finalizer nodes.

2008-06-02  Daniel Kraft  <d@domob.eu>

        * finalize_1.f08:  New test.
        * finalize_2.f03:  New test.
        * finalize_3.f03:  New test.
        * finalize_4.f03:  New test.
        * finalize_5.f03:  New test.
        * finalize_6.f90:  New test.
        * finalize_7.f03:  New test.
        * finalize_8.f03:  New test.

From-SVN: r136293
16 files changed:
gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/fortran/gfortran.h
gcc/fortran/match.h
gcc/fortran/parse.c
gcc/fortran/resolve.c
gcc/fortran/symbol.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/finalize_1.f08 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/finalize_2.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/finalize_3.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/finalize_4.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/finalize_5.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/finalize_6.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/finalize_7.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/finalize_8.f03 [new file with mode: 0644]