diff options
author | Daniel Kraft <d@domob.eu> | 2008-08-08 20:19:46 +0200 |
---|---|---|
committer | Daniel Kraft <domob@gcc.gnu.org> | 2008-08-08 20:19:46 +0200 |
commit | f6fad28ea1317a6aa30869b40c427ad56c6950c5 (patch) | |
tree | 678252b637e4e677cc46910a5305aa008a9af981 /gcc/fortran/gfortran.h | |
parent | 174ef36d7223171145b3d3eed56b6ebb9a5d63d9 (diff) | |
download | gcc-f6fad28ea1317a6aa30869b40c427ad56c6950c5.zip gcc-f6fad28ea1317a6aa30869b40c427ad56c6950c5.tar.gz gcc-f6fad28ea1317a6aa30869b40c427ad56c6950c5.tar.bz2 |
gfortran.h (gfc_finalizer): Replaced member `procedure' by two new members `proc_sym' and `proc_tree' to...
2008-08-08 Daniel Kraft <d@domob.eu>
* gfortran.h (gfc_finalizer): Replaced member `procedure' by two
new members `proc_sym' and `proc_tree' to store the symtree after
resolution.
(gfc_find_sym_in_symtree): Made public.
* decl.c (gfc_match_final_decl): Adapted for new member name.
* interface.c (gfc_find_sym_in_symtree): Made public.
(gfc_extend_expr), (gfc_extend_assign): Changed call accordingly.
* module.c (mio_finalizer), (mio_f2k_derived), (mio_full_f2k_derived):
New methods for module-file IO of f2k_derived.
(mio_symbol): Do IO of f2k_derived namespace.
* resolve.c (gfc_resolve_finalizers): Adapted for new member name and
finding the symtree for the symbol here.
* symbol.c (gfc_free_finalizer): Adapted for new members.
2008-08-08 Daniel Kraft <d@domob.eu>
* gfortran.dg/finalize_9.f03: New test.
* gfortran.dg/module_md5_1.f90: Adapted MD5-sum for changed module
file format.
From-SVN: r138884
Diffstat (limited to 'gcc/fortran/gfortran.h')
-rw-r--r-- | gcc/fortran/gfortran.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 5119248..e315cde 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1958,10 +1958,20 @@ extern iterator_stack *iter_stack; typedef struct gfc_finalizer { struct gfc_finalizer* next; - gfc_symbol* procedure; locus where; /* Where the FINAL declaration occurred. */ + + /* Up to resolution, we want the gfc_symbol, there we lookup the corresponding + symtree and later need only that. This way, we can access and call the + finalizers from every context as they should be "always accessible". I + don't make this a union because we need the information whether proc_sym is + still referenced or not for dereferencing it on deleting a gfc_finalizer + structure. */ + gfc_symbol* proc_sym; + gfc_symtree* proc_tree; } gfc_finalizer; +#define gfc_get_finalizer() XCNEW (gfc_finalizer) + /************************ Function prototypes *************************/ @@ -2399,6 +2409,7 @@ gfc_try gfc_extend_assign (gfc_code *, gfc_namespace *); gfc_try gfc_add_interface (gfc_symbol *); gfc_interface *gfc_current_interface_head (void); void gfc_set_current_interface_head (gfc_interface *); +gfc_symtree* gfc_find_sym_in_symtree (gfc_symbol*); /* io.c */ extern gfc_st_label format_asterisk; |