@@ -11987,7 +11987,7 @@ c_parser_oacc_cache (location_t loc, c_parser *parser)
stmt = make_node (OACC_CACHE);
TREE_TYPE (stmt) = void_type_node;
- OACC_CACHE_CLAUSES (stmt) = clauses;
+ OMP_STANDALONE_CLAUSES (stmt) = clauses;
SET_EXPR_LOCATION (stmt, loc);
add_stmt (stmt);
@@ -12155,10 +12155,7 @@ c_parser_oacc_enter_exit_data (c_parser *parser, bool enter)
stmt = enter ? make_node (OACC_ENTER_DATA) : make_node (OACC_EXIT_DATA);
TREE_TYPE (stmt) = void_type_node;
- if (enter)
- OACC_ENTER_DATA_CLAUSES (stmt) = clauses;
- else
- OACC_EXIT_DATA_CLAUSES (stmt) = clauses;
+ OMP_STANDALONE_CLAUSES (stmt) = clauses;
SET_EXPR_LOCATION (stmt, loc);
add_stmt (stmt);
}
@@ -12285,7 +12282,7 @@ c_parser_oacc_update (c_parser *parser)
tree stmt = make_node (OACC_UPDATE);
TREE_TYPE (stmt) = void_type_node;
- OACC_UPDATE_CLAUSES (stmt) = clauses;
+ OMP_STANDALONE_CLAUSES (stmt) = clauses;
SET_EXPR_LOCATION (stmt, loc);
add_stmt (stmt);
}
@@ -13858,7 +13855,7 @@ c_parser_omp_target_update (location_t loc, c_parser *parser,
tree stmt = make_node (OMP_TARGET_UPDATE);
TREE_TYPE (stmt) = void_type_node;
- OMP_TARGET_UPDATE_CLAUSES (stmt) = clauses;
+ OMP_STANDALONE_CLAUSES (stmt) = clauses;
SET_EXPR_LOCATION (stmt, loc);
add_stmt (stmt);
return false;
@@ -31386,7 +31386,7 @@ cp_parser_omp_target_update (cp_parser *parser, cp_token *pragma_tok,
tree stmt = make_node (OMP_TARGET_UPDATE);
TREE_TYPE (stmt) = void_type_node;
- OMP_TARGET_UPDATE_CLAUSES (stmt) = clauses;
+ OMP_STANDALONE_CLAUSES (stmt) = clauses;
SET_EXPR_LOCATION (stmt, pragma_tok->location);
add_stmt (stmt);
return false;
@@ -31496,7 +31496,7 @@ cp_parser_oacc_cache (cp_parser *parser, cp_token *pragma_tok)
stmt = make_node (OACC_CACHE);
TREE_TYPE (stmt) = void_type_node;
- OACC_CACHE_CLAUSES (stmt) = clauses;
+ OMP_STANDALONE_CLAUSES (stmt) = clauses;
SET_EXPR_LOCATION (stmt, pragma_tok->location);
add_stmt (stmt);
@@ -31606,10 +31606,7 @@ cp_parser_oacc_enter_exit_data (cp_parser *parser, cp_token *pragma_tok,
stmt = enter ? make_node (OACC_ENTER_DATA) : make_node (OACC_EXIT_DATA);
TREE_TYPE (stmt) = void_type_node;
- if (enter)
- OACC_ENTER_DATA_CLAUSES (stmt) = clauses;
- else
- OACC_EXIT_DATA_CLAUSES (stmt) = clauses;
+ OMP_STANDALONE_CLAUSES (stmt) = clauses;
SET_EXPR_LOCATION (stmt, pragma_tok->location);
add_stmt (stmt);
return stmt;
@@ -31746,7 +31743,7 @@ cp_parser_oacc_update (cp_parser *parser, cp_token *pragma_tok)
stmt = make_node (OACC_UPDATE);
TREE_TYPE (stmt) = void_type_node;
- OACC_UPDATE_CLAUSES (stmt) = clauses;
+ OMP_STANDALONE_CLAUSES (stmt) = clauses;
SET_EXPR_LOCATION (stmt, pragma_tok->location);
add_stmt (stmt);
return stmt;
@@ -14203,10 +14203,10 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl,
break;
case OMP_TARGET_UPDATE:
- tmp = tsubst_omp_clauses (OMP_TARGET_UPDATE_CLAUSES (t), false,
+ tmp = tsubst_omp_clauses (OMP_STANDALONE_CLAUSES (t), false,
args, complain, in_decl);
t = copy_node (t);
- OMP_TARGET_UPDATE_CLAUSES (t) = tmp;
+ OMP_STANDALONE_CLAUSES (t) = tmp;
add_stmt (t);
break;
@@ -6799,8 +6799,9 @@ gimplify_oacc_cache (tree *expr_p, gimple_seq *pre_p)
{
tree expr = *expr_p;
- gimplify_scan_omp_clauses (&OACC_CACHE_CLAUSES (expr), pre_p, ORT_WORKSHARE);
- gimplify_adjust_omp_clauses (pre_p, &OACC_CACHE_CLAUSES (expr));
+ gimplify_scan_omp_clauses (&OMP_STANDALONE_CLAUSES (expr), pre_p,
+ ORT_WORKSHARE);
+ gimplify_adjust_omp_clauses (pre_p, &OMP_STANDALONE_CLAUSES (expr));
/* TODO: Do something sensible with this information. */
@@ -7427,34 +7428,31 @@ gimplify_omp_workshare (tree *expr_p, gimple_seq *pre_p)
static void
gimplify_omp_target_update (tree *expr_p, gimple_seq *pre_p)
{
- tree expr = *expr_p, clauses;
+ tree expr = *expr_p;
int kind;
gomp_target *stmt;
switch (TREE_CODE (expr))
{
case OACC_ENTER_DATA:
- clauses = OACC_ENTER_DATA_CLAUSES (expr);
kind = GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA;
break;
case OACC_EXIT_DATA:
- clauses = OACC_EXIT_DATA_CLAUSES (expr);
kind = GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA;
break;
case OACC_UPDATE:
- clauses = OACC_UPDATE_CLAUSES (expr);
kind = GF_OMP_TARGET_KIND_OACC_UPDATE;
break;
case OMP_TARGET_UPDATE:
- clauses = OMP_TARGET_UPDATE_CLAUSES (expr);
kind = GF_OMP_TARGET_KIND_UPDATE;
break;
default:
gcc_unreachable ();
}
- gimplify_scan_omp_clauses (&clauses, pre_p, ORT_WORKSHARE);
- gimplify_adjust_omp_clauses (pre_p, &clauses);
- stmt = gimple_build_omp_target (NULL, kind, clauses);
+ gimplify_scan_omp_clauses (&OMP_STANDALONE_CLAUSES (expr), pre_p,
+ ORT_WORKSHARE);
+ gimplify_adjust_omp_clauses (pre_p, &OMP_STANDALONE_CLAUSES (expr));
+ stmt = gimple_build_omp_target (NULL, kind, OMP_STANDALONE_CLAUSES (expr));
gimplify_seq_add_stmt (pre_p, stmt);
*expr_p = NULL_TREE;
@@ -2585,27 +2585,27 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, int flags,
case OACC_DECLARE:
pp_string (pp, "#pragma acc declare");
- dump_omp_clauses (pp, OACC_DECLARE_CLAUSES (node), spc, flags);
+ dump_omp_clauses (pp, OMP_STANDALONE_CLAUSES (node), spc, flags);
break;
case OACC_UPDATE:
pp_string (pp, "#pragma acc update");
- dump_omp_clauses (pp, OACC_UPDATE_CLAUSES (node), spc, flags);
+ dump_omp_clauses (pp, OMP_STANDALONE_CLAUSES (node), spc, flags);
break;
case OACC_ENTER_DATA:
pp_string (pp, "#pragma acc enter data");
- dump_omp_clauses (pp, OACC_ENTER_DATA_CLAUSES (node), spc, flags);
+ dump_omp_clauses (pp, OMP_STANDALONE_CLAUSES (node), spc, flags);
break;
case OACC_EXIT_DATA:
pp_string (pp, "#pragma acc exit data");
- dump_omp_clauses (pp, OACC_EXIT_DATA_CLAUSES (node), spc, flags);
+ dump_omp_clauses (pp, OMP_STANDALONE_CLAUSES (node), spc, flags);
break;
case OACC_CACHE:
pp_string (pp, "#pragma acc cache");
- dump_omp_clauses (pp, OACC_CACHE_CLAUSES (node), spc, flags);
+ dump_omp_clauses (pp, OMP_STANDALONE_CLAUSES (node), spc, flags);
break;
case OMP_PARALLEL:
@@ -2673,7 +2673,7 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, int flags,
case OMP_TARGET_UPDATE:
pp_string (pp, "#pragma omp target update");
- dump_omp_clauses (pp, OMP_TARGET_UPDATE_CLAUSES (node), spc, flags);
+ dump_omp_clauses (pp, OMP_STANDALONE_CLAUSES (node), spc, flags);
is_expr = false;
break;
@@ -1157,28 +1157,28 @@ DEFTREECODE (OMP_ORDERED, "omp_ordered", tcc_statement, 1)
DEFTREECODE (OMP_CRITICAL, "omp_critical", tcc_statement, 2)
/* OpenACC - #pragma acc cache (variable1 ... variableN)
- Operand 0: OACC_CACHE_CLAUSES: List of variables (transformed into
+ Operand 0: OMP_STANDALONE_CLAUSES: List of variables (transformed into
OMP_CLAUSE__CACHE_ clauses). */
DEFTREECODE (OACC_CACHE, "oacc_cache", tcc_statement, 1)
/* OpenACC - #pragma acc declare [clause1 ... clauseN]
- Operand 0: OACC_DECLARE_CLAUSES: List of clauses. */
+ Operand 0: OMP_STANDALONE_CLAUSES: List of clauses. */
DEFTREECODE (OACC_DECLARE, "oacc_declare", tcc_statement, 1)
/* OpenACC - #pragma acc enter data [clause1 ... clauseN]
- Operand 0: OACC_ENTER_DATA_CLAUSES: List of clauses. */
+ Operand 0: OMP_STANDALONE_CLAUSES: List of clauses. */
DEFTREECODE (OACC_ENTER_DATA, "oacc_enter_data", tcc_statement, 1)
/* OpenACC - #pragma acc exit data [clause1 ... clauseN]
- Operand 0: OACC_EXIT_DATA_CLAUSES: List of clauses. */
+ Operand 0: OMP_STANDALONE_CLAUSES: List of clauses. */
DEFTREECODE (OACC_EXIT_DATA, "oacc_exit_data", tcc_statement, 1)
/* OpenACC - #pragma acc update [clause1 ... clauseN]
- Operand 0: OACC_UPDATE_CLAUSES: List of clauses. */
+ Operand 0: OMP_STANDALONE_CLAUSES: List of clauses. */
DEFTREECODE (OACC_UPDATE, "oacc_update", tcc_statement, 1)
/* OpenMP - #pragma omp target update [clause1 ... clauseN]
- Operand 0: OMP_TARGET_UPDATE_CLAUSES: List of clauses. */
+ Operand 0: OMP_STANDALONE_CLAUSES: List of clauses. */
DEFTREECODE (OMP_TARGET_UPDATE, "omp_target_update", tcc_statement, 1)
/* OMP_ATOMIC through OMP_ATOMIC_CAPTURE_NEW must be consecutive,
@@ -1222,21 +1222,6 @@ extern void protected_set_expr_location (tree, location_t);
#define OACC_HOST_DATA_CLAUSES(NODE) \
TREE_OPERAND (OACC_HOST_DATA_CHECK (NODE), 1)
-#define OACC_CACHE_CLAUSES(NODE) \
- TREE_OPERAND (OACC_CACHE_CHECK (NODE), 0)
-
-#define OACC_DECLARE_CLAUSES(NODE) \
- TREE_OPERAND (OACC_DECLARE_CHECK (NODE), 0)
-
-#define OACC_ENTER_DATA_CLAUSES(NODE) \
- TREE_OPERAND (OACC_ENTER_DATA_CHECK (NODE), 0)
-
-#define OACC_EXIT_DATA_CLAUSES(NODE) \
- TREE_OPERAND (OACC_EXIT_DATA_CHECK (NODE), 0)
-
-#define OACC_UPDATE_CLAUSES(NODE) \
- TREE_OPERAND (OACC_UPDATE_CHECK (NODE), 0)
-
#define OMP_PARALLEL_BODY(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 0)
#define OMP_PARALLEL_CLAUSES(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 1)
@@ -1283,8 +1268,8 @@ extern void protected_set_expr_location (tree, location_t);
#define OMP_TARGET_BODY(NODE) TREE_OPERAND (OMP_TARGET_CHECK (NODE), 0)
#define OMP_TARGET_CLAUSES(NODE) TREE_OPERAND (OMP_TARGET_CHECK (NODE), 1)
-#define OMP_TARGET_UPDATE_CLAUSES(NODE)\
- TREE_OPERAND (OMP_TARGET_UPDATE_CHECK (NODE), 0)
+#define OMP_STANDALONE_CLAUSES(NODE) \
+ TREE_OPERAND (TREE_RANGE_CHECK (NODE, OACC_CACHE, OMP_TARGET_UPDATE), 0)
#define OMP_CLAUSE_SIZE(NODE) \
OMP_CLAUSE_OPERAND (OMP_CLAUSE_RANGE_CHECK (OMP_CLAUSE_CHECK (NODE), \