X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=gcc%2Ffortran%2Fgfortran.h;h=54310dfbea15461800fee8cb686f92ccd121ded9;hp=34afae433868f5075a24292920354c65065c8c90;hb=c5ad4f2870c02eda34cb6b351e74304c1039f39e;hpb=149f62f23535ea6300c792eb39c88fa4fb4a5011 diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 34afae43386..54310dfbea1 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -1,6 +1,6 @@ /* gfortran header file Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, - 2009, 2010, 2011 + 2009, 2010, 2011, 2012 Free Software Foundation, Inc. Contributed by Andy Vaught @@ -42,7 +42,6 @@ along with GCC; see the file COPYING3. If not see /* Major control parameters. */ #define GFC_MAX_SYMBOL_LEN 63 /* Must be at least 63 for F2003. */ -#define GFC_MAX_BINDING_LABEL_LEN 126 /* (2 * GFC_MAX_SYMBOL_LEN) */ #define GFC_MAX_LINE 132 /* Characters beyond this are not seen. */ #define GFC_LETTERS 26 /* Number of letters in the alphabet. */ @@ -62,6 +61,15 @@ along with GCC; see the file COPYING3. If not see #define PREFIX(x) "_gfortran_" x #define PREFIX_LEN 10 +/* A prefix for internal variables, which are not user-visible. */ +#if !defined (NO_DOT_IN_LABEL) +# define GFC_PREFIX(x) "_F." x +#elif !defined (NO_DOLLAR_IN_LABEL) +# define GFC_PREFIX(x) "_F$" x +#else +# define GFC_PREFIX(x) "_F_" x +#endif + #define BLANK_COMMON_NAME "__BLNK__" /* Macro to initialize an mstring structure. */ @@ -610,8 +618,8 @@ iso_fortran_env_symbol; #undef NAMED_DERIVED_TYPE #define NAMED_INTCST(a,b,c,d) a, -#define NAMED_REALCST(a,b,c) a, -#define NAMED_CMPXCST(a,b,c) a, +#define NAMED_REALCST(a,b,c,d) a, +#define NAMED_CMPXCST(a,b,c,d) a, #define NAMED_LOGCST(a,b,c) a, #define NAMED_CHARKNDCST(a,b,c) a, #define NAMED_CHARCST(a,b,c) a, @@ -1116,6 +1124,7 @@ typedef struct gfc_tbp_generic struct gfc_typebound_proc* specific; struct gfc_tbp_generic* next; + bool is_operator; } gfc_tbp_generic; @@ -1238,7 +1247,7 @@ typedef struct gfc_symbol /* This may be repetitive, since the typespec now has a binding label field. */ - char binding_label[GFC_MAX_BINDING_LABEL_LEN + 1]; + const char* binding_label; /* Store a reference to the common_block, if this symbol is in one. */ struct gfc_common_head *common_block; @@ -1255,7 +1264,7 @@ typedef struct gfc_common_head char use_assoc, saved, threadprivate; char name[GFC_MAX_SYMBOL_LEN + 1]; struct gfc_symbol *head; - char binding_label[GFC_MAX_BINDING_LABEL_LEN + 1]; + const char* binding_label; int is_bind_c; } gfc_common_head; @@ -1299,7 +1308,9 @@ gfc_use_rename; typedef struct gfc_use_list { const char *module_name; - int only_flag; + bool intrinsic; + bool non_intrinsic; + bool only_flag; struct gfc_use_rename *rename; locus where; /* Next USE statement. */ @@ -1697,6 +1708,10 @@ typedef struct gfc_expr locus where; + /* Used to store the base expression in component calls, when the expression + is not a variable. */ + struct gfc_expr *base_expr; + /* is_boz is true if the integer is regarded as BOZ bitpatten and is_snan denotes a signalling not-a-number. */ unsigned int is_boz : 1, is_snan : 1; @@ -2048,14 +2063,14 @@ gfc_association_list; /* Executable statements that fill gfc_code structures. */ typedef enum { - EXEC_NOP = 1, EXEC_END_BLOCK, EXEC_ASSIGN, EXEC_LABEL_ASSIGN, - EXEC_POINTER_ASSIGN, EXEC_CRITICAL, EXEC_ERROR_STOP, + EXEC_NOP = 1, EXEC_END_NESTED_BLOCK, EXEC_END_BLOCK, EXEC_ASSIGN, + EXEC_LABEL_ASSIGN, EXEC_POINTER_ASSIGN, EXEC_CRITICAL, EXEC_ERROR_STOP, EXEC_GOTO, EXEC_CALL, EXEC_COMPCALL, EXEC_ASSIGN_CALL, EXEC_RETURN, EXEC_ENTRY, EXEC_PAUSE, EXEC_STOP, EXEC_CONTINUE, EXEC_INIT_ASSIGN, - EXEC_IF, EXEC_ARITHMETIC_IF, EXEC_DO, EXEC_DO_WHILE, EXEC_SELECT, EXEC_BLOCK, - EXEC_FORALL, EXEC_WHERE, EXEC_CYCLE, EXEC_EXIT, EXEC_CALL_PPC, - EXEC_ALLOCATE, EXEC_DEALLOCATE, EXEC_END_PROCEDURE, EXEC_SELECT_TYPE, - EXEC_SYNC_ALL, EXEC_SYNC_MEMORY, EXEC_SYNC_IMAGES, + EXEC_IF, EXEC_ARITHMETIC_IF, EXEC_DO, EXEC_DO_CONCURRENT, EXEC_DO_WHILE, + EXEC_SELECT, EXEC_BLOCK, EXEC_FORALL, EXEC_WHERE, EXEC_CYCLE, EXEC_EXIT, + EXEC_CALL_PPC, EXEC_ALLOCATE, EXEC_DEALLOCATE, EXEC_END_PROCEDURE, + EXEC_SELECT_TYPE, EXEC_SYNC_ALL, EXEC_SYNC_MEMORY, EXEC_SYNC_IMAGES, EXEC_OPEN, EXEC_CLOSE, EXEC_WAIT, EXEC_READ, EXEC_WRITE, EXEC_IOLENGTH, EXEC_TRANSFER, EXEC_DT_END, EXEC_BACKSPACE, EXEC_ENDFILE, EXEC_INQUIRE, EXEC_REWIND, EXEC_FLUSH, @@ -2215,6 +2230,9 @@ typedef struct int flag_default_double; int flag_default_integer; int flag_default_real; + int flag_integer4_kind; + int flag_real4_kind; + int flag_real8_kind; int flag_dollar_ok; int flag_underscoring; int flag_second_underscore; @@ -2581,13 +2599,13 @@ gfc_symtree* gfc_find_symtree_in_proc (const char *, gfc_namespace *); int gfc_find_symbol (const char *, gfc_namespace *, int, gfc_symbol **); int gfc_find_sym_tree (const char *, gfc_namespace *, int, gfc_symtree **); int gfc_get_symbol (const char *, gfc_namespace *, gfc_symbol **); -gfc_try verify_c_interop (gfc_typespec *); -gfc_try verify_c_interop_param (gfc_symbol *); +gfc_try gfc_verify_c_interop (gfc_typespec *); +gfc_try gfc_verify_c_interop_param (gfc_symbol *); gfc_try verify_bind_c_sym (gfc_symbol *, gfc_typespec *, int, gfc_common_head *); gfc_try verify_bind_c_derived_type (gfc_symbol *); gfc_try verify_com_block_vars_c_interop (gfc_common_head *); void generate_isocbinding_symbol (const char *, iso_c_binding_symbol, const char *); -gfc_symbol *get_iso_c_sym (gfc_symbol *, char *, char *, int); +gfc_symbol *get_iso_c_sym (gfc_symbol *, char *, const char *, int); int gfc_get_sym_tree (const char *, gfc_namespace *, gfc_symtree **, bool); int gfc_get_ha_symbol (const char *, gfc_symbol **); int gfc_get_ha_sym_tree (const char *, gfc_symtree **); @@ -2630,6 +2648,7 @@ gfc_try gfc_check_symbol_typed (gfc_symbol*, gfc_namespace*, bool, locus); gfc_namespace* gfc_find_proc_namespace (gfc_namespace*); bool gfc_is_associate_pointer (gfc_symbol*); +gfc_symbol * gfc_find_dt_in_generic (gfc_symbol *); /* intrinsic.c -- true if working in an init-expr, false otherwise. */ extern bool gfc_init_expr_flag; @@ -2711,6 +2730,8 @@ gfc_expr *gfc_get_int_expr (int, locus *, int); gfc_expr *gfc_get_logical_expr (int, locus *, bool); gfc_expr *gfc_get_iokind_expr (locus *, io_kind); +void gfc_clear_shape (mpz_t *shape, int rank); +void gfc_free_shape (mpz_t **shape, int rank); void gfc_free_expr (gfc_expr *); void gfc_replace_expr (gfc_expr *, gfc_expr *); mpz_t *gfc_copy_shape (mpz_t *, int); @@ -2752,7 +2773,8 @@ int gfc_get_corank (gfc_expr *); bool gfc_has_ultimate_allocatable (gfc_expr *); bool gfc_has_ultimate_pointer (gfc_expr *); -gfc_expr* gfc_build_intrinsic_call (const char*, locus, unsigned, ...); +gfc_expr* gfc_build_intrinsic_call (gfc_namespace *, gfc_isym_id, const char*, + locus, unsigned, ...); gfc_try gfc_check_vardef_context (gfc_expr*, bool, bool, const char*); @@ -2773,6 +2795,7 @@ void gfc_resolve_blocks (gfc_code *, gfc_namespace *); int gfc_impure_variable (gfc_symbol *); int gfc_pure (gfc_symbol *); int gfc_implicit_pure (gfc_symbol *); +void gfc_unset_implicit_pure (gfc_symbol *); int gfc_elemental (gfc_symbol *); gfc_try gfc_resolve_iterator (gfc_iterator *, bool); gfc_try find_forall_index (gfc_expr *, gfc_symbol *, int); @@ -2829,7 +2852,7 @@ void gfc_procedure_use (gfc_symbol *, gfc_actual_arglist **, locus *); void gfc_ppc_use (gfc_component *, gfc_actual_arglist **, locus *); gfc_symbol *gfc_search_interface (gfc_interface *, int, gfc_actual_arglist **); -gfc_try gfc_extend_expr (gfc_expr *, bool *); +match gfc_extend_expr (gfc_expr *); void gfc_free_formal_arglist (gfc_formal_arglist *); gfc_try gfc_extend_assign (gfc_code *, gfc_namespace *); gfc_try gfc_add_interface (gfc_symbol *); @@ -2840,6 +2863,7 @@ bool gfc_arglist_matches_symbol (gfc_actual_arglist**, gfc_symbol*); bool gfc_check_operator_interface (gfc_symbol*, gfc_intrinsic_op, locus); int gfc_has_vector_subscript (gfc_expr*); gfc_intrinsic_op gfc_equivalent_op (gfc_intrinsic_op); +gfc_try gfc_check_typebound_override (gfc_symtree*, gfc_symtree*); /* io.c */ extern gfc_st_label format_asterisk; @@ -2871,12 +2895,18 @@ match gfc_match_rvalue (gfc_expr **); match gfc_match_varspec (gfc_expr*, int, bool, bool); int gfc_check_digit (char, int); bool gfc_is_function_return_value (gfc_symbol *, gfc_namespace *); +gfc_try gfc_convert_to_structure_constructor (gfc_expr *, gfc_symbol *, + gfc_expr **, + gfc_actual_arglist **, bool); /* trans.c */ void gfc_generate_code (gfc_namespace *); void gfc_generate_module_code (gfc_namespace *); void gfc_init_coarray_decl (bool); +/* trans-intrinsic.c */ +bool gfc_inline_intrinsic_function_p (gfc_expr *); + /* bbt.c */ typedef int (*compare_fn) (void *, void *); void gfc_insert_bbt (void *, void *, compare_fn); @@ -2900,12 +2930,16 @@ gfc_try gfc_calculate_transfer_sizes (gfc_expr*, gfc_expr*, gfc_expr*, size_t*, size_t*, size_t*); /* class.c */ +void gfc_fix_class_refs (gfc_expr *e); void gfc_add_component_ref (gfc_expr *, const char *); +void gfc_add_class_array_ref (gfc_expr *); #define gfc_add_data_component(e) gfc_add_component_ref(e,"_data") #define gfc_add_vptr_component(e) gfc_add_component_ref(e,"_vptr") #define gfc_add_hash_component(e) gfc_add_component_ref(e,"_hash") #define gfc_add_size_component(e) gfc_add_component_ref(e,"_size") #define gfc_add_def_init_component(e) gfc_add_component_ref(e,"_def_init") +bool gfc_is_class_array_ref (gfc_expr *, bool *); +bool gfc_is_class_scalar_expr (gfc_expr *); gfc_expr *gfc_class_null_initializer (gfc_typespec *); unsigned int gfc_hash_value (gfc_symbol *); gfc_try gfc_build_class_symbol (gfc_typespec *, symbol_attribute *,