On 2/10/25 2:25 AM, Andre Vehreschild wrote:
[PATCH 1/7] Fortran: Move caf_get-rewrite to rewrite.cc [PR107635]
Add a rewriter to keep all expression tree manipulation that is not
optimization together. At the moment this is just a move from resolve.cc,
but will be extended to handle more cases where rewriting the expression
tree may be easier. The first use case is to extract accessors for coarray
remote image data access.
gcc/fortran/ChangeLog:
PR fortran/107635
* Make-lang.in: Add rewrite.cc.
* gfortran.h (gfc_rewrite): New procedure.
* parse.cc (rewrite_expr_tree): Add entrypoint for rewriting
expression trees.
* resolve.cc (gfc_resolve_ref): Remove caf_lhs handling.
(get_arrayspec_from_expr): Moved to rewrite.cc.
(remove_coarray_from_derived_type): Same.
(convert_coarray_class_to_derived_type): Same.
(split_expr_at_caf_ref): Same.
(check_add_new_component): Same.
(create_get_parameter_type): Same.
(create_get_callback): Same.
(add_caf_get_intrinsic): Same.
(resolve_variable): Remove caf_lhs handling.
* rewrite.cc: New file.
libgfortran/ChangeLog:
* caf/single.c (_gfortran_caf_finalize): Free memory preventing
leaks.
(_gfortran_caf_get_by_ct): Fix constness.
--
Andre Vehreschild * Email: vehre ad gmx dot de
I have started to go through these patches for low hanging fruit. I
might be good if someone like Tobias or Paul looked deeper although I am
not really concerned too much as Andre is an expert.
I would like to suggest that you change the name of rewrite.cc to
coarray.cc since this is what it is dealing with.
Jerry