From 640da95344c35708b911ea2fda631fc2eff01986 Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Thu, 5 Jun 2003 21:07:08 +0000 Subject: [PATCH] toplev.c (push_srcloc): Simplify behavior to save current location and set current location to parameters. * toplev.c (push_srcloc): Simplify behavior to save current location and set current location to parameters. (pop_srcloc): Simplify semantics. (lang_dependent_init): Remove now-useless initial push_srcloc. From-SVN: r67512 --- gcc/ChangeLog | 7 +++++++ gcc/toplev.c | 19 +++---------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a332e9cb5f3..a47ffc7e326 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-06-05 Per Bothner + + * toplev.c (push_srcloc): Simplify behavior to save current location + and set current location to parameters. + (pop_srcloc): Simplify semantics. + (lang_dependent_init): Remove now-useless initial push_srcloc. + 2003-05-06 Richard Henderson * dwarf2out.c (loc_descriptor_from_tree): Return 0 for diff --git a/gcc/toplev.c b/gcc/toplev.c index 5f6ea8c1aea..f005f0418ff 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -2170,14 +2170,11 @@ push_srcloc (const char *file, int line) { struct file_stack *fs; - if (input_file_stack) - input_file_stack->location = input_location; - fs = (struct file_stack *) xmalloc (sizeof (struct file_stack)); - input_filename = file; - input_line = line; fs->location = input_location; fs->next = input_file_stack; + input_filename = file; + input_line = line; input_file_stack = fs; input_file_stack_tick++; } @@ -2192,17 +2189,10 @@ pop_srcloc (void) struct file_stack *fs; fs = input_file_stack; + input_location = fs->location; input_file_stack = fs->next; free (fs); input_file_stack_tick++; - - if (input_file_stack) - input_location = input_file_stack->location; - else - { - input_filename = NULL; - input_line = 0; - } } /* Compile an entire translation unit. Write a file of assembly @@ -5651,9 +5641,6 @@ lang_dependent_init (const char *name) init_expr_once (); expand_dummy_function_end (); - /* Put an entry on the input file stack for the main input file. */ - push_srcloc (input_filename, 0); - /* If dbx symbol table desired, initialize writing it and output the predefined types. */ timevar_push (TV_SYMOUT); -- 2.30.2