diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-11-02 10:02:21 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-11-02 10:02:21 +0100 |
commit | d0c464d27244ba47e66f3e1444354e423304bd12 (patch) | |
tree | bf2a4b0ab2cb56537d82c7caa73be8a0c0ed6173 /gcc/cp | |
parent | 628be4ef7078d5fcbd0096f7b11fb9a24e4da08a (diff) | |
download | gcc-d0c464d27244ba47e66f3e1444354e423304bd12.zip gcc-d0c464d27244ba47e66f3e1444354e423304bd12.tar.gz gcc-d0c464d27244ba47e66f3e1444354e423304bd12.tar.bz2 |
gimplify.h (omp_construct_selector_matches): Change return type to int, add a new SCORES argument.
* gimplify.h (omp_construct_selector_matches): Change return
type to int, add a new SCORES argument.
* gimplify.c (omp_construct_selector_matches): Likewise. If
SCORES is non-NULL, compute scores of each construct.
* omp-general.h (omp_get_context_selector): Declare.
* omp-general.c (omp_maybe_offloaded, omp_context_selector_matches):
Adjust omp_construct_selector_matches callers.
(omp_get_context_selector): New function, moved from c-family/c-omp.c.
(omp_context_compute_score): New function.
(omp_resolve_declare_variant): Compute scores and decide based on
that.
c-family/
* c-common.h (c_omp_get_context_selector): Remove.
* c-omp.c (c_omp_get_context_selector): Moved to omp-general.c
and renamed to omp_get_context_selector.
c/
* c-parser.c (c_finish_omp_declare_variant): Use
omp_get_context_selector instead of c_omp_get_context_selector.
cp/
* decl.c (omp_declare_variant_finalize_one): Use
omp_get_context_selector instead of c_omp_get_context_selector.
testsuite/
* c-c++-common/gomp/declare-variant-12.c: New test.
From-SVN: r277742
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/decl.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 54ed775..7b178e5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2019-11-02 Jakub Jelinek <jakub@redhat.com> + * decl.c (omp_declare_variant_finalize_one): Use + omp_get_context_selector instead of c_omp_get_context_selector. + PR c++/89640 * parser.c (cp_parser_decl_specifier_seq): Don't parse attributes if CP_PARSER_FLAGS_ONLY_MUTABLE_OR_CONSTEXPR. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 8f22f23..6057fbc 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -7103,7 +7103,7 @@ omp_declare_variant_finalize_one (tree decl, tree attr) DECL_ARGUMENTS (decl), NULL); tree ctx = TREE_VALUE (TREE_VALUE (attr)); - tree simd = c_omp_get_context_selector (ctx, "construct", "simd"); + tree simd = omp_get_context_selector (ctx, "construct", "simd"); if (simd) { TREE_VALUE (simd) @@ -7202,7 +7202,7 @@ omp_declare_variant_finalize_one (tree decl, tree attr) } else { - tree construct = c_omp_get_context_selector (ctx, "construct", NULL); + tree construct = omp_get_context_selector (ctx, "construct", NULL); c_omp_mark_declare_variant (match_loc, variant, construct); if (!omp_context_selector_matches (ctx)) return true; |