[PATCH 2/3] Factor out duplicate code in gimplify_scan_omp_clauses

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 2/3] Factor out duplicate code in gimplify_scan_omp_clauses

Julian Brown-2

This patch, created while trying to figure out the open-coded linked-list
handling in gimplify_scan_omp_clauses, factors out four somewhat
repetitive portions of that function into two new outlined functions.
This was done largely mechanically; the actual lines of executed code are
more-or-less the same.  That means the interfaces to the new functions
is somewhat eccentric though, and could no doubt be improved.  I've tried
to add commentary to the best of my understanding, but suggestions for
improvements are welcome!

As a bonus, one apparent bug introduced during an earlier refactoring
to use the polynomial types has been fixed (I think!): "known_eq (o1,
2)" should have been "known_eq (o1, o2)".

Tested alongside other patches in this series and the async patches. OK?

ChangeLog

        gcc/
        * gimplify.c (insert_struct_component_mapping)
        (check_base_and_compare_lt): New.
        (gimplify_scan_omp_clauses): Outline duplicated code into calls to
        above two functions.
---
 gcc/gimplify.c | 307 ++++++++++++++++++++++++++++++++-------------------------
 1 file changed, 174 insertions(+), 133 deletions(-)


0002-Factor-out-duplicate-code-in-gimplify_scan_omp_claus.patch (12K) Download Attachment