diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2019-05-29 18:59:46 +0200 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2021-08-31 19:28:31 +0200 |
commit | 22e6b3270068faab64778c016f4b04f787120661 (patch) | |
tree | 758d284f09fa185333d7594adcaefba5e1886119 /gcc/gimplify.c | |
parent | b3aa3288a958a75744df256d70e7f8e90ccab724 (diff) | |
download | gcc-22e6b3270068faab64778c016f4b04f787120661.zip gcc-22e6b3270068faab64778c016f4b04f787120661.tar.gz gcc-22e6b3270068faab64778c016f4b04f787120661.tar.bz2 |
[OMP] Standardize on 'omp_privatize_by_reference'
... instead of 'omp_is_reference' vs.
'lang_hooks.decls.omp_privatize_by_reference'.
gcc/
* omp-general.h (omp_is_reference): Rename to...
(omp_privatize_by_reference): ... this. Adjust all users...
* omp-general.c: ... here, ...
* gimplify.c: ... here, ...
* omp-expand.c: ... here, ...
* omp-low.c: ... here.
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 400b6f0..99d1c7fc 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -1831,7 +1831,8 @@ gimplify_decl_expr (tree *stmt_p, gimple_seq *seq_p) gimplify_and_add (init, seq_p); ggc_free (init); /* Clear TREE_READONLY if we really have an initialization. */ - if (!DECL_INITIAL (decl) && !omp_is_reference (decl)) + if (!DECL_INITIAL (decl) + && !omp_privatize_by_reference (decl)) TREE_READONLY (decl) = 0; } else @@ -7064,7 +7065,7 @@ omp_add_variable (struct gimplify_omp_ctx *ctx, tree decl, unsigned int flags) omp_notice_variable (ctx, TYPE_SIZE_UNIT (TREE_TYPE (decl)), true); } else if ((flags & (GOVD_MAP | GOVD_LOCAL)) == 0 - && lang_hooks.decls.omp_privatize_by_reference (decl)) + && omp_privatize_by_reference (decl)) { omp_firstprivatize_type_sizes (ctx, TREE_TYPE (decl)); @@ -7322,7 +7323,7 @@ oacc_default_clause (struct gimplify_omp_ctx *ctx, tree decl, unsigned flags) bool declared = is_oacc_declared (decl); tree type = TREE_TYPE (decl); - if (lang_hooks.decls.omp_privatize_by_reference (decl)) + if (omp_privatize_by_reference (decl)) type = TREE_TYPE (type); /* For Fortran COMMON blocks, only used variables in those blocks are @@ -7586,7 +7587,7 @@ omp_notice_variable (struct gimplify_omp_ctx *ctx, tree decl, bool in_code) tree type = TREE_TYPE (decl); if (gimplify_omp_ctxp->target_firstprivatize_array_bases - && lang_hooks.decls.omp_privatize_by_reference (decl)) + && omp_privatize_by_reference (decl)) type = TREE_TYPE (type); if (!lang_hooks.types.omp_mappable_type (type)) { @@ -7660,7 +7661,7 @@ omp_notice_variable (struct gimplify_omp_ctx *ctx, tree decl, bool in_code) n2 = splay_tree_lookup (ctx->variables, (splay_tree_key) t); n2->value |= GOVD_SEEN; } - else if (lang_hooks.decls.omp_privatize_by_reference (decl) + else if (omp_privatize_by_reference (decl) && TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (decl))) && (TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (decl)))) != INTEGER_CST)) @@ -7785,7 +7786,7 @@ omp_check_private (struct gimplify_omp_ctx *ctx, tree decl, bool copyprivate) if (copyprivate) return true; - if (lang_hooks.decls.omp_privatize_by_reference (decl)) + if (omp_privatize_by_reference (decl)) return false; /* Treat C++ privatized non-static data members outside @@ -10405,7 +10406,7 @@ omp_shared_to_firstprivate_optimizable_decl_p (tree decl) HOST_WIDE_INT len = int_size_in_bytes (type); if (len == -1 || len > 4 * POINTER_SIZE / BITS_PER_UNIT) return false; - if (lang_hooks.decls.omp_privatize_by_reference (decl)) + if (omp_privatize_by_reference (decl)) return false; return true; } @@ -10730,7 +10731,7 @@ gimplify_adjust_omp_clauses_1 (splay_tree_node n, void *data) OMP_CLAUSE_CHAIN (clause) = nc; } else if (gimplify_omp_ctxp->target_firstprivatize_array_bases - && lang_hooks.decls.omp_privatize_by_reference (decl)) + && omp_privatize_by_reference (decl)) { OMP_CLAUSE_DECL (clause) = build_simple_mem_ref (decl); OMP_CLAUSE_SIZE (clause) |