aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans.h
diff options
context:
space:
mode:
authorKwok Cheung Yeung <kcy@codesourcery.com>2019-10-02 10:31:02 +0000
committerTobias Burnus <burnus@gcc.gnu.org>2019-10-02 12:31:02 +0200
commit73a28634098cb1aba4a1773e62b6387af120dd9e (patch)
tree04b74614812eb5badf5bd35f2fc3ad29ff83bd08 /gcc/fortran/trans.h
parent68710ac7da29c2ed111755351936d1956f64de7c (diff)
downloadgcc-73a28634098cb1aba4a1773e62b6387af120dd9e.zip
gcc-73a28634098cb1aba4a1773e62b6387af120dd9e.tar.gz
gcc-73a28634098cb1aba4a1773e62b6387af120dd9e.tar.bz2
f95-lang.c (LANG_HOOKS_OMP_IS_OPTIONAL_ARGUMENT): Define to gfc_omp_is_optional_argument.
2019-10-02 Kwok Cheung Yeung <kcy@codesourcery.com> gcc/fortran/ * f95-lang.c (LANG_HOOKS_OMP_IS_OPTIONAL_ARGUMENT): Define to gfc_omp_is_optional_argument. * trans-decl.c (create_function_arglist): Set GFC_DECL_OPTIONAL_ARGUMENT in the generated decl if the parameter is optional. * trans-openmp.c (gfc_omp_is_optional_argument): New. (gfc_omp_privatize_by_reference): Return true if the decl is an optional pass-by-reference argument. * trans.h (gfc_omp_is_optional_argument): New declaration. (lang_decl): Add new optional_arg field. (GFC_DECL_OPTIONAL_ARGUMENT): New macro. gcc/ * langhooks-def.h (LANG_HOOKS_OMP_IS_OPTIONAL_ARGUMENT): Default to false. (LANG_HOOKS_DECLS): Add LANG_HOOKS_OMP_IS_OPTIONAL_ARGUMENT. * langhooks.h (omp_is_optional_argument): New hook. * omp-general.c (omp_is_optional_argument): New. * omp-general.h (omp_is_optional_argument): New declaration. * omp-low.c (lower_omp_target): Create temporary for received value and take the address for new_var if the original variable was a DECL_BY_REFERENCE. Use size of referenced object when a pass-by-reference optional argument used as argument to firstprivate. From-SVN: r276444
Diffstat (limited to 'gcc/fortran/trans.h')
-rw-r--r--gcc/fortran/trans.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index 6ebb71d..405e88d 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -786,6 +786,7 @@ struct array_descr_info;
bool gfc_get_array_descr_info (const_tree, struct array_descr_info *);
/* In trans-openmp.c */
+bool gfc_omp_is_optional_argument (const_tree);
bool gfc_omp_privatize_by_reference (const_tree);
enum omp_clause_default_kind gfc_omp_predetermined_sharing (tree);
tree gfc_omp_report_decl (tree);
@@ -999,6 +1000,7 @@ struct GTY(()) lang_decl {
tree token, caf_offset;
unsigned int scalar_allocatable : 1;
unsigned int scalar_pointer : 1;
+ unsigned int optional_arg : 1;
};
@@ -1013,6 +1015,8 @@ struct GTY(()) lang_decl {
(DECL_LANG_SPECIFIC (node)->scalar_allocatable)
#define GFC_DECL_SCALAR_POINTER(node) \
(DECL_LANG_SPECIFIC (node)->scalar_pointer)
+#define GFC_DECL_OPTIONAL_ARGUMENT(node) \
+ (DECL_LANG_SPECIFIC (node)->optional_arg)
#define GFC_DECL_GET_SCALAR_ALLOCATABLE(node) \
(DECL_LANG_SPECIFIC (node) ? GFC_DECL_SCALAR_ALLOCATABLE (node) : 0)
#define GFC_DECL_GET_SCALAR_POINTER(node) \