aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2023-09-20 08:43:02 +0200
committerJakub Jelinek <jakub@redhat.com>2023-09-20 08:43:02 +0200
commit04b2fb5bb644f172879a02e8374ad50b669e3d6d (patch)
tree233009950b5218bbf9d39af714df2365572ebd85 /libgomp
parentd024a31a09d18d2586769602205a60ff3afe568c (diff)
downloadgcc-04b2fb5bb644f172879a02e8374ad50b669e3d6d.zip
gcc-04b2fb5bb644f172879a02e8374ad50b669e3d6d.tar.gz
gcc-04b2fb5bb644f172879a02e8374ad50b669e3d6d.tar.bz2
openmp: Add omp::decl attribute support [PR111392]
This patch adds support for (so far C++) omp::decl attribute. For declare simd and declare variant directives it is essentially another spelling of omp::decl, except per discussions it is not allowed inside of omp::sequence attribute. For threadprivate, declare target, allocate and later groupprivate directives it should appertain to variable (or for declare target also function definitions and) declarations and where in normal syntax one specifies a list of variables (or variables and functions), either as argument of the directive or clause argument, such argument is not specified and implied to be the variable it applies to. 2023-09-20 Jakub Jelinek <jakub@redhat.com> PR c++/111392 gcc/ * attribs.cc (decl_attributes): Don't warn on omp::directive attribute on vars or function decls if -fopenmp or -fopenmp-simd. gcc/c-family/ * c-omp.cc (c_omp_directives): Add commented out groupprivate directive entry. gcc/cp/ * parser.h (struct cp_lexer): Add in_omp_decl_attribute member. * cp-tree.h (cp_maybe_parse_omp_decl): Declare. * parser.cc (cp_parser_handle_statement_omp_attributes): Diagnose omp::decl attribute on statements. Adjust diagnostic wording for omp::decl. (cp_parser_omp_directive_args): Add DECL_P argument, set TREE_PUBLIC to it on the DEFERRED_PARSE tree. (cp_parser_omp_sequence_args): Adjust caller. (cp_parser_std_attribute): Handle omp::decl attribute. (cp_parser_omp_var_list): If parser->lexer->in_omp_decl_attribute don't expect any arguments, instead create clause or TREE_LIST for that decl. (cp_parser_late_parsing_omp_declare_simd): Adjust diagnostic wording for omp::decl. (cp_maybe_parse_omp_decl): New function. (cp_parser_omp_declare_target): If parser->lexer->in_omp_decl_attribute and first token isn't name or comma invoke cp_parser_omp_var_list. * decl2.cc (cplus_decl_attributes): Adjust diagnostic wording for omp::decl. Handle omp::decl on declarations. * name-lookup.cc (finish_using_directive): Adjust diagnostic wording for omp::decl. gcc/testsuite/ * g++.dg/gomp/attrs-19.C: New test. * g++.dg/gomp/attrs-20.C: New test. * g++.dg/gomp/attrs-21.C: New test. libgomp/ * libgomp.texi: Mark decl attribute was added to the C++ attribute syntax as implemented.
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/libgomp.texi2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi
index c6cd825..f5cb5b6 100644
--- a/libgomp/libgomp.texi
+++ b/libgomp/libgomp.texi
@@ -444,7 +444,7 @@ Technical Report (TR) 11 is the first preview for OpenMP 6.0.
@item Features deprecated in versions 5.2, 5.1 and 5.0 were removed
@tab N/A @tab Backward compatibility
@item The @code{decl} attribute was added to the C++ attribute syntax
- @tab N @tab
+ @tab Y @tab
@item @code{_ALL} suffix to the device-scope environment variables
@tab P @tab Host device number wrongly accepted
@item For Fortran, @emph{locator list} can be also function reference with