aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2019-07-12 09:49:51 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2019-07-12 09:49:51 +0200
commit1fdd6f0412922eb7438cbbadbb805fce8cc77485 (patch)
treef268df4071188f1117530ba47efd9179378fd239 /gcc/cp/semantics.c
parent3362737705972ba59976909b9dbff31615a1021a (diff)
downloadgcc-1fdd6f0412922eb7438cbbadbb805fce8cc77485.zip
gcc-1fdd6f0412922eb7438cbbadbb805fce8cc77485.tar.gz
gcc-1fdd6f0412922eb7438cbbadbb805fce8cc77485.tar.bz2
tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_ORDER.
* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_ORDER. * tree.c (omp_clause_num_ops, omp_clause_code_name): Add order clause entries. (walk_tree_1): Handle OMP_CLAUSE_ORDER. * tree-pretty-print.c (dump_omp_clause): Likewise. * gimplify.c (gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses): Likewise. * omp-low.c (scan_sharing_clauses): Likewise. * tree-nested.c (convert_nonlocal_omp_clauses, convert_local_omp_clauses): Likewise. c-family/ * c-pragma.h (enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_ORDER. * c-omp.c (c_omp_split_clauses): Handle splitting of OMP_CLAUSE_ORDER. c/ * c-parser.c (c_parser_omp_clause_name): Handle order clause. (c_parser_omp_clause_order): New function. (c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_ORDER. (OMP_SIMD_CLAUSE_MASK, OMP_FOR_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_ORDER. * c-typeck.c (c_finish_omp_clauses): Handle OMP_CLAUSE_ORDER. cp/ * parser.c (cp_parser_omp_clause_name): Handle order clause. (cp_parser_omp_clause_order): New function. (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_ORDER. (OMP_SIMD_CLAUSE_MASK, OMP_FOR_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_ORDER. * semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_ORDER. * pt.c (tsubst_omp_clauses): Likewise. testsuite/ * c-c++-common/gomp/order-1.c: New test. * c-c++-common/gomp/order-2.c: New test. From-SVN: r273431
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index aadfaff..1a21705 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -6127,6 +6127,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
bool branch_seen = false;
bool copyprivate_seen = false;
bool ordered_seen = false;
+ bool order_seen = false;
bool schedule_seen = false;
bool oacc_async = false;
tree last_iterators = NULL_TREE;
@@ -7600,6 +7601,13 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
ordered_seen = true;
break;
+ case OMP_CLAUSE_ORDER:
+ if (order_seen)
+ remove = true;
+ else
+ order_seen = true;
+ break;
+
case OMP_CLAUSE_INBRANCH:
case OMP_CLAUSE_NOTINBRANCH:
if (branch_seen)
@@ -7775,6 +7783,17 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
"%<reduction%> clause", "ordered");
pc = &OMP_CLAUSE_CHAIN (c);
continue;
+ case OMP_CLAUSE_ORDER:
+ if (ordered_seen)
+ {
+ error_at (OMP_CLAUSE_LOCATION (c),
+ "%<order%> clause must not be used together "
+ "with %<ordered%>");
+ *pc = OMP_CLAUSE_CHAIN (c);
+ continue;
+ }
+ pc = &OMP_CLAUSE_CHAIN (c);
+ continue;
case OMP_CLAUSE_NOWAIT:
if (copyprivate_seen)
{