+2016-05-02 Cesar Philippidis <cesar@codesourcery.com>
+
+ * c-common.h (enum c_omp_region_type): Define.
+
2016-05-02 Richard Sandiford <richard.sandiford@arm.com>
* c-common.c (shorten_compare): Use wi::to_wide.
C_OMP_CLAUSE_SPLIT_TASKLOOP = C_OMP_CLAUSE_SPLIT_FOR
};
+enum c_omp_region_type
+{
+ C_ORT_OMP = 1 << 0,
+ C_ORT_CILK = 1 << 1,
+ C_ORT_ACC = 1 << 2,
+ C_ORT_DECLARE_SIMD = 1 << 3,
+ C_ORT_OMP_DECLARE_SIMD = C_ORT_OMP | C_ORT_DECLARE_SIMD,
+};
+
extern tree c_finish_omp_master (location_t, tree);
extern tree c_finish_omp_taskgroup (location_t, tree);
extern tree c_finish_omp_critical (location_t, tree, tree, tree);
+2016-05-02 Cesar Philippidis <cesar@codesourcery.com>
+
+ * c-parser.c (c_parser_oacc_all_clauses): Update call to
+ c_finish_omp_clauses.
+ (c_parser_omp_all_clauses): Likewise.
+ (c_parser_oacc_cache): Likewise.
+ (c_parser_oacc_loop): Likewise.
+ (omp_split_clauses): Likewise.
+ (c_parser_omp_declare_target): Likewise.
+ (c_parser_cilk_all_clauses): Likewise.
+ (c_parser_cilk_for): Likewise.
+ * c-typeck.c (c_finish_omp_clauses): Replace bool arguments
+ is_omp, declare_simd, and is_cilk with enum c_omp_region_type ort.
+
2016-05-02 Marek Polacek <polacek@redhat.com>
PR c/70851
c_parser_skip_to_pragma_eol (parser);
if (finish_p)
- return c_finish_omp_clauses (clauses, false);
+ return c_finish_omp_clauses (clauses, C_ORT_ACC);
return clauses;
}
if (finish_p)
{
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_UNIFORM)) != 0)
- return c_finish_omp_clauses (clauses, true, true);
- return c_finish_omp_clauses (clauses, true);
+ return c_finish_omp_clauses (clauses, C_ORT_OMP_DECLARE_SIMD);
+ return c_finish_omp_clauses (clauses, C_ORT_OMP);
}
return clauses;
tree stmt, clauses;
clauses = c_parser_omp_var_list_parens (parser, OMP_CLAUSE__CACHE_, NULL);
- clauses = c_finish_omp_clauses (clauses, false);
+ clauses = c_finish_omp_clauses (clauses, C_ORT_ACC);
c_parser_skip_to_pragma_eol (parser);
{
clauses = c_oacc_split_loop_clauses (clauses, cclauses, is_parallel);
if (*cclauses)
- *cclauses = c_finish_omp_clauses (*cclauses, false);
+ *cclauses = c_finish_omp_clauses (*cclauses, C_ORT_ACC);
if (clauses)
- clauses = c_finish_omp_clauses (clauses, false);
+ clauses = c_finish_omp_clauses (clauses, C_ORT_ACC);
}
tree block = c_begin_compound_stmt (true);
c_omp_split_clauses (loc, code, mask, clauses, cclauses);
for (i = 0; i < C_OMP_CLAUSE_SPLIT_COUNT; i++)
if (cclauses[i])
- cclauses[i] = c_finish_omp_clauses (cclauses[i], true);
+ cclauses[i] = c_finish_omp_clauses (cclauses[i], C_ORT_OMP);
}
/* OpenMP 4.0:
{
clauses = c_parser_omp_var_list_parens (parser, OMP_CLAUSE_TO_DECLARE,
clauses);
- clauses = c_finish_omp_clauses (clauses, true);
+ clauses = c_finish_omp_clauses (clauses, C_ORT_OMP);
c_parser_skip_to_pragma_eol (parser);
}
else
saw_error:
c_parser_skip_to_pragma_eol (parser);
- return c_finish_omp_clauses (clauses, false, false, true);
+ return c_finish_omp_clauses (clauses, C_ORT_CILK);
}
/* This function helps parse the grainsize pragma for a _Cilk_for statement.
tree clauses = build_omp_clause (EXPR_LOCATION (grain), OMP_CLAUSE_SCHEDULE);
OMP_CLAUSE_SCHEDULE_KIND (clauses) = OMP_CLAUSE_SCHEDULE_CILKFOR;
OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clauses) = grain;
- clauses = c_finish_omp_clauses (clauses, false);
+ clauses = c_finish_omp_clauses (clauses, C_ORT_CILK);
tree block = c_begin_compound_stmt (true);
tree sb = push_stmt_list ();
OMP_CLAUSE_OPERAND (c, 0)
= cilk_for_number_of_iterations (omp_for);
OMP_CLAUSE_CHAIN (c) = clauses;
- OMP_PARALLEL_CLAUSES (omp_par) = c_finish_omp_clauses (c, true);
+ OMP_PARALLEL_CLAUSES (omp_par) = c_finish_omp_clauses (c, C_ORT_CILK);
add_stmt (omp_par);
}
extern tree c_finish_omp_task (location_t, tree, tree);
extern void c_finish_omp_cancel (location_t, tree);
extern void c_finish_omp_cancellation_point (location_t, tree);
-extern tree c_finish_omp_clauses (tree, bool, bool = false, bool = false);
+extern tree c_finish_omp_clauses (tree, enum c_omp_region_type);
extern tree c_build_va_arg (location_t, tree, location_t, tree);
extern tree c_finish_transaction (location_t, tree, int);
extern bool c_tree_equal (tree, tree);
Remove any elements from the list that are invalid. */
tree
-c_finish_omp_clauses (tree clauses, bool is_omp, bool declare_simd,
- bool is_cilk)
+c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
{
bitmap_head generic_head, firstprivate_head, lastprivate_head;
bitmap_head aligned_head, map_head, map_field_head;
t = OMP_CLAUSE_DECL (c);
if (TREE_CODE (t) == TREE_LIST)
{
- if (handle_omp_array_sections (c, is_omp))
+ if (handle_omp_array_sections (c, ort & C_ORT_OMP))
{
remove = true;
break;
goto check_dup_generic;
case OMP_CLAUSE_LINEAR:
- if (!declare_simd)
+ if (ort != C_ORT_OMP_DECLARE_SIMD)
need_implicitly_determined = true;
t = OMP_CLAUSE_DECL (c);
- if (!declare_simd
+ if (ort != C_ORT_OMP_DECLARE_SIMD
&& OMP_CLAUSE_LINEAR_KIND (c) != OMP_CLAUSE_LINEAR_DEFAULT)
{
error_at (OMP_CLAUSE_LOCATION (c),
"clause on %<simd%> or %<for%> constructs");
OMP_CLAUSE_LINEAR_KIND (c) = OMP_CLAUSE_LINEAR_DEFAULT;
}
- if (is_cilk)
+ if (ort & C_ORT_CILK)
{
if (!INTEGRAL_TYPE_P (TREE_TYPE (t))
&& !SCALAR_FLOAT_TYPE_P (TREE_TYPE (t))
break;
}
}
- if (declare_simd)
+ if (ort == C_ORT_OMP_DECLARE_SIMD)
{
tree s = OMP_CLAUSE_LINEAR_STEP (c);
if (TREE_CODE (s) == PARM_DECL)
}
if (TREE_CODE (t) == TREE_LIST)
{
- if (handle_omp_array_sections (c, is_omp))
+ if (handle_omp_array_sections (c, ort & C_ORT_OMP))
remove = true;
break;
}
t = OMP_CLAUSE_DECL (c);
if (TREE_CODE (t) == TREE_LIST)
{
- if (handle_omp_array_sections (c, is_omp))
+ if (handle_omp_array_sections (c, ort & C_ORT_OMP))
remove = true;
else
{
break;
}
if (TREE_CODE (t) == COMPONENT_REF
- && is_omp
+ && (ort & C_ORT_OMP)
&& OMP_CLAUSE_CODE (c) != OMP_CLAUSE__CACHE_)
{
if (DECL_BIT_FIELD (TREE_OPERAND (t, 1)))
+2016-05-02 Cesar Philippidis <cesar@codesourcery.com>
+
+ * cp-tree.h (finish_omp_clauses): Update prototype.
+ * parser.c (cp_parser_oacc_all_clauses): Update call to
+ finish_omp_clauses.
+ (cp_parser_omp_all_clauses): Likewise.
+ (cp_parser_omp_for_loop): Likewise.
+ (cp_omp_split_clauses): Likewise.
+ (cp_parser_oacc_cache): Likewise.
+ (cp_parser_oacc_loop): Likewise.
+ (cp_parser_omp_declare_target):
+ (cp_parser_cilk_simd_all_clauses): Likewise.
+ (cp_parser_cilk_for): Likewise.
+ * pt.c (tsubst_omp_clauses): Replace allow_fields and declare_simd
+ arguments with enum c_omp_region_type ort.
+ (tsubst_omp_clauses): Update calls to finish_omp_clauses.
+ (tsubst_omp_attribute): Update calls to tsubst_omp_clauses.
+ (tsubst_omp_for_iterator): Update calls to finish_omp_clauses.
+ (tsubst_expr): Update calls to tsubst_omp_clauses.
+ * semantics.c (finish_omp_clauses): Replace bool arguments
+ allow_fields, declare_simd, and is_cilk with bitmask ort.
+ (finish_omp_for): Update call to finish_omp_clauses.
+
2016-05-02 David Malcolm <dmalcolm@redhat.com>
PR c++/62314
extern tree cp_remove_omp_priv_cleanup_stmt (tree *, int *, void *);
extern void cp_check_omp_declare_reduction (tree);
extern void finish_omp_declare_simd_methods (tree);
-extern tree finish_omp_clauses (tree, bool, bool = false,
- bool = false);
+extern tree finish_omp_clauses (tree, enum c_omp_region_type);
extern tree push_omp_privatization_clauses (bool);
extern void pop_omp_privatization_clauses (tree);
extern void save_omp_privatization_clauses (vec<tree> &);
cp_parser_skip_to_pragma_eol (parser, pragma_tok);
if (finish_p)
- return finish_omp_clauses (clauses, false);
+ return finish_omp_clauses (clauses, C_ORT_ACC);
return clauses;
}
if (finish_p)
{
if ((mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_UNIFORM)) != 0)
- return finish_omp_clauses (clauses, false, true);
+ return finish_omp_clauses (clauses, C_ORT_OMP_DECLARE_SIMD);
else
- return finish_omp_clauses (clauses, true);
+ return finish_omp_clauses (clauses, C_ORT_OMP);
}
return clauses;
}
else
c = build_omp_clause (loc, OMP_CLAUSE_LASTPRIVATE);
OMP_CLAUSE_DECL (c) = add_private_clause;
- c = finish_omp_clauses (c, true);
+ c = finish_omp_clauses (c, C_ORT_OMP);
if (c)
{
OMP_CLAUSE_CHAIN (c) = clauses;
c_omp_split_clauses (loc, code, mask, clauses, cclauses);
for (i = 0; i < C_OMP_CLAUSE_SPLIT_COUNT; i++)
if (cclauses[i])
- cclauses[i] = finish_omp_clauses (cclauses[i], true);
+ cclauses[i] = finish_omp_clauses (cclauses[i], C_ORT_OMP);
}
/* OpenMP 4.0:
tree stmt, clauses;
clauses = cp_parser_omp_var_list (parser, OMP_CLAUSE__CACHE_, NULL_TREE);
- clauses = finish_omp_clauses (clauses, false);
+ clauses = finish_omp_clauses (clauses, C_ORT_ACC);
cp_parser_require_pragma_eol (parser, cp_lexer_peek_token (parser->lexer));
{
clauses = c_oacc_split_loop_clauses (clauses, cclauses, is_parallel);
if (*cclauses)
- *cclauses = finish_omp_clauses (*cclauses, false);
+ *cclauses = finish_omp_clauses (*cclauses, C_ORT_ACC);
if (clauses)
- clauses = finish_omp_clauses (clauses, false);
+ clauses = finish_omp_clauses (clauses, C_ORT_ACC);
}
tree block = begin_omp_structured_block ();
{
clauses = cp_parser_omp_var_list (parser, OMP_CLAUSE_TO_DECLARE,
clauses);
- clauses = finish_omp_clauses (clauses, true);
+ clauses = finish_omp_clauses (clauses, C_ORT_OMP);
cp_parser_require_pragma_eol (parser, pragma_tok);
}
else
if (clauses == error_mark_node)
return error_mark_node;
else
- return finish_omp_clauses (clauses, false, false, true);
+ return finish_omp_clauses (clauses, C_ORT_CILK);
}
/* Main entry-point for parsing Cilk Plus <#pragma simd> for loops. */
tree clauses = build_omp_clause (EXPR_LOCATION (grain), OMP_CLAUSE_SCHEDULE);
OMP_CLAUSE_SCHEDULE_KIND (clauses) = OMP_CLAUSE_SCHEDULE_CILKFOR;
OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (clauses) = grain;
- clauses = finish_omp_clauses (clauses, false);
+ clauses = finish_omp_clauses (clauses, C_ORT_CILK);
tree ret = cp_parser_omp_for_loop (parser, CILK_FOR, clauses, NULL, if_p);
if (ret)
return 1;
}
-static tree tsubst_omp_clauses (tree, bool, bool, tree, tsubst_flags_t, tree);
+static tree tsubst_omp_clauses (tree, enum c_omp_region_type, tree,
+ tsubst_flags_t, tree);
/* Instantiate a single dependent attribute T (a TREE_LIST), and return either
T or a new TREE_LIST, possibly a chain in the case of a pack expansion. */
get_attribute_name (t)))
{
tree clauses = TREE_VALUE (val);
- clauses = tsubst_omp_clauses (clauses, true, false, args,
+ clauses = tsubst_omp_clauses (clauses, C_ORT_OMP_DECLARE_SIMD, args,
complain, in_decl);
c_omp_declare_simd_clauses_to_decls (*decl_p, clauses);
- clauses = finish_omp_clauses (clauses, false, true);
+ clauses = finish_omp_clauses (clauses, C_ORT_OMP_DECLARE_SIMD);
tree parms = DECL_ARGUMENTS (*decl_p);
clauses
= c_omp_declare_simd_clauses_to_numbers (parms, clauses);
/* Like tsubst_copy, but specifically for OpenMP clauses. */
static tree
-tsubst_omp_clauses (tree clauses, bool declare_simd, bool allow_fields,
+tsubst_omp_clauses (tree clauses, enum c_omp_region_type ort,
tree args, tsubst_flags_t complain, tree in_decl)
{
tree new_clauses = NULL_TREE, nc, oc;
default:
gcc_unreachable ();
}
- if (allow_fields)
+ if ((ort & C_ORT_OMP_DECLARE_SIMD) == C_ORT_OMP)
switch (OMP_CLAUSE_CODE (nc))
{
case OMP_CLAUSE_SHARED:
}
new_clauses = nreverse (new_clauses);
- if (!declare_simd)
+ if (ort != C_ORT_OMP_DECLARE_SIMD)
{
- new_clauses = finish_omp_clauses (new_clauses, allow_fields);
+ new_clauses = finish_omp_clauses (new_clauses, ort);
if (linear_no_step)
for (nc = new_clauses; nc; nc = OMP_CLAUSE_CHAIN (nc))
if (nc == linear_no_step)
{
tree c = build_omp_clause (input_location, OMP_CLAUSE_PRIVATE);
OMP_CLAUSE_DECL (c) = decl;
- c = finish_omp_clauses (c, true);
+ c = finish_omp_clauses (c, C_ORT_OMP);
if (c)
{
OMP_CLAUSE_CHAIN (c) = *clauses;
case OACC_KERNELS:
case OACC_PARALLEL:
- tmp = tsubst_omp_clauses (OMP_CLAUSES (t), false, false, args, complain,
+ tmp = tsubst_omp_clauses (OMP_CLAUSES (t), C_ORT_ACC, args, complain,
in_decl);
stmt = begin_omp_parallel ();
RECUR (OMP_BODY (t));
case OMP_PARALLEL:
r = push_omp_privatization_clauses (OMP_PARALLEL_COMBINED (t));
- tmp = tsubst_omp_clauses (OMP_PARALLEL_CLAUSES (t), false, true,
- args, complain, in_decl);
+ tmp = tsubst_omp_clauses (OMP_PARALLEL_CLAUSES (t), C_ORT_OMP, args,
+ complain, in_decl);
if (OMP_PARALLEL_COMBINED (t))
omp_parallel_combined_clauses = &tmp;
stmt = begin_omp_parallel ();
case OMP_TASK:
r = push_omp_privatization_clauses (false);
- tmp = tsubst_omp_clauses (OMP_TASK_CLAUSES (t), false, true,
- args, complain, in_decl);
+ tmp = tsubst_omp_clauses (OMP_TASK_CLAUSES (t), C_ORT_OMP, args,
+ complain, in_decl);
stmt = begin_omp_task ();
RECUR (OMP_TASK_BODY (t));
finish_omp_task (tmp, stmt);
tree declv = NULL_TREE, initv = NULL_TREE, condv = NULL_TREE;
tree orig_declv = NULL_TREE;
tree incrv = NULL_TREE;
+ enum c_omp_region_type ort = C_ORT_OMP;
int i;
+ if (TREE_CODE (t) == CILK_SIMD || TREE_CODE (t) == CILK_FOR)
+ ort = C_ORT_CILK;
+ else if (TREE_CODE (t) == OACC_LOOP)
+ ort = C_ORT_ACC;
+
r = push_omp_privatization_clauses (OMP_FOR_INIT (t) == NULL_TREE);
- clauses = tsubst_omp_clauses (OMP_FOR_CLAUSES (t), false,
- TREE_CODE (t) != OACC_LOOP,
- args, complain, in_decl);
+ clauses = tsubst_omp_clauses (OMP_FOR_CLAUSES (t), ort, args, complain,
+ in_decl);
if (OMP_FOR_INIT (t) != NULL_TREE)
{
declv = make_tree_vec (TREE_VEC_LENGTH (OMP_FOR_INIT (t)));
case OMP_CRITICAL:
r = push_omp_privatization_clauses (TREE_CODE (t) == OMP_TEAMS
&& OMP_TEAMS_COMBINED (t));
- tmp = tsubst_omp_clauses (OMP_CLAUSES (t), false, true,
- args, complain, in_decl);
+ tmp = tsubst_omp_clauses (OMP_CLAUSES (t), C_ORT_OMP, args, complain,
+ in_decl);
stmt = push_stmt_list ();
RECUR (OMP_BODY (t));
stmt = pop_stmt_list (stmt);
case OACC_DATA:
case OMP_TARGET_DATA:
case OMP_TARGET:
- tmp = tsubst_omp_clauses (OMP_CLAUSES (t), false,
- TREE_CODE (t) != OACC_DATA,
- args, complain, in_decl);
+ tmp = tsubst_omp_clauses (OMP_CLAUSES (t), (TREE_CODE (t) == OACC_DATA)
+ ? C_ORT_ACC : C_ORT_OMP, args, complain,
+ in_decl);
keep_next_level (true);
stmt = begin_omp_structured_block ();
case OACC_DECLARE:
t = copy_node (t);
- tmp = tsubst_omp_clauses (OACC_DECLARE_CLAUSES (t), false, false,
- args, complain, in_decl);
+ tmp = tsubst_omp_clauses (OACC_DECLARE_CLAUSES (t), C_ORT_ACC, args,
+ complain, in_decl);
OACC_DECLARE_CLAUSES (t) = tmp;
add_stmt (t);
break;
case OMP_TARGET_UPDATE:
case OMP_TARGET_ENTER_DATA:
case OMP_TARGET_EXIT_DATA:
- tmp = tsubst_omp_clauses (OMP_STANDALONE_CLAUSES (t), false, true,
- args, complain, in_decl);
+ tmp = tsubst_omp_clauses (OMP_STANDALONE_CLAUSES (t), C_ORT_OMP, args,
+ complain, in_decl);
t = copy_node (t);
OMP_STANDALONE_CLAUSES (t) = tmp;
add_stmt (t);
case OACC_ENTER_DATA:
case OACC_EXIT_DATA:
case OACC_UPDATE:
- tmp = tsubst_omp_clauses (OMP_STANDALONE_CLAUSES (t), false, false,
- args, complain, in_decl);
+ tmp = tsubst_omp_clauses (OMP_STANDALONE_CLAUSES (t), C_ORT_ACC, args,
+ complain, in_decl);
t = copy_node (t);
OMP_STANDALONE_CLAUSES (t) = tmp;
add_stmt (t);
break;
case OMP_ORDERED:
- tmp = tsubst_omp_clauses (OMP_ORDERED_CLAUSES (t), false, true,
- args, complain, in_decl);
+ tmp = tsubst_omp_clauses (OMP_ORDERED_CLAUSES (t), C_ORT_OMP, args,
+ complain, in_decl);
stmt = push_stmt_list ();
RECUR (OMP_BODY (t));
stmt = pop_stmt_list (stmt);
Remove any elements from the list that are invalid. */
tree
-finish_omp_clauses (tree clauses, bool allow_fields, bool declare_simd,
- bool is_cilk)
+finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
{
bitmap_head generic_head, firstprivate_head, lastprivate_head;
bitmap_head aligned_head, map_head, map_field_head;
switch (OMP_CLAUSE_CODE (c))
{
case OMP_CLAUSE_SHARED:
- field_ok = allow_fields;
+ field_ok = ((ort & C_ORT_OMP_DECLARE_SIMD) == C_ORT_OMP);
goto check_dup_generic;
case OMP_CLAUSE_PRIVATE:
- field_ok = allow_fields;
+ field_ok = ((ort & C_ORT_OMP_DECLARE_SIMD) == C_ORT_OMP);
goto check_dup_generic;
case OMP_CLAUSE_REDUCTION:
- field_ok = allow_fields;
+ field_ok = ((ort & C_ORT_OMP_DECLARE_SIMD) == C_ORT_OMP);
t = OMP_CLAUSE_DECL (c);
if (TREE_CODE (t) == TREE_LIST)
{
- if (handle_omp_array_sections (c, allow_fields))
+ if (handle_omp_array_sections (c, ((ort & C_ORT_OMP_DECLARE_SIMD)
+ == C_ORT_OMP)))
{
remove = true;
break;
goto check_dup_generic;
case OMP_CLAUSE_COPYPRIVATE:
copyprivate_seen = true;
- field_ok = allow_fields;
+ field_ok = ((ort & C_ORT_OMP_DECLARE_SIMD) == C_ORT_OMP);
goto check_dup_generic;
case OMP_CLAUSE_COPYIN:
goto check_dup_generic;
case OMP_CLAUSE_LINEAR:
- field_ok = allow_fields;
+ field_ok = ((ort & C_ORT_OMP_DECLARE_SIMD) == C_ORT_OMP);
t = OMP_CLAUSE_DECL (c);
- if (!declare_simd
+ if (ort != C_ORT_OMP_DECLARE_SIMD
&& OMP_CLAUSE_LINEAR_KIND (c) != OMP_CLAUSE_LINEAR_DEFAULT)
{
error_at (OMP_CLAUSE_LOCATION (c),
}
if (TREE_CODE (type) == REFERENCE_TYPE)
type = TREE_TYPE (type);
- if (is_cilk)
+ if (ort == C_ORT_CILK)
{
if (!INTEGRAL_TYPE_P (type)
&& !SCALAR_FLOAT_TYPE_P (type)
}
else if (!type_dependent_expression_p (t)
&& !INTEGRAL_TYPE_P (TREE_TYPE (t))
- && (!declare_simd
+ && (ort != C_ORT_OMP_DECLARE_SIMD
|| TREE_CODE (t) != PARM_DECL
|| TREE_CODE (TREE_TYPE (t)) != REFERENCE_TYPE
|| !INTEGRAL_TYPE_P (TREE_TYPE (TREE_TYPE (t)))))
else
{
t = mark_rvalue_use (t);
- if (declare_simd && TREE_CODE (t) == PARM_DECL)
+ if (ort == C_ORT_OMP_DECLARE_SIMD && TREE_CODE (t) == PARM_DECL)
{
OMP_CLAUSE_LINEAR_VARIABLE_STRIDE (c) = 1;
goto check_dup_generic;
&& (VAR_P (OMP_CLAUSE_DECL (c))
|| TREE_CODE (OMP_CLAUSE_DECL (c)) == PARM_DECL))
{
- if (declare_simd)
+ if (ort == C_ORT_OMP_DECLARE_SIMD)
{
t = maybe_constant_value (t);
if (TREE_CODE (t) != INTEGER_CST)
else if (TREE_CODE (type) == POINTER_TYPE
/* Can't multiply the step yet if *this
is still incomplete type. */
- && (!declare_simd
+ && (ort != C_ORT_OMP_DECLARE_SIMD
|| TREE_CODE (OMP_CLAUSE_DECL (c)) != PARM_DECL
|| !DECL_ARTIFICIAL (OMP_CLAUSE_DECL (c))
|| DECL_NAME (OMP_CLAUSE_DECL (c))
t = OMP_CLAUSE_DECL (c);
check_dup_generic_t:
if (t == current_class_ptr
- && (!declare_simd
+ && (ort != C_ORT_OMP_DECLARE_SIMD
|| (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_LINEAR
&& OMP_CLAUSE_CODE (c) != OMP_CLAUSE_UNIFORM)))
{
break;
}
if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL
- && (!allow_fields || TREE_CODE (t) != FIELD_DECL))
+ && ((ort & C_ORT_OMP_DECLARE_SIMD) != C_ORT_OMP
+ || TREE_CODE (t) != FIELD_DECL))
{
if (processing_template_decl)
break;
break;
}
if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL
- && (!allow_fields || TREE_CODE (t) != FIELD_DECL))
+ && ((ort & C_ORT_OMP_DECLARE_SIMD) != C_ORT_OMP
+ || TREE_CODE (t) != FIELD_DECL))
{
if (processing_template_decl)
break;
case OMP_CLAUSE_ALIGNED:
t = OMP_CLAUSE_DECL (c);
- if (t == current_class_ptr && !declare_simd)
+ if (t == current_class_ptr && ort != C_ORT_OMP_DECLARE_SIMD)
{
error ("%<this%> allowed in OpenMP only in %<declare simd%>"
" clauses");
}
if (TREE_CODE (t) == TREE_LIST)
{
- if (handle_omp_array_sections (c, allow_fields))
+ if (handle_omp_array_sections (c, ((ort & C_ORT_OMP_DECLARE_SIMD)
+ == C_ORT_OMP)))
remove = true;
break;
}
t = OMP_CLAUSE_DECL (c);
if (TREE_CODE (t) == TREE_LIST)
{
- if (handle_omp_array_sections (c, allow_fields))
+ if (handle_omp_array_sections (c, ((ort & C_ORT_OMP_DECLARE_SIMD)
+ == C_ORT_OMP)))
remove = true;
else
{
OMP_CLAUSE_DECL (c) = t;
}
if (TREE_CODE (t) == COMPONENT_REF
- && allow_fields
+ && (ort & C_ORT_OMP_DECLARE_SIMD) == C_ORT_OMP
&& OMP_CLAUSE_CODE (c) != OMP_CLAUSE__CACHE_)
{
if (type_dependent_expression_p (t))
handle_map_references:
if (!remove
&& !processing_template_decl
- && allow_fields
+ && (ort & C_ORT_OMP_DECLARE_SIMD) == C_ORT_OMP
&& TREE_CODE (TREE_TYPE (OMP_CLAUSE_DECL (c))) == REFERENCE_TYPE)
{
t = OMP_CLAUSE_DECL (c);
case OMP_CLAUSE_IS_DEVICE_PTR:
case OMP_CLAUSE_USE_DEVICE_PTR:
- field_ok = allow_fields;
+ field_ok = (ort & C_ORT_OMP_DECLARE_SIMD) == C_ORT_OMP;
t = OMP_CLAUSE_DECL (c);
if (!type_dependent_expression_p (t))
{
need_implicitly_determined = true;
break;
case OMP_CLAUSE_LINEAR:
- if (!declare_simd)
+ if (ort != C_ORT_OMP_DECLARE_SIMD)
need_implicitly_determined = true;
else if (OMP_CLAUSE_LINEAR_VARIABLE_STRIDE (c)
&& !bitmap_bit_p (&map_head,
OMP_CLAUSE_OPERAND (c, 0)
= cilk_for_number_of_iterations (omp_for);
OMP_CLAUSE_CHAIN (c) = clauses;
- OMP_PARALLEL_CLAUSES (omp_par) = finish_omp_clauses (c, false);
+ OMP_PARALLEL_CLAUSES (omp_par) = finish_omp_clauses (c, C_ORT_CILK);
add_stmt (omp_par);
return omp_par;
}