@@ -175,6 +175,10 @@ struct gimple_statement_omp_task;
typedef struct gimple_statement_omp_task *gimple_omp_task;
typedef const struct gimple_statement_omp_task *const_gimple_omp_task;
+struct gimple_statement_omp_single;
+typedef struct gimple_statement_omp_single *gimple_omp_single;
+typedef const struct gimple_statement_omp_single *const_gimple_omp_single;
+
union section;
typedef union section section;
struct gcc_options;
@@ -1252,7 +1252,8 @@ dump_gimple_omp_continue (pretty_printer *buffer, gimple_omp_continue gs,
/* Dump a GIMPLE_OMP_SINGLE tuple on the pretty_printer BUFFER. */
static void
-dump_gimple_omp_single (pretty_printer *buffer, gimple gs, int spc, int flags)
+dump_gimple_omp_single (pretty_printer *buffer, gimple_omp_single gs,
+ int spc, int flags)
{
if (flags & TDF_RAW)
{
@@ -2172,7 +2173,8 @@ pp_gimple_stmt_1 (pretty_printer *buffer, gimple gs, int spc, int flags)
break;
case GIMPLE_OMP_SINGLE:
- dump_gimple_omp_single (buffer, gs, spc, flags);
+ dump_gimple_omp_single (buffer, gs->as_a_gimple_omp_single (), spc,
+ flags);
break;
case GIMPLE_OMP_TARGET:
@@ -1033,10 +1033,11 @@ gimple_build_omp_sections_switch (void)
CLAUSES are any of the OMP single construct's clauses: private, firstprivate,
copyprivate, nowait. */
-gimple
+gimple_omp_single
gimple_build_omp_single (gimple_seq body, tree clauses)
{
- gimple p = gimple_alloc (GIMPLE_OMP_SINGLE, 0);
+ gimple_omp_single p =
+ gimple_alloc (GIMPLE_OMP_SINGLE, 0)->as_a_gimple_omp_single ();
if (body)
gimple_omp_set_body (p, body);
gimple_omp_single_set_clauses (p, clauses);
@@ -378,6 +378,12 @@ public:
return as_a <gimple_statement_omp_task> (this);
}
+ inline gimple_omp_single
+ as_a_gimple_omp_single ()
+ {
+ return as_a <gimple_statement_omp_single> (this);
+ }
+
/* Dynamic casting methods, where the cast returns NULL if the
stmt is not of the required kind.
@@ -1636,7 +1642,7 @@ gimple gimple_build_omp_ordered (gimple_seq);
gimple gimple_build_omp_return (bool);
gimple gimple_build_omp_sections (gimple_seq, tree);
gimple gimple_build_omp_sections_switch (void);
-gimple gimple_build_omp_single (gimple_seq, tree);
+gimple_omp_single gimple_build_omp_single (gimple_seq, tree);
gimple gimple_build_omp_target (gimple_seq, int, tree);
gimple gimple_build_omp_teams (gimple_seq, tree);
gimple_omp_atomic_load gimple_build_omp_atomic_load (tree, tree);
@@ -5330,13 +5336,11 @@ gimple_omp_single_clauses_ptr (gimple gs)
}
-/* Set CLAUSES to be the clauses associated with OMP_SINGLE GS. */
+/* Set CLAUSES to be the clauses associated with OMP_SINGLE_STMT. */
static inline void
-gimple_omp_single_set_clauses (gimple gs, tree clauses)
+gimple_omp_single_set_clauses (gimple_omp_single omp_single_stmt, tree clauses)
{
- gimple_statement_omp_single *omp_single_stmt =
- as_a <gimple_statement_omp_single> (gs);
omp_single_stmt->clauses = clauses;
}
@@ -2155,7 +2155,7 @@ scan_omp_sections (gimple stmt, omp_context *outer_ctx)
/* Scan an OpenMP single directive. */
static void
-scan_omp_single (gimple stmt, omp_context *outer_ctx)
+scan_omp_single (gimple_omp_single stmt, omp_context *outer_ctx)
{
omp_context *ctx;
tree name;
@@ -2651,7 +2651,7 @@ scan_omp_1_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
break;
case GIMPLE_OMP_SINGLE:
- scan_omp_single (stmt, ctx);
+ scan_omp_single (stmt->as_a_gimple_omp_single (), ctx);
break;
case GIMPLE_OMP_SECTION:
@@ -8522,7 +8522,7 @@ lower_omp_sections (gimple_stmt_iterator *gsi_p, omp_context *ctx)
to a synchronization analysis pass. */
static void
-lower_omp_single_simple (gimple single_stmt, gimple_seq *pre_p)
+lower_omp_single_simple (gimple_omp_single single_stmt, gimple_seq *pre_p)
{
location_t loc = gimple_location (single_stmt);
tree tlabel = create_artificial_label (loc);
@@ -8577,7 +8577,8 @@ lower_omp_single_simple (gimple single_stmt, gimple_seq *pre_p)
to a synchronization analysis pass. */
static void
-lower_omp_single_copy (gimple single_stmt, gimple_seq *pre_p, omp_context *ctx)
+lower_omp_single_copy (gimple_omp_single single_stmt, gimple_seq *pre_p,
+ omp_context *ctx)
{
tree ptr_type, t, l0, l1, l2, bfn_decl;
gimple_seq copyin_seq;
@@ -8633,7 +8634,8 @@ static void
lower_omp_single (gimple_stmt_iterator *gsi_p, omp_context *ctx)
{
tree block;
- gimple t, single_stmt = gsi_stmt (*gsi_p);
+ gimple t;
+ gimple_omp_single single_stmt = gsi_stmt (*gsi_p)->as_a_gimple_omp_single ();
gimple_bind bind;
gimple_seq bind_body, bind_body_tail = NULL, dlist;