omp-general.c (omp_context_name_list_prop): New function.
authorJakub Jelinek <jakub@redhat.com>
Thu, 14 Nov 2019 08:12:10 +0000 (09:12 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 14 Nov 2019 08:12:10 +0000 (09:12 +0100)
commitb2417b59d4be2e5e882dec5ae3b373f69331d6e2
treeb3d7af488c90ecd3476ef6b9d1f9e4cbfc00051b
parentf14713178d25db56903458432b0e3dbf35dbe840
omp-general.c (omp_context_name_list_prop): New function.

* omp-general.c (omp_context_name_list_prop): New function.
(omp_context_selector_matches): Use it.  Return 0 if it returns
NULL.
(omp_context_selector_props_compare): Allow equivalency of an
identifier and a string literal containing no embedded zeros.
c-family/
* c-omp.c (c_omp_check_context_selector): Handle name lists
containing string literals.  Don't diagnose atomic_default_mem_order
with multiple props.
c/
* c-parser.c (c_parser_omp_context_selector): Rename
CTX_PROPERTY_IDLIST to CTX_PROPERTY_NAME_LIST, add CTX_PROPERTY_ID.
Use CTX_PROPERTY_ID for atomic_default_mem_order, only allow a single
identifier in that.  For CTX_PROPERTY_NAME_LIST, allow identifiers
and string literals.
cp/
* parser.c (cp_parser_omp_context_selector): Rename
CTX_PROPERTY_IDLIST to CTX_PROPERTY_NAME_LIST, add CTX_PROPERTY_ID.
Use CTX_PROPERTY_ID for atomic_default_mem_order, only allow a single
identifier in that.  For CTX_PROPERTY_NAME_LIST, allow identifiers
and string literals.
* pt.c (tsubst_attribute): Fix up STRING_CST handling if allow_string.
testsuite/
* c-c++-common/gomp/declare-variant-2.c: Adjust expected diagnostics,
add a test for atomic_default_mem_order with a string literal.
* c-c++-common/gomp/declare-variant-3.c: Use string literal props
in a few random places, add a few string literal prop related tests.
* c-c++-common/gomp/declare-variant-8.c: Likewise.
* c-c++-common/gomp/declare-variant-9.c: Use string literal props
in a few random places.
* c-c++-common/gomp/declare-variant-10.c: Likewise.
* c-c++-common/gomp/declare-variant-11.c: Likewise.
* c-c++-common/gomp/declare-variant-12.c: Likewise.
* g++.dg/gomp/declare-variant-7.C: Likewise.

From-SVN: r278202
18 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-omp.c
gcc/c/ChangeLog
gcc/c/c-parser.c
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/cp/pt.c
gcc/omp-general.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/gomp/declare-variant-10.c
gcc/testsuite/c-c++-common/gomp/declare-variant-11.c
gcc/testsuite/c-c++-common/gomp/declare-variant-12.c
gcc/testsuite/c-c++-common/gomp/declare-variant-2.c
gcc/testsuite/c-c++-common/gomp/declare-variant-3.c
gcc/testsuite/c-c++-common/gomp/declare-variant-8.c
gcc/testsuite/c-c++-common/gomp/declare-variant-9.c
gcc/testsuite/g++.dg/gomp/declare-variant-7.C