/* gfortran header file
- Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation,
- Inc.
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
+ Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
GFC_ISYM_ALL,
GFC_ISYM_ALLOCATED,
GFC_ISYM_ANINT,
+ GFC_ISYM_AND,
GFC_ISYM_ANY,
GFC_ISYM_ASIN,
GFC_ISYM_ASINH,
GFC_ISYM_CHDIR,
GFC_ISYM_CMPLX,
GFC_ISYM_COMMAND_ARGUMENT_COUNT,
+ GFC_ISYM_COMPLEX,
GFC_ISYM_CONJG,
GFC_ISYM_COS,
GFC_ISYM_COSH,
GFC_ISYM_EXP,
GFC_ISYM_EXPONENT,
GFC_ISYM_FDATE,
+ GFC_ISYM_FGET,
+ GFC_ISYM_FGETC,
GFC_ISYM_FLOOR,
GFC_ISYM_FNUM,
+ GFC_ISYM_FPUT,
+ GFC_ISYM_FPUTC,
GFC_ISYM_FRACTION,
GFC_ISYM_FSTAT,
+ GFC_ISYM_FTELL,
GFC_ISYM_GETCWD,
GFC_ISYM_GETGID,
GFC_ISYM_GETPID,
GFC_ISYM_NEAREST,
GFC_ISYM_NINT,
GFC_ISYM_NOT,
+ GFC_ISYM_OR,
GFC_ISYM_PACK,
GFC_ISYM_PRESENT,
GFC_ISYM_PRODUCT,
GFC_ISYM_UNLINK,
GFC_ISYM_UNPACK,
GFC_ISYM_VERIFY,
+ GFC_ISYM_XOR,
GFC_ISYM_CONVERSION
};
typedef enum gfc_generic_isym_id gfc_generic_isym_id;
/************************* Structures *****************************/
+/* Used for keeping things in balanced binary trees. */
+#define BBT_HEADER(self) int priority; struct self *left, *right
+
/* Symbol attribute structure. */
typedef struct
{
ENUM_BITFIELD (ifsrc) if_source:2;
ENUM_BITFIELD (procedure_type) proc:3;
-
+
/* Special attributes for Cray pointers, pointees. */
- unsigned cray_pointer:1, cray_pointee:1;
+ unsigned cray_pointer:1, cray_pointee:1;
}
symbol_attribute;
/* The following three structures are used to identify a location in
- the sources.
-
+ the sources.
+
gfc_file is used to maintain a tree of the source files and how
they include each other
which file it resides in
locus point to the sourceline and the character in the source
- line.
+ line.
*/
-typedef struct gfc_file
+typedef struct gfc_file
{
struct gfc_file *included_by, *next, *up;
int inclusion_line, line;
char *filename;
} gfc_file;
-typedef struct gfc_linebuf
+typedef struct gfc_linebuf
{
#ifdef USE_MAPPED_LOCATION
source_location location;
#define gfc_linebuf_header_size (offsetof (gfc_linebuf, line))
-typedef struct
+typedef struct
{
char *nextc;
gfc_linebuf *lb;
struct gfc_expr *length;
struct gfc_charlen *next;
tree backend_decl;
+
+ int resolved;
}
gfc_charlen;
/* TODO: Make format/statement specifics a union. */
typedef struct gfc_st_label
{
+ BBT_HEADER(gfc_st_label);
+
int value;
gfc_sl_type defined, referenced;
tree backend_decl;
locus where;
-
- struct gfc_st_label *prev, *next;
}
gfc_st_label;
int use_assoc, saved;
char name[GFC_MAX_SYMBOL_LEN + 1];
struct gfc_symbol *head;
-}
+}
gfc_common_head;
#define gfc_get_common_head() gfc_getmem(sizeof(gfc_common_head))
several symtrees pointing to the same symbol node via USE
statements. */
-#define BBT_HEADER(self) int priority; struct self *left, *right
-
typedef struct gfc_symtree
{
BBT_HEADER (gfc_symtree);
}
gfc_symtree;
+/* A linked list of derived types in the namespace. */
+typedef struct gfc_dt_list
+{
+ struct gfc_symbol *derived;
+ struct gfc_dt_list *next;
+}
+gfc_dt_list;
+
+#define gfc_get_dt_list() gfc_getmem(sizeof(gfc_dt_list))
+
/* A namespace describes the contents of procedure, module or
interface block. */
/* Tree containing all the user-defined operators in the namespace. */
gfc_symtree *uop_root;
/* Tree containing all the common blocks. */
- gfc_symtree *common_root;
+ gfc_symtree *common_root;
/* If set_flag[letter] is set, an implicit type has been set for letter. */
int set_flag[GFC_LETTERS];
/* A list of all alternate entry points to this procedure (or NULL). */
gfc_entry_list *entries;
+ /* A list of all derived types in this procedure (or NULL). */
+ gfc_dt_list *derived_types;
+
/* Set to 1 if namespace is a BLOCK DATA program unit. */
int is_block_data;
}
/* True if it is converted from Hollerith constant. */
unsigned int from_H : 1;
+ /* True if the expression is a call to a function that returns an array,
+ and if we have decided not to allocate temporary data for that array. */
+ unsigned int inline_noncopying_intrinsic : 1;
union
{
typedef struct
{
gfc_expr *unit, *file, *status, *access, *form, *recl,
- *blank, *position, *action, *delim, *pad, *iostat, *iomsg;
+ *blank, *position, *action, *delim, *pad, *iostat, *iomsg, *convert;
gfc_st_label *err;
}
gfc_open;
gfc_expr *unit, *file, *iostat, *exist, *opened, *number, *named,
*name, *access, *sequential, *direct, *form, *formatted,
*unformatted, *recl, *nextrec, *blank, *position, *action, *read,
- *write, *readwrite, *delim, *pad, *iolength, *iomsg;
+ *write, *readwrite, *delim, *pad, *iolength, *iomsg, *convert;
gfc_st_label *err;
gfc_st_label *format_label;
gfc_st_label *err, *end, *eor;
- locus eor_where, end_where;
+ locus eor_where, end_where, err_where;
}
gfc_dt;
ext; /* Points to additional structures required by statement */
/* Backend_decl is used for cycle and break labels in do loops, and
- * probably for other constructs as well, once we translate them. */
+ probably for other constructs as well, once we translate them. */
tree backend_decl;
}
gfc_code;
{
char *module_dir;
gfc_source_form source_form;
- int fixed_line_length;
+ /* When fixed_line_length or free_line_length are 0, the whole line is used.
+
+ Default is -1, the maximum line length mandated by the respective source
+ form is used:
+ for FORM_FREE GFC_MAX_LINE (132)
+ else 72.
+
+ If fixed_line_length or free_line_length is not 0 nor -1 then the user has
+ requested a specific line-length.
+
+ If the user requests a fixed_line_length <7 then gfc_init_options()
+ emits a fatal error. */
+ int fixed_line_length; /* maximum line length in fixed-form. */
+ int free_line_length; /* maximum line length in free-form. */
int max_identifier_length;
int verbose;
int flag_no_backend;
int flag_pack_derived;
int flag_repack_arrays;
+ int flag_preprocessed;
int flag_f2c;
int flag_automatic;
int flag_backslash;
void gfc_add_include_path (const char *);
void gfc_release_include_path (void);
-FILE *gfc_open_included_file (const char *);
+FILE *gfc_open_included_file (const char *, bool);
int gfc_at_end (void);
int gfc_at_eof (void);
void gfc_error_recovery (void);
void gfc_gobble_whitespace (void);
try gfc_new_file (void);
+const char * gfc_read_orig_filename (const char *, const char **);
extern gfc_source_form gfc_current_form;
extern const char *gfc_source_file;
void gfc_set_sym_referenced (gfc_symbol * sym);
+try gfc_add_attribute (symbol_attribute *, locus *, uint);
try gfc_add_allocatable (symbol_attribute *, locus *);
try gfc_add_dimension (symbol_attribute *, const char *, locus *);
try gfc_add_external (symbol_attribute *, locus *);
void gfc_undo_symbols (void);
void gfc_commit_symbols (void);
+void gfc_commit_symbol (gfc_symbol * sym);
void gfc_free_namespace (gfc_namespace *);
void gfc_symbol_init_2 (void);
void gfc_type_convert_binary (gfc_expr *);
int gfc_is_constant_expr (gfc_expr *);
try gfc_simplify_expr (gfc_expr *, int);
+int gfc_has_vector_index (gfc_expr *);
gfc_expr *gfc_get_expr (void);
void gfc_free_expr (gfc_expr *);
gfc_expr *gfc_default_initializer (gfc_typespec *);
gfc_expr *gfc_get_variable_expr (gfc_symtree *);
+void gfc_expr_set_symbols_referenced (gfc_expr * expr);
/* st.c */
extern gfc_code new_st;
/* interface.c -- FIXME: some of these should be in symbol.c */
void gfc_free_interface (gfc_interface *);
+int gfc_compare_derived_types (gfc_symbol *, gfc_symbol *);
int gfc_compare_types (gfc_typespec *, gfc_typespec *);
void gfc_check_interfaces (gfc_namespace *);
void gfc_procedure_use (gfc_symbol *, gfc_actual_arglist **, locus *);
/* parse.c */
try gfc_parse_file (void);
+void global_used (gfc_gsymbol *, locus *);
+
+/* dependency.c */
+int gfc_dep_compare_expr (gfc_expr *, gfc_expr *);
#endif /* GCC_GFORTRAN_H */