]> git.ipfire.org Git - thirdparty/gcc.git/commit
[og10] Refactor struct lowering for OpenACC/OpenMP in gimplify.c
authorJulian Brown <julian@codesourcery.com>
Tue, 18 May 2021 17:08:22 +0000 (10:08 -0700)
committerJulian Brown <julian@codesourcery.com>
Wed, 19 May 2021 22:05:24 +0000 (15:05 -0700)
commit806fef866186c5c86a23ca7b1a11c2047589c890
tree1ec8220e6068af3b2a90183f4d0e3ce934299322
parent529109bf9e3b22df6ec9111c1a0fb8af0293a452
[og10] Refactor struct lowering for OpenACC/OpenMP in gimplify.c

This patch is a second attempt at refactoring struct component mapping
handling for OpenACC/OpenMP during gimplification, after the patch I
posted here:

  https://gcc.gnu.org/pipermail/gcc-patches/2018-November/510503.html

And improved here, post-review:

  https://gcc.gnu.org/pipermail/gcc-patches/2019-November/533394.html

This patch goes further, in that the struct-handling code is outlined
into its own function (to create the "GOMP_MAP_STRUCT" node and the
sorted list of nodes immediately following it, from a set of mappings
of components of a given struct or derived type). I've also gone through
the list-handling code and attempted to add comments documenting how it
works to the best of my understanding, and broken out a couple of helper
functions in order to (hopefully) have the code self-document better also.

2021-05-19  Julian Brown  <julian@codesourcery.com>

gcc/
* gimplify.c (insert_struct_comp_map): Refactor function into...
(build_struct_comp_nodes): This new function.  Remove list handling
and improve self-documentation.
(insert_node_after, move_node_after, move_nodes_after,
move_concat_nodes_after): New helper functions.
(build_struct_group): New function to build up GOMP_MAP_STRUCT node
groups to map struct components. Outlined from...
(gimplify_scan_omp_clauses): Here.  Call above function.
gcc/gimplify.c