diff options
author | Jakub Jelinek <jakub@redhat.com> | 2023-11-04 09:14:08 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2023-11-04 09:14:08 +0100 |
commit | 8067caa85d038bfec829b7e3bd6b82d34e562904 (patch) | |
tree | 1303615e3f3dde8f0a031fe25935ca9d3eaa72e4 /gcc/c/c-decl.cc | |
parent | 40b9af020fc2842b4e22ae06742088815400631e (diff) | |
download | gcc-8067caa85d038bfec829b7e3bd6b82d34e562904.zip gcc-8067caa85d038bfec829b7e3bd6b82d34e562904.tar.gz gcc-8067caa85d038bfec829b7e3bd6b82d34e562904.tar.bz2 |
openmp: Add omp::decl support for C2X
This patch adds omp::decl support which has been added recently for
C++ also to C.
2023-11-04 Jakub Jelinek <jakub@redhat.com>
* c-parser.h (c_maybe_parse_omp_decl): Declare.
* c-parser.cc (struct c_parser): Add in_omp_decl_attribute member.
(c_parser_std_attribute): Uncoment omp::decl handling.
(c_parser_omp_var_list_parens): If parser->in_omp_decl_attribute
don't expect any arguments, instead create clause or TREE_LIST for
that decl.
(c_maybe_parse_omp_decl): New function.
(c_parser_omp_declare_target): If parser->in_omp_decl_attribute and
first token isn't name or comma invoke c_parser_omp_var_list_parens.
* c-decl.cc (c_decl_attributes): Uncomment omp::decl handling and
use *node rather than non-existing *decl.
* gcc.dg/gomp/attrs-19.c: New test.
* gcc.dg/gomp/attrs-20.c: New test.
* gcc.dg/gomp/attrs-21.c: New test.
Diffstat (limited to 'gcc/c/c-decl.cc')
-rw-r--r-- | gcc/c/c-decl.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/c/c-decl.cc b/gcc/c/c-decl.cc index 33fb64d..0076725 100644 --- a/gcc/c/c-decl.cc +++ b/gcc/c/c-decl.cc @@ -5385,11 +5385,11 @@ c_decl_attributes (tree *node, tree attributes, int flags) { tree d = TREE_VALUE (a); gcc_assert (TREE_CODE (d) == C_TOKEN_VEC); -/* if (TREE_PUBLIC (d) - && (VAR_P (*decl) - || TREE_CODE (*decl) == FUNCTION_DECL) - && c_maybe_parse_omp_decl (*decl, d)) - continue; */ + if (TREE_PUBLIC (d) + && (VAR_P (*node) + || TREE_CODE (*node) == FUNCTION_DECL) + && c_maybe_parse_omp_decl (*node, d)) + continue; p = TREE_PUBLIC (d) ? "decl" : "directive"; } if (p && !diagnosed) |