summaryrefslogtreecommitdiff
path: root/gcc/tree-nested.c
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2014-10-29 12:49:39 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2014-10-29 12:49:39 -0400
commit130349b3fd358ab22ab46507e970edc615477be4 (patch)
tree999e107ecab6f27664277f4902bcc56df9fd6bc4 /gcc/tree-nested.c
parent20f72c251d49e68a1e9f7e4fb7cd0f6de202ae61 (diff)
downloadgcc-130349b3fd358ab22ab46507e970edc615477be4.tar.gz
Convert remaining gimple_omp_single_ accessors to be typesafe
gcc/ChangeLog.gimple-classes: * gimple.h (gimple_omp_single_clauses): Strengthen param from const_gimple to const gomp_single *. (gimple_omp_single_clauses_ptr): Strengthen param from gimple to gomp_single *. * gimple-walk.c (walk_gimple_op): Add checked cast. * tree-inline.c (remap_gimple_stmt): Within case GIMPLE_OMP_SINGLE, introduce local "omp_single_stmt" via a checked cast and use in place of "stmt". * tree-nested.c (convert_nonlocal_reference_stmt): Likewise. (convert_local_reference_stmt): Likewise.
Diffstat (limited to 'gcc/tree-nested.c')
-rw-r--r--gcc/tree-nested.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index f0756c14660..2ee8cfdf74d 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -1379,11 +1379,17 @@ convert_nonlocal_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
break;
case GIMPLE_OMP_SINGLE:
- save_suppress = info->suppress_expansion;
- convert_nonlocal_omp_clauses (gimple_omp_single_clauses_ptr (stmt), wi);
- walk_body (convert_nonlocal_reference_stmt, convert_nonlocal_reference_op,
- info, gimple_omp_body_ptr (stmt));
- info->suppress_expansion = save_suppress;
+ {
+ gomp_single *omp_single_stmt = as_a <gomp_single *> (stmt);
+ save_suppress = info->suppress_expansion;
+ convert_nonlocal_omp_clauses (gimple_omp_single_clauses_ptr (
+ omp_single_stmt),
+ wi);
+ walk_body (convert_nonlocal_reference_stmt,
+ convert_nonlocal_reference_op,
+ info, gimple_omp_body_ptr (omp_single_stmt));
+ info->suppress_expansion = save_suppress;
+ }
break;
case GIMPLE_OMP_TARGET:
@@ -1963,11 +1969,16 @@ convert_local_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
break;
case GIMPLE_OMP_SINGLE:
- save_suppress = info->suppress_expansion;
- convert_local_omp_clauses (gimple_omp_single_clauses_ptr (stmt), wi);
- walk_body (convert_local_reference_stmt, convert_local_reference_op,
- info, gimple_omp_body_ptr (stmt));
- info->suppress_expansion = save_suppress;
+ {
+ gomp_single *omp_single_stmt = as_a <gomp_single *> (stmt);
+ save_suppress = info->suppress_expansion;
+ convert_local_omp_clauses (gimple_omp_single_clauses_ptr (
+ omp_single_stmt),
+ wi);
+ walk_body (convert_local_reference_stmt, convert_local_reference_op,
+ info, gimple_omp_body_ptr (omp_single_stmt));
+ info->suppress_expansion = save_suppress;
+ }
break;
case GIMPLE_OMP_TARGET: