aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorSandra Loosemore <sandra@codesourcery.com>2023-11-19 05:31:41 +0000
committerSandra Loosemore <sandra@codesourcery.com>2023-12-19 20:07:13 +0000
commit9b8fdcbf2105c65de231ea3db10aaf38e3f68530 (patch)
treea7fb852317f2ccab48ca2c2222153328788f1f15 /gcc/cp
parent82b32adaa7f9cf3be71a9d41d80570b9efb4c2f0 (diff)
downloadgcc-9b8fdcbf2105c65de231ea3db10aaf38e3f68530.zip
gcc-9b8fdcbf2105c65de231ea3db10aaf38e3f68530.tar.gz
gcc-9b8fdcbf2105c65de231ea3db10aaf38e3f68530.tar.bz2
OpenMP: Unify representation of name-list properties.
Previously, name-list properties specified as identifiers were stored in the TREE_PURPOSE/OMP_TP_NAME slot, while those specified as strings were stored in the TREE_VALUE/OMP_TP_VALUE slot. This patch puts both representations in OMP_TP_VALUE with a magic cookie in OMP_TP_NAME. gcc/ChangeLog * omp-general.h (OMP_TP_NAMELIST_NODE): New. * omp-general.cc (omp_context_name_list_prop): Move earlier in the file, and adjust for new representation. (omp_check_context_selector): Adjust this too. (omp_context_selector_props_compare): Likewise. gcc/c/ChangeLog * c-parser.cc (c_parser_omp_context_selector): Adjust for new namelist property representation. gcc/cp/ChangeLog * parser.cc (cp_parser_omp_context_selector): Adjust for new namelist property representation. * pt.cc (tsubst_attribute): Likewise. gcc/fortran/ChangeLog * trans-openmp.cc (gfc_trans_omp_declare_varaint): Adjust for new namelist property representation.
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/parser.cc5
-rw-r--r--gcc/cp/pt.cc4
2 files changed, 6 insertions, 3 deletions
diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
index 5a91637..3250b0b 100644
--- a/gcc/cp/parser.cc
+++ b/gcc/cp/parser.cc
@@ -47630,11 +47630,12 @@ cp_parser_omp_context_selector (cp_parser *parser, tree set, bool has_parms_p)
case CTX_PROPERTY_NAME_LIST:
do
{
- tree prop = NULL_TREE, value = NULL_TREE;
+ tree prop = OMP_TP_NAMELIST_NODE;
+ tree value = NULL_TREE;
if (cp_lexer_next_token_is (parser->lexer, CPP_KEYWORD)
|| cp_lexer_next_token_is (parser->lexer, CPP_NAME))
{
- prop = cp_lexer_peek_token (parser->lexer)->u.value;
+ value = cp_lexer_peek_token (parser->lexer)->u.value;
cp_lexer_consume_token (parser->lexer);
}
else if (cp_lexer_next_token_is (parser->lexer, CPP_STRING))
diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index a752dcf..ef280e4 100644
--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -11939,7 +11939,9 @@ tsubst_attribute (tree t, tree *decl_p, tree args,
}
properties = copy_list (OMP_TS_PROPERTIES (ts));
for (tree p = properties; p; p = TREE_CHAIN (p))
- if (OMP_TP_VALUE (p))
+ if (OMP_TP_NAME (p) == OMP_TP_NAMELIST_NODE)
+ continue;
+ else if (OMP_TP_VALUE (p))
{
bool allow_string
= (OMP_TS_ID (ts) != condition || set[0] != 'u');