aboutsummaryrefslogtreecommitdiff
path: root/gcc/omp-low.c
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2015-09-23 16:46:55 +0200
committerThomas Schwinge <tschwinge@gcc.gnu.org>2015-09-23 16:46:55 +0200
commitf2c9f71da9fd748bb452e69e7825e5f28e7c741d (patch)
treeee3493395b810e3e0800b948507eda00f9269e2e /gcc/omp-low.c
parentef537cc859dd149230454398078da6d3128cfd9a (diff)
downloadgcc-f2c9f71da9fd748bb452e69e7825e5f28e7c741d.zip
gcc-f2c9f71da9fd748bb452e69e7825e5f28e7c741d.tar.gz
gcc-f2c9f71da9fd748bb452e69e7825e5f28e7c741d.tar.bz2
Refactor omp_reduction_init: omp_reduction_init_op
gcc/ * omp-low.h (omp_reduction_init_op): Declare. * omp-low.c (omp_reduction_init_op): New, broken out of ... (omp_reduction_init): ... here. Call it. * tree-parloops.c (initialize_reductions): Use omp_reduction_init_op. Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com> From-SVN: r228052
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r--gcc/omp-low.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 7c92c94..cb00758 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -3372,13 +3372,12 @@ maybe_lookup_decl_in_outer_ctx (tree decl, omp_context *ctx)
}
-/* Construct the initialization value for reduction CLAUSE. */
+/* Construct the initialization value for reduction operation OP. */
tree
-omp_reduction_init (tree clause, tree type)
+omp_reduction_init_op (location_t loc, enum tree_code op, tree type)
{
- location_t loc = OMP_CLAUSE_LOCATION (clause);
- switch (OMP_CLAUSE_REDUCTION_CODE (clause))
+ switch (op)
{
case PLUS_EXPR:
case MINUS_EXPR:
@@ -3451,6 +3450,15 @@ omp_reduction_init (tree clause, tree type)
}
}
+/* Construct the initialization value for reduction CLAUSE. */
+
+tree
+omp_reduction_init (tree clause, tree type)
+{
+ return omp_reduction_init_op (OMP_CLAUSE_LOCATION (clause),
+ OMP_CLAUSE_REDUCTION_CODE (clause), type);
+}
+
/* Return alignment to be assumed for var in CLAUSE, which should be
OMP_CLAUSE_ALIGNED. */