This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran] Make all arguments to ENTRY master optional
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: Steven Bosscher <stevenb at suse dot de>
- Cc: GCC Fortran mailing list <fortran at gcc dot gnu dot org>,patch <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 24 Aug 2004 17:31:46 +0200
- Subject: Re: [gfortran] Make all arguments to ENTRY master optional
- References: <412B5A5F.6050205@physik.uni-muenchen.de> <200408241718.02723.stevenb@suse.de>
Steven Bosscher wrote:
> You might want to explain this with a comment in the code.
Like so?
Index: resolve.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/resolve.c,v
retrieving revision 1.13
diff -u -p -r1.13 resolve.c
--- resolve.c 23 Aug 2004 21:53:14 -0000 1.13
+++ resolve.c 24 Aug 2004 15:28:21 -0000
@@ -312,6 +312,10 @@ merge_argument_lists (gfc_symbol *proc,
/* Add a new argument. Argument order is not important. */
new_arglist = gfc_get_formal_arglist ();
new_arglist->sym = new_sym;
+ /* We mark all arguments as optional, since in the common case
+ only a subset of the arguments will be present. This avoids
+ having to special case arguments of master functions later on. */
+ new_arglist->sym->attr.optional = 1;
new_arglist->next = proc->formal;
proc->formal = new_arglist;
}
> And a ChangeLog entry ;-)
Oops, here you are:
2004-08-24 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
* resolve.c (merge_argument_lists): Make all arguments optional.
* trans-array.c (gfc_trans_dummy_array_bias): Remove special handling
for arguments to entry master functions.
* trans-types.c (gfc_sym_type): Same.
- Tobi