This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, fortran] Make frontend walker more general


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]