Namely, this patch replaces bool by the newly added enum 'OMP_CTX_{METADIRECTIVE,{BEGIN_,}DECLARE_VARIANT}'.

Sandra Loosemore wrote:
The OpenMP "begin declare variant" directive has slightly different
requirements for context selectors than regular "declare variant", so
something more than a bool is required to tell the error-checking routine
what to check.
... admittedly, I find the OMP_CTX_.* also more readable than just true/false in the function call.
gcc/ChangeLog
        * omp-general.cc (omp_check_context_selector): Change
        metadirective_p argument to a 3-way flag.  Add extra check for
        OMP_CTX_BEGIN_DECLARE_VARIANT.
        * omp-general.h (enum omp_ctx_directive): New.
        (omp_check_context_selector): Adjust declaration.

gcc/c/ChangeLog
        * c-parser.cc (c_finish_omp_declare_variant): Update call to
        omp_check_context_selector.
        (c_parser_omp_metadirective): Likewise.

gcc/cp/ChangeLog
        * parser.cc (cp_finish_omp_declare_variant): Update call to
        omp_check_context_selector.
        (cp_parser_omp_metadirective): Likewise.

gcc/fortran/ChangeLog
        * trans-openmp.cc (gfc_trans_omp_declare_variant): Update call to
        omp_check_context_selector.
        (gfc_trans_omp_metadirective): Likewise.

LGTM for GCC 15.

Tobias

Reply via email to