/* 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
loops the terms appear in. This will be 1 for the RHS expressions,
2 for the LHS expressions, and 3(=1|2) for the temporary. The bit
'where' suppresses precalculation of scalars in WHERE assignments. */
- unsigned useflags:2, where:1;
+ unsigned useflags:2, where:1, is_alloc_lhs:1;
}
gfc_ss;
#define gfc_get_ss() XCNEW (gfc_ss)
/* Find the decl containing the auxiliary variables for assigned variables. */
void gfc_conv_label_variable (gfc_se * se, gfc_expr * expr);
/* If the value is not constant, Create a temporary and copy the value. */
+tree gfc_evaluate_now_loc (location_t, tree, stmtblock_t *);
tree gfc_evaluate_now (tree, stmtblock_t *);
/* Find the appropriate variant of a math intrinsic. */
/* Add an expression to the end of a block. */
void gfc_add_expr_to_block (stmtblock_t *, tree);
+/* Add an expression to the beginning of a block. */
+void gfc_prepend_expr_to_block (stmtblock_t *, tree);
/* Add a block to the end of a block. */
void gfc_add_block_to_block (stmtblock_t *, stmtblock_t *);
/* Add a MODIFY_EXPR to a block. */
+void gfc_add_modify_loc (location_t, stmtblock_t *, tree, tree);
void gfc_add_modify (stmtblock_t *, tree, tree);
/* Initialize a statement block. */
/* Set the backend source location of a decl. */
void gfc_set_decl_location (tree, locus *);
+/* Get a module symbol backend_decl if possible. */
+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);
void gfc_module_add_decl (struct module_htab_entry *, tree);
/* Get and set the current location. */
+void gfc_save_backend_locus (locus *);
void gfc_set_backend_locus (locus *);
-void gfc_get_backend_locus (locus *);
+void gfc_restore_backend_locus (locus *);
/* Handle static constructor functions. */
extern GTY(()) tree gfc_static_ctors;
/* Generate a runtime error call. */
tree gfc_trans_runtime_error (bool, locus*, const char*, ...);
-tree gfc_trans_runtime_error_vararg (bool, locus*, const char*, va_list);
/* Generate a runtime warning/error check. */
void gfc_trans_runtime_check (bool, bool, tree, stmtblock_t *, locus *,
/* Generate code to deallocate an array. */
tree gfc_deallocate_with_status (tree, tree, bool, gfc_expr*);
+tree gfc_deallocate_scalar_with_status (tree, tree, bool, gfc_expr*, gfc_typespec);
/* Generate code to call realloc(). */
tree gfc_call_realloc (stmtblock_t *, tree, tree);
tree rettype, int nargs, ...);
/* Process the local variable decls of a block construct. */
-void gfc_process_block_locals (gfc_namespace*, gfc_association_list*);
+void gfc_process_block_locals (gfc_namespace*);
/* Output initialization/clean-up code that was deferred. */
void gfc_trans_deferred_vars (gfc_symbol*, gfc_wrapped_block *);
extern GTY(()) tree gfor_fndecl_pause_numeric;
extern GTY(()) tree gfor_fndecl_pause_string;
extern GTY(()) tree gfor_fndecl_stop_numeric;
+extern GTY(()) tree gfor_fndecl_stop_numeric_f08;
extern GTY(()) tree gfor_fndecl_stop_string;
extern GTY(()) tree gfor_fndecl_error_stop_numeric;
extern GTY(()) tree gfor_fndecl_error_stop_string;
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. */
tree dataptr_type;
tree span;
tree base_decl[2];
+ tree nonrestricted_type;
};
struct GTY((variable_size)) lang_decl {
(TYPE_LANG_SPECIFIC(node)->base_decl[(internal)])
-/* Create _loc version of build[0-9]. */
-
-static inline tree
-build1_stat_loc (location_t loc, enum tree_code code, tree type,
- tree op MEM_STAT_DECL)
-{
- tree t = build1_stat (code, type, op PASS_MEM_STAT);
- SET_EXPR_LOCATION (t, loc);
- return t;
-}
-#define build1_loc(l,c,t1,t2) build1_stat_loc (l,c,t1,t2 MEM_STAT_INFO)
-
-static inline tree
-build2_stat_loc (location_t loc, enum tree_code code, tree type, tree arg0,
- tree op MEM_STAT_DECL)
-{
- tree t = build2_stat (code, type, arg0, op PASS_MEM_STAT);
- SET_EXPR_LOCATION (t, loc);
- return t;
-}
-#define build2_loc(l,c,t1,t2,t3) build2_stat_loc (l,c,t1,t2,t3 MEM_STAT_INFO)
-
-static inline tree
-build3_stat_loc (location_t loc, enum tree_code code, tree type, tree arg0,
- tree arg1, tree op MEM_STAT_DECL)
-{
- tree t = build3_stat (code, type, arg0, arg1, op PASS_MEM_STAT);
- SET_EXPR_LOCATION (t, loc);
- return t;
-}
-#define build3_loc(l,c,t1,t2,t3,t4) \
- build3_stat_loc (l,c,t1,t2,t3,t4 MEM_STAT_INFO)
-
-static inline tree
-build4_stat_loc (location_t loc, enum tree_code code, tree type, tree arg0,
- tree arg1, tree arg2, tree op MEM_STAT_DECL)
-{
- tree t = build4_stat (code, type, arg0, arg1, arg2, op PASS_MEM_STAT);
- SET_EXPR_LOCATION (t, loc);
- return t;
-}
-#define build4_loc(l,c,t1,t2,t3,t4,t5) \
- build4_stat_loc (l,c,t1,t2,t3,t4,t5 MEM_STAT_INFO)
-
-
/* Build an expression with void type. */
#define build1_v(code, arg) \
fold_build1_loc (input_location, code, void_type_node, arg)