Commit 31423e30 by Nathan Sidwell Committed by Nathan Sidwell

com.c (ffecom_do_entry_): Use location_t and input_location directly.

	* com.c (ffecom_do_entry_): Use location_t and input_location
	directly.
	(ffecom_gen_sfuncdef_): Likewise.
	(ffecom_start_progunit_): Likewise.
	(ffecom_sym_transform_): Likewise.
	(ffecom_sym_transform_assign_): Likewise.
	* lex.c (ffelex_hash_): Likewise.
	(ffelex_include_): Likewise.
	* std.c (ffestd_exec_begin): Likewise.
	(ffestd_exec_end): Likewise.
	* ste.c (struct gbe_block): Likewise.
	(ffeste_start_block_): Likewise.
	(ffeste_start_stmt_): Likewise.

From-SVN: r66432
parent 5a43f8c4
2003-05-03 Nathan Sidwell <nathan@codesourcery.com> 2003-05-03 Nathan Sidwell <nathan@codesourcery.com>
* com.c (ffecom_do_entry_): Use location_t and input_location
directly.
(ffecom_gen_sfuncdef_): Likewise.
(ffecom_start_progunit_): Likewise.
(ffecom_sym_transform_): Likewise.
(ffecom_sym_transform_assign_): Likewise.
* lex.c (ffelex_hash_): Likewise.
(ffelex_include_): Likewise.
* std.c (ffestd_exec_begin): Likewise.
(ffestd_exec_end): Likewise.
* ste.c (struct gbe_block): Likewise.
(ffeste_start_block_): Likewise.
(ffeste_start_stmt_): Likewise.
2003-05-03 Nathan Sidwell <nathan@codesourcery.com>
* ansify.c (die_unless): Revert lineno change here. * ansify.c (die_unless): Revert lineno change here.
2003-05-02 Nathan Sidwell <nathan@codesourcery.com> 2003-05-02 Nathan Sidwell <nathan@codesourcery.com>
......
...@@ -2582,9 +2582,9 @@ ffecom_do_entry_ (ffesymbol fn, int entrynum) ...@@ -2582,9 +2582,9 @@ ffecom_do_entry_ (ffesymbol fn, int entrynum)
CHARACTER. */ CHARACTER. */
bool cmplxfunc; /* Use f2c way of returning COMPLEX. */ bool cmplxfunc; /* Use f2c way of returning COMPLEX. */
bool multi; /* Master fn has multiple return types. */ bool multi; /* Master fn has multiple return types. */
bool altreturning = FALSE; /* This entry point has alternate returns. */ bool altreturning = FALSE; /* This entry point has alternate
int old_lineno = input_line; returns. */
const char *old_input_filename = input_filename; location_t old_loc = input_location;
input_filename = ffesymbol_where_filename (fn); input_filename = ffesymbol_where_filename (fn);
input_line = ffesymbol_where_filelinenum (fn); input_line = ffesymbol_where_filelinenum (fn);
...@@ -2917,8 +2917,7 @@ ffecom_do_entry_ (ffesymbol fn, int entrynum) ...@@ -2917,8 +2917,7 @@ ffecom_do_entry_ (ffesymbol fn, int entrynum)
finish_function (0); finish_function (0);
input_line = old_lineno; input_location = old_loc;
input_filename = old_input_filename;
ffecom_doing_entry_ = FALSE; ffecom_doing_entry_ = FALSE;
} }
...@@ -6110,8 +6109,7 @@ ffecom_gen_sfuncdef_ (ffesymbol s, ffeinfoBasictype bt, ffeinfoKindtype kt) ...@@ -6110,8 +6109,7 @@ ffecom_gen_sfuncdef_ (ffesymbol s, ffeinfoBasictype bt, ffeinfoKindtype kt)
tree result; tree result;
bool charfunc = (bt == FFEINFO_basictypeCHARACTER); bool charfunc = (bt == FFEINFO_basictypeCHARACTER);
static bool recurse = FALSE; static bool recurse = FALSE;
int old_lineno = input_line; location_t old_loc = input_location;
const char *old_input_filename = input_filename;
ffecom_nested_entry_ = s; ffecom_nested_entry_ = s;
...@@ -6221,8 +6219,7 @@ ffecom_gen_sfuncdef_ (ffesymbol s, ffeinfoBasictype bt, ffeinfoKindtype kt) ...@@ -6221,8 +6219,7 @@ ffecom_gen_sfuncdef_ (ffesymbol s, ffeinfoBasictype bt, ffeinfoKindtype kt)
recurse = FALSE; recurse = FALSE;
input_line = old_lineno; input_location = old_loc;
input_filename = old_input_filename;
ffecom_nested_entry_ = NULL; ffecom_nested_entry_ = NULL;
...@@ -7080,8 +7077,7 @@ ffecom_start_progunit_ () ...@@ -7080,8 +7077,7 @@ ffecom_start_progunit_ ()
&& (ffecom_primary_entry_kind_ == FFEINFO_kindFUNCTION) && (ffecom_primary_entry_kind_ == FFEINFO_kindFUNCTION)
&& (ffecom_master_bt_ == FFEINFO_basictypeNONE); && (ffecom_master_bt_ == FFEINFO_basictypeNONE);
bool main_program = FALSE; bool main_program = FALSE;
int old_lineno = input_line; location_t old_loc = input_location;
const char *old_input_filename = input_filename;
assert (fn != NULL); assert (fn != NULL);
assert (ffesymbol_hook (fn).decl_tree == NULL_TREE); assert (ffesymbol_hook (fn).decl_tree == NULL_TREE);
...@@ -7269,8 +7265,7 @@ ffecom_start_progunit_ () ...@@ -7269,8 +7265,7 @@ ffecom_start_progunit_ ()
/* Disallow temp vars at this level. */ /* Disallow temp vars at this level. */
current_binding_level->prep_state = 2; current_binding_level->prep_state = 2;
input_line = old_lineno; input_location = old_loc;
input_filename = old_input_filename;
/* This handles any symbols still untransformed, in case -g specified. /* This handles any symbols still untransformed, in case -g specified.
This used to be done in ffecom_finish_progunit, but it turns out to This used to be done in ffecom_finish_progunit, but it turns out to
...@@ -7298,8 +7293,7 @@ ffecom_sym_transform_ (ffesymbol s) ...@@ -7298,8 +7293,7 @@ ffecom_sym_transform_ (ffesymbol s)
ffeinfoBasictype bt; ffeinfoBasictype bt;
ffeinfoKindtype kt; ffeinfoKindtype kt;
ffeglobal g; ffeglobal g;
int old_lineno = input_line; location_t old_loc = input_location;
const char *old_input_filename = input_filename;
/* Must ensure special ASSIGN variables are declared at top of outermost /* Must ensure special ASSIGN variables are declared at top of outermost
block, else they'll end up in the innermost block when their first block, else they'll end up in the innermost block when their first
...@@ -8294,8 +8288,7 @@ ffecom_sym_transform_ (ffesymbol s) ...@@ -8294,8 +8288,7 @@ ffecom_sym_transform_ (ffesymbol s)
ffesymbol_hook (s).length_tree = tlen; ffesymbol_hook (s).length_tree = tlen;
ffesymbol_hook (s).addr = addr; ffesymbol_hook (s).addr = addr;
input_line = old_lineno; input_location = old_loc;
input_filename = old_input_filename;
return s; return s;
} }
...@@ -8312,8 +8305,7 @@ static ffesymbol ...@@ -8312,8 +8305,7 @@ static ffesymbol
ffecom_sym_transform_assign_ (ffesymbol s) ffecom_sym_transform_assign_ (ffesymbol s)
{ {
tree t; /* Transformed thingy. */ tree t; /* Transformed thingy. */
int old_lineno = input_line; location_t old_loc = input_location;
const char *old_input_filename = input_filename;
if (ffesymbol_sfdummyparent (s) == NULL) if (ffesymbol_sfdummyparent (s) == NULL)
{ {
...@@ -8375,8 +8367,7 @@ ffecom_sym_transform_assign_ (ffesymbol s) ...@@ -8375,8 +8367,7 @@ ffecom_sym_transform_assign_ (ffesymbol s)
ffesymbol_hook (s).assign_tree = t; ffesymbol_hook (s).assign_tree = t;
input_line = old_lineno; input_location = old_loc;
input_filename = old_input_filename;
return s; return s;
} }
......
...@@ -1193,8 +1193,7 @@ ffelex_hash_ (FILE *finput) ...@@ -1193,8 +1193,7 @@ ffelex_hash_ (FILE *finput)
if ((token != NULL) if ((token != NULL)
&& (ffelex_token_type (token) == FFELEX_typeNUMBER)) && (ffelex_token_type (token) == FFELEX_typeNUMBER))
{ {
int old_lineno = input_line; location_t old_loc = input_location;
const char *old_input_filename = input_filename;
ffewhereFile wf; ffewhereFile wf;
/* subtract one, because it is the following line that /* subtract one, because it is the following line that
...@@ -1281,14 +1280,14 @@ ffelex_hash_ (FILE *finput) ...@@ -1281,14 +1280,14 @@ ffelex_hash_ (FILE *finput)
if (ffelex_kludge_flag_) if (ffelex_kludge_flag_)
{ {
input_line = 1; input_line = 1;
input_filename = old_input_filename; input_filename = old_loc.file;
error ("use `#line ...' instead of `# ...' in first line"); error ("use `#line ...' instead of `# ...' in first line");
} }
if (num == 1) if (num == 1)
{ {
/* Pushing to a new file. */ /* Pushing to a new file. */
ffelex_file_push_ (old_lineno, input_filename); ffelex_file_push_ (old_loc.line, input_filename);
} }
else if (num == 2) else if (num == 2)
{ {
...@@ -1325,7 +1324,7 @@ ffelex_hash_ (FILE *finput) ...@@ -1325,7 +1324,7 @@ ffelex_hash_ (FILE *finput)
&& ffelex_kludge_flag_) && ffelex_kludge_flag_)
{ {
input_line = 1; input_line = 1;
input_filename = old_input_filename; input_filename = old_loc.file;
error ("use `#line ...' instead of `# ...' in first line"); error ("use `#line ...' instead of `# ...' in first line");
} }
if (c == '\n' || c == EOF) if (c == '\n' || c == EOF)
...@@ -1470,8 +1469,7 @@ ffelex_include_ () ...@@ -1470,8 +1469,7 @@ ffelex_include_ ()
ffewhereLineNumber linecount_current = ffelex_linecount_current_; ffewhereLineNumber linecount_current = ffelex_linecount_current_;
ffewhereLineNumber linecount_offset ffewhereLineNumber linecount_offset
= ffewhere_line_filelinenum (current_wl); = ffewhere_line_filelinenum (current_wl);
int old_lineno = input_line; location_t old_loc = input_location;
const char *old_input_filename = input_filename;
if (card_length != 0) if (card_length != 0)
{ {
...@@ -1489,7 +1487,7 @@ ffelex_include_ () ...@@ -1489,7 +1487,7 @@ ffelex_include_ ()
ffewhere_file_set (include_wherefile, TRUE, 0); ffewhere_file_set (include_wherefile, TRUE, 0);
ffelex_file_push_ (old_lineno, ffewhere_file_name (include_wherefile)); ffelex_file_push_ (old_loc.line, ffewhere_file_name (include_wherefile));
if (ffelex_include_free_form_) if (ffelex_include_free_form_)
ffelex_file_free (include_wherefile, include_file); ffelex_file_free (include_wherefile, include_file);
...@@ -1512,8 +1510,7 @@ ffelex_include_ () ...@@ -1512,8 +1510,7 @@ ffelex_include_ ()
} }
ffelex_card_image_[card_length] = '\0'; ffelex_card_image_[card_length] = '\0';
input_filename = old_input_filename; input_location = old_loc;
input_line = old_lineno;
ffelex_linecount_current_ = linecount_current; ffelex_linecount_current_ = linecount_current;
ffelex_current_wf_ = current_wf; ffelex_current_wf_ = current_wf;
ffelex_final_nontab_column_ = final_nontab_column; ffelex_final_nontab_column_ = final_nontab_column;
......
...@@ -1423,8 +1423,7 @@ ffestd_exec_begin () ...@@ -1423,8 +1423,7 @@ ffestd_exec_begin ()
void void
ffestd_exec_end () ffestd_exec_end ()
{ {
int old_lineno = input_line; location_t old_loc = input_location;
const char *old_input_filename = input_filename;
ffecom_end_transition (); ffecom_end_transition ();
...@@ -1456,8 +1455,7 @@ ffestd_exec_end () ...@@ -1456,8 +1455,7 @@ ffestd_exec_end ()
ffestd_stmt_list_.last = NULL; ffestd_stmt_list_.last = NULL;
ffestd_2pass_entrypoints_ = 0; ffestd_2pass_entrypoints_ = 0;
input_line = old_lineno; input_location = old_loc;
input_filename = old_input_filename;
} }
/* ffestd_init_3 -- Initialize for any program unit /* ffestd_init_3 -- Initialize for any program unit
......
...@@ -387,8 +387,7 @@ typedef struct gbe_block ...@@ -387,8 +387,7 @@ typedef struct gbe_block
{ {
struct gbe_block *outer; struct gbe_block *outer;
ffestw block; ffestw block;
int lineno; location_t location;
const char *filename;
bool is_stmt; bool is_stmt;
} *gbe_block; } *gbe_block;
...@@ -401,8 +400,7 @@ ffeste_start_block_ (ffestw block) ...@@ -401,8 +400,7 @@ ffeste_start_block_ (ffestw block)
b->outer = ffeste_top_block_; b->outer = ffeste_top_block_;
b->block = block; b->block = block;
b->lineno = input_line; b->location = input_location;
b->filename = input_filename;
b->is_stmt = FALSE; b->is_stmt = FALSE;
ffeste_top_block_ = b; ffeste_top_block_ = b;
...@@ -443,8 +441,7 @@ ffeste_start_stmt_(void) ...@@ -443,8 +441,7 @@ ffeste_start_stmt_(void)
b->outer = ffeste_top_block_; b->outer = ffeste_top_block_;
b->block = NULL; b->block = NULL;
b->lineno = input_line; b->location = input_location;
b->filename = input_filename;
b->is_stmt = TRUE; b->is_stmt = TRUE;
ffeste_top_block_ = b; ffeste_top_block_ = b;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment