diff options
Diffstat (limited to 'gcc/fortran/gfortran.h')
| -rw-r--r-- | gcc/fortran/gfortran.h | 70 | 
1 files changed, 33 insertions, 37 deletions
| diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 627eb8df96b..498e63b6c9b 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -413,35 +413,40 @@ typedef struct  symbol_attribute; -typedef struct -{ -  char *nextc; -  int line;			/* line within the lp structure */ -  struct linebuf *lp; -  struct gfc_file *file; -} -locus; +/* The following three structures are used to identify a location in +   the sources.  +    +   gfc_file is used to maintain a tree of the source files and how +   they include each other -/* The linebuf structure deserves some explanation.  This is the -   primary structure for holding lines.  A source file is stored in a -   singly linked list of these structures.  Each structure holds an -   integer number of lines.  The line[] member is actually an array of -   pointers that point to the NULL-terminated lines.  This list grows -   upwards, and the actual lines are stored at the top of the -   structure and grow downward.  Each structure is packed with as many -   lines as it can hold, then another linebuf is allocated.  */ +   gfc_linebuf holds a single line of source code and information +   which file it resides in -/* Chosen so that sizeof(linebuf) = 4096 on most machines */ -#define LINEBUF_SIZE 4080 +   locus point to the sourceline and the character in the source +   line.   +*/ -typedef struct linebuf +typedef struct gfc_file   { -  int start_line, lines; -  struct linebuf *next; -  char *line[1]; -  char buf[LINEBUF_SIZE]; -} -linebuf; +  struct gfc_file *included_by, *next, *up; +  int inclusion_line, line; +  char *filename; +} gfc_file; + +typedef struct gfc_linebuf  +{ +  int linenum; +  struct gfc_file *file; +  struct gfc_linebuf *next; + +  char line[]; +} gfc_linebuf; +   +typedef struct  +{ +  char *nextc; +  gfc_linebuf *lb; +} locus;  #include <limits.h> @@ -451,17 +456,6 @@ linebuf;  #endif -typedef struct gfc_file -{ -  char filename[PATH_MAX + 1]; -  gfc_source_form form; -  struct gfc_file *included_by, *next; -  locus loc; -  struct linebuf *start; -} -gfc_file; - -  extern int gfc_suppress_error; @@ -1308,7 +1302,9 @@ void gfc_error_recovery (void);  void gfc_gobble_whitespace (void);  try gfc_new_file (const char *, gfc_source_form); -extern gfc_file *gfc_current_file; +extern gfc_source_form gfc_current_form; +extern char *gfc_source_file; +/* extern locus gfc_current_locus; */  /* misc.c */  void *gfc_getmem (size_t) ATTRIBUTE_MALLOC; | 

