aboutsummaryrefslogtreecommitdiff
path: root/gcc/treelang/tree1.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2003-05-06 09:18:46 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2003-05-06 09:18:46 +0000
commitc2e3960284ce035ac43af2525f8ee3fed15ab9b3 (patch)
tree40b598b4edfdb0e0256b7acc704bac61ff58f9e8 /gcc/treelang/tree1.c
parente8b84d3d39380e5cf08dcf567367b95485ed7e72 (diff)
downloadgcc-c2e3960284ce035ac43af2525f8ee3fed15ab9b3.zip
gcc-c2e3960284ce035ac43af2525f8ee3fed15ab9b3.tar.gz
gcc-c2e3960284ce035ac43af2525f8ee3fed15ab9b3.tar.bz2
Make-lang.in (treelang/tree1.o): Depends on input.h
treelang: * Make-lang.in (treelang/tree1.o): Depends on input.h (treelang/treetree.o, treelang/parse.o, treelang/lex.o): Likewise. * treelang.h: #include input.h. (in_fname): Remove. (struct token_part): Remove lineno, add location. * lex.l (next_tree_lineno): Remove. (update_lineno_charno): Adjust. (dump_lex_value): Adjust. * parse.y (variable_def, function_prototype, function, statement, if_statement, return, function_invocation, variable_ref): Adjust. (print_token, yyerror, ensure_not_void): Adjust. tree1.c (in_fname): Remove. (treelang_init): Setup input_location. (lookup_tree_name): Adjust. (insert_tree_name): Adjust. * treetree.c (tree_code_if_start): Replace filename and lineno parms with loc. Adjust. (tree_code_if_else, tree_code_if_end, tree_code_create_function_prototype, tree_code_create_function_initial, tree_code_create_function_wrapup, tree_code_create_variable, tree_code_output_expression_statement): Likewise. * treetree.h (tree_code_if_start): Replace filename and lineno parms with loc. (tree_code_if_else, tree_code_if_end, tree_code_create_function_prototype, tree_code_create_function_initial, tree_code_create_function_wrapup, tree_code_create_variable, tree_code_output_expression_statement): Likewise. From-SVN: r66519
Diffstat (limited to 'gcc/treelang/tree1.c')
-rw-r--r--gcc/treelang/tree1.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/gcc/treelang/tree1.c b/gcc/treelang/tree1.c
index ad5622a..3a6681a 100644
--- a/gcc/treelang/tree1.c
+++ b/gcc/treelang/tree1.c
@@ -78,8 +78,6 @@ unsigned int option_lexer_trace = 0;
/* Local variables. */
-const char *in_fname; /* Input file name. */
-
/* This is 1 if we have output the version string. */
static int version_done = 0;
@@ -187,9 +185,7 @@ treelang_decode_option (num_options_left, first_option_left)
bool
treelang_init ()
{
- in_fname = main_input_filename;
-
- /* Set up the declarations needed for this front end. */
+ input_filename = main_input_filename;
input_line = 0;
/* Init decls etc. */
@@ -198,7 +194,7 @@ treelang_init ()
/* This error will not happen from GCC as it will always create a
fake input file. */
- if (!in_fname || in_fname[0] == ' ' || !in_fname[0])
+ if (!input_filename || input_filename[0] == ' ' || !input_filename[0])
{
if (!version_done)
{
@@ -209,10 +205,10 @@ treelang_init ()
return false;
}
- yyin = fopen (in_fname, "r");
+ yyin = fopen (input_filename, "r");
if (!yyin)
{
- fprintf (stderr, "Unable to open input file %s\n", in_fname);
+ fprintf (stderr, "Unable to open input file %s\n", input_filename);
exit (1);
}
@@ -279,13 +275,16 @@ lookup_tree_name (struct prod_token_parm_item *prod)
if (memcmp (tok->tp.tok.chars, this_tok->tp.tok.chars, this_tok->tp.tok.length))
continue;
if (option_parser_trace)
- fprintf (stderr, "Found symbol %s (%i:%i) as %i \n", tok->tp.tok.chars,
- tok->tp.tok.lineno, tok->tp.tok.charno, NUMERIC_TYPE (this));
+ fprintf (stderr, "Found symbol %s (%i:%i) as %i \n",
+ tok->tp.tok.chars,
+ tok->tp.tok.location.line, tok->tp.tok.charno,
+ NUMERIC_TYPE (this));
return this;
}
if (option_parser_trace)
- fprintf (stderr, "Not found symbol %s (%i:%i) as %i \n", tok->tp.tok.chars,
- tok->tp.tok.lineno, tok->tp.tok.charno, tok->type);
+ fprintf (stderr, "Not found symbol %s (%i:%i) as %i \n",
+ tok->tp.tok.chars,
+ tok->tp.tok.location.line, tok->tp.tok.charno, tok->type);
return NULL;
}
@@ -299,7 +298,8 @@ insert_tree_name (struct prod_token_parm_item *prod)
sanity_check (prod);
if (lookup_tree_name (prod))
{
- fprintf (stderr, "%s:%i:%i duplicate name %s\n", in_fname, tok->tp.tok.lineno,
+ fprintf (stderr, "%s:%i:%i duplicate name %s\n",
+ tok->tp.tok.location.file, tok->tp.tok.location.line,
tok->tp.tok.charno, tok->tp.tok.chars);
errorcount++;
return 1;