]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: Move caf_get-rewrite to coarray.cc [PR107635]
authorAndre Vehreschild <vehre@gcc.gnu.org>
Wed, 8 Jan 2025 11:33:27 +0000 (12:33 +0100)
committerAndre Vehreschild <vehre@gcc.gnu.org>
Thu, 20 Feb 2025 09:19:46 +0000 (10:19 +0100)
commit90ba8291c31f2cfb6a8c7bf0c0d6a9d93bbbacc9
treef5f29f86122a00e02250e3f9d157b5442ca1f102
parent94d01a884702934bc03ccedff62e2c65515c8c83
Fortran: Move caf_get-rewrite to coarray.cc [PR107635]

Add a rewriter to keep all expression tree 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 coarray.cc.
* coarray.cc: New file.
* gfortran.h (gfc_coarray_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.

libgfortran/ChangeLog:

* caf/single.c (_gfortran_caf_finalize): Free memory preventing
leaks.
(_gfortran_caf_get_by_ct): Fix constness.
* caf/libcaf.h (_gfortran_caf_register_accessor): Fix constness.
gcc/fortran/Make-lang.in
gcc/fortran/coarray.cc [new file with mode: 0644]
gcc/fortran/gfortran.h
gcc/fortran/parse.cc
gcc/fortran/resolve.cc
libgfortran/caf/libcaf.h
libgfortran/caf/single.c