[patch, fortran] Make frontend walker more general

Steven Bosscher stevenb.gcc@gmail.com
Sat Sep 11 21:00:00 GMT 2010


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



More information about the Gcc-patches mailing list