[PATCH] Fortran frontend walker

Jakub Jelinek jakub@redhat.com
Thu Sep 16 17:52:00 GMT 2010


On Wed, Sep 15, 2010 at 11:12:46PM +0200, Thomas Koenig wrote:
> Two remarks:
> 
> 1. I see you have left the optimize_namespace function 'as is'.   Was
>   this intentional?  My feeling would be that this is more a part of the
>   walker, but maybe this would complicate the callback scheme more than
>   it is worth.  This is not critical, though.

I think only time will tell, but in many cases I think you don't want to
walk all the nested namespaces, in some cases only some of them (e.g.
referenced from EXEC_BLOCK), but not contained procedures, etc.

> 2. I would prefer the address of gfc_code ** variant, because it is
>    likely we would want to insert, delete or move code.
> 
> The patch is OK.  Thanks a lot for your patch!

Ok, thanks, committed.

> One remark you might want to consider before following the static
> analysis:

Well, the walker needs to be complete, walk all embedded gfc_exprs,
otherwise e.g. static points to wouldn't work correctly.
So it is not just about wanting or not wanting.

> In this version, references are not followed.  You would have to
> insert code like

Thanks.  Don't other EXPR types have ref, or is it just EXPR_VARIABLE?
If the references have embedded exprs, then those have to be walked.
Will look at it.

If you have other things the walker doesn't walk, please let me know.

	Jakub



More information about the Gcc-patches mailing list