Hi Sandra, On 17.12.23 20:02, Sandra Loosemore wrote:
This patch introduces enumerators to represent trait-set names and trait names, which makes it easier to use tables to control other behavior and for switch statements to dispatch on the tags. The tags are stored in the same place in the TREE_LIST structure (OMP_TSS_ID or OMP_TS_ID) and are encoded there as integer constants
LGTM, except for minor nits:
diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc index b5bed5ee276..b44710d2768 100644 --- a/gcc/c/c-parser.cc +++ b/gcc/c/c-parser.cc @@ -24503,7 +24454,12 @@ c_parser_omp_context_selector (c_parser *parser, tree set, tree parms) tree score = c_parser_expr_no_commas (parser, NULL).value; parens2.skip_until_found_close (parser); c_parser_require (parser, CPP_COLON, "expected %<:%>"); - if (score != error_mark_node) + if (!allow_score) + error_at (token->location, + "score cannot be specified in traits " + "in the %qs trait-selector-set",
I think it should be '%<score%>'. Likewise for:
+ sorry_at (token->location, + "requires selector is not supported yet");
%<requires%> It simply reads a bit clearer, especially when quoted strings render bold in the terminal, but also without, having the '...' is a bit clearer. Likewise for C++ and for Fortran. (Albeit for Fortran, there the question is whether it should be SCORE or %<score%>, the current wording is not completely consistent; the FE prefers all uppercase (but is not consistent) while the ME of course uses %qs / %<...%>, only.) Can you also add a diagnostic testcase for 'score' (C/C++ and Fortran)? BTW: For 'requires()' I have now opened a PR to track this, cf. https://gcc.gnu.org/PR113067 Thanks, Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955