aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans.h
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2011-03-27 10:30:28 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2011-03-27 10:30:28 +0200
commit60386f50ceca766476f4e22f1c78c56865d9bc9d (patch)
tree0005cd512602d2a7bb1e87ea8d3a877ae7220371 /gcc/fortran/trans.h
parent46ae608f26f24496e54e7da889eb76cc3136e198 (diff)
downloadgcc-60386f50ceca766476f4e22f1c78c56865d9bc9d.zip
gcc-60386f50ceca766476f4e22f1c78c56865d9bc9d.tar.gz
gcc-60386f50ceca766476f4e22f1c78c56865d9bc9d.tar.bz2
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-03-27 Tobias Burnus <burnus@net-b.de> PR fortran/18918 * gfortran.h (gfc_isym_id): Rename GFC_ISYM_NUMIMAGES to GFC_ISYM_NUM_IMAGES. (gfc_fcoarray): Add GFC_FCOARRAY_LIB. * intrinsic.c (add_functions): Update due to GFC_ISYM_NUM_IMAGES rename. * invoke.texi (-fcoarray=): Document "lib" argument. * iresolve.c (gfc_resolve_this_image): Fix THIS IMAGE(). * libgfortran.h (libgfortran_stat_codes): Add comments. * options.c (gfc_handle_coarray_option): Add -fcoarray=lib. * simplify.c (gfc_simplify_num_images, gfc_simplify_this_image): Handle GFC_FCOARRAY_LIB. * trans.h (gfc_init_coarray_decl): New prototype. (gfor_fndecl_caf_init, gfor_fndecl_caf_finalize, gfor_fndecl_caf_critical, gfor_fndecl_caf_end_critical, gfor_fndecl_caf_sync_all, gfor_fndecl_caf_sync_images, gfor_fndecl_caf_error_stop, gfor_fndecl_caf_error_stop_str, gfort_gvar_caf_num_images, gfort_gvar_caf_this_image): New global variables. * trans-decl.c: Declare several CAF functions (cf. above). (gfc_build_builtin_function_decls): Initialize those. (gfc_init_coarray_decl): New function. (create_main_function): Call CAF init/finalize functions. * trans-intrinsic.c (trans_this_image, trans_num_images): New. (gfc_conv_intrinsic_function): Call those. * trans-stmt.c (gfc_trans_stop, gfc_trans_sync, * gfc_trans_critical): Add code for GFC_FCOARRAY_LIB. From-SVN: r171568
Diffstat (limited to 'gcc/fortran/trans.h')
-rw-r--r--gcc/fortran/trans.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index 1536f2e..19e86bb 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -1,5 +1,5 @@
/* Header for code translation functions
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Paul Brook
@@ -452,6 +452,9 @@ bool gfc_get_module_backend_decl (gfc_symbol *);
/* Return the variable decl for a symbol. */
tree gfc_get_symbol_decl (gfc_symbol *);
+/* Initialize coarray global variables. */
+void gfc_init_coarray_decl (void);
+
/* Build a static initializer. */
tree gfc_conv_initializer (gfc_expr *, gfc_typespec *, tree, bool, bool, bool);
@@ -613,6 +616,22 @@ extern GTY(()) tree gfor_fndecl_in_pack;
extern GTY(()) tree gfor_fndecl_in_unpack;
extern GTY(()) tree gfor_fndecl_associated;
+
+/* Coarray run-time library function decls. */
+extern GTY(()) tree gfor_fndecl_caf_init;
+extern GTY(()) tree gfor_fndecl_caf_finalize;
+extern GTY(()) tree gfor_fndecl_caf_critical;
+extern GTY(()) tree gfor_fndecl_caf_end_critical;
+extern GTY(()) tree gfor_fndecl_caf_sync_all;
+extern GTY(()) tree gfor_fndecl_caf_sync_images;
+extern GTY(()) tree gfor_fndecl_caf_error_stop;
+extern GTY(()) tree gfor_fndecl_caf_error_stop_str;
+
+/* Coarray global variables for num_images/this_image. */
+extern GTY(()) tree gfort_gvar_caf_num_images;
+extern GTY(()) tree gfort_gvar_caf_this_image;
+
+
/* Math functions. Many other math functions are handled in
trans-intrinsic.c. */