This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] Make frontend walker more general
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: Thomas Koenig <tkoenig at netcologne dot de>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Sat, 11 Sep 2010 21:51:57 +0200
- Subject: Re: [patch, fortran] Make frontend walker more general
- References: <1284234002.5873.3.camel@linux-fd1f.site>
Hi,
To make the walker really generally usable, I would do a few things extra:
> +/* A struct for holding the pass-specific functions. */
> +typedef struct process_functions
> +{
> + void (*process_assignment) (gfc_code *);
> + void (*process_expr) (gfc_expr *);
I'd pass the gfc_code where the expr is in also:
void (*process_expr) (gfc_expr *, gfc_code *);
> + void (*process_actual_arglist) (gfc_actual_arglist *);
> + void (*process_pointer_assign) (gfc_code *);
> +} process_functions;
Nit: not gcc code style:
> +struct process_functions optimize_pass =
> + { optimize_assignment,
> + optimize_expr_0,
> + optimize_actual_arglist,
> + NULL };
I wonder how much of the resolve.c code can be rewritten to also use
this walker...
Ciao!
Steven