diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-10-25 00:29:09 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-10-25 00:29:09 +0200 |
commit | 135df52cc3f1ef90092ab02a01c4dabc7fd0ed18 (patch) | |
tree | 788a3c845a393f73563f1c4dba757939c85265ff /gcc/c | |
parent | f8cb8bcde13df2f2b1a996567c849ec512eec210 (diff) | |
download | gcc-135df52cc3f1ef90092ab02a01c4dabc7fd0ed18.zip gcc-135df52cc3f1ef90092ab02a01c4dabc7fd0ed18.tar.gz gcc-135df52cc3f1ef90092ab02a01c4dabc7fd0ed18.tar.bz2 |
gimplify.h (omp_construct_selector_matches): Declare.
* gimplify.h (omp_construct_selector_matches): Declare.
* gimplify.c (struct gimplify_omp_ctx): Add code member.
(gimplify_call_expr): Call omp_resolve_declare_variant and remap
called function if needed for flag_openmp.
(gimplify_scan_omp_clauses): Set ctx->code.
(omp_construct_selector_matches): New function.
* omp-general.h (omp_constructor_traits_to_codes,
omp_context_selector_matches, omp_resolve_declare_variant): Declare.
* omp-general.c (omp_constructor_traits_to_codes,
omp_context_selector_matches, omp_resolve_declare_variant): New
functions.
c-family/
* c-common.h (c_omp_context_selector_matches): Remove.
* c-omp.c (c_omp_context_selector_matches): Remove.
* c-attribs.c (c_common_attribute_table): Add
"omp declare target {host,nohost,block}" attributes.
c/
* c-parser.c (c_finish_omp_declare_variant): Use
omp_context_selector_matches instead of
c_omp_context_selector_matches.
* c-decl.c (c_decl_attributes): Add "omp declare target block"
attribute in between declare target and end declare target
pragmas.
cp/
* decl2.c (cplus_decl_attributes): Add "omp declare target block"
attribute in between declare target and end declare target
pragmas.
testsuite/
* c-c++-common/gomp/declare-variant-8.c: New test.
From-SVN: r277427
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/c/c-decl.c | 8 | ||||
-rw-r--r-- | gcc/c/c-parser.c | 2 |
3 files changed, 16 insertions, 3 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 0cf32f6..e8518f2 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,12 @@ +2019-10-24 Jakub Jelinek <jakub@redhat.com> + + * c-parser.c (c_finish_omp_declare_variant): Use + omp_context_selector_matches instead of + c_omp_context_selector_matches. + * c-decl.c (c_decl_attributes): Add "omp declare target block" + attribute in between declare target and end declare target + pragmas. + 2019-10-15 Joseph Myers <joseph@codesourcery.com> * c-parser.c (c_parser_attribute_any_word): Rename to diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index f67033b..c6c4a4d 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -4832,8 +4832,12 @@ c_decl_attributes (tree *node, tree attributes, int flags) attributes = tree_cons (get_identifier ("omp declare target implicit"), NULL_TREE, attributes); else - attributes = tree_cons (get_identifier ("omp declare target"), - NULL_TREE, attributes); + { + attributes = tree_cons (get_identifier ("omp declare target"), + NULL_TREE, attributes); + attributes = tree_cons (get_identifier ("omp declare target block"), + NULL_TREE, attributes); + } } /* Look up the current declaration with all the attributes merged diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 7618a46..9589cc6 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -19489,7 +19489,7 @@ c_finish_omp_declare_variant (c_parser *parser, tree fndecl, tree parms) C_DECL_USED (variant) = 1; tree construct = c_omp_get_context_selector (ctx, "construct", NULL); c_omp_mark_declare_variant (match_loc, variant, construct); - if (c_omp_context_selector_matches (ctx)) + if (omp_context_selector_matches (ctx)) { tree attr = tree_cons (get_identifier ("omp declare variant base"), |