toplev.c (push_srcloc): Simplify behavior to save current location and set current...
authorPer Bothner <pbothner@apple.com>
Thu, 5 Jun 2003 21:07:08 +0000 (21:07 +0000)
committerPer Bothner <bothner@gcc.gnu.org>
Thu, 5 Jun 2003 21:07:08 +0000 (14:07 -0700)
* 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
gcc/toplev.c

index a332e9cb5f31ed1ca77f6dccab8a20d2fb4878fe..a47ffc7e326d0c2a53b87c1e12efcef9ed26785c 100644 (file)
@@ -1,3 +1,10 @@
+2003-06-05  Per Bothner  <pbothner@apple.com>
+
+       * 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  <rth@redhat.com>
 
        * dwarf2out.c (loc_descriptor_from_tree): Return 0 for 
index 5f6ea8c1aea9ed5eeba52cc390e5500aebb0b92c..f005f0418ff933c3156fab64e47f67df931e404f 100644 (file)
@@ -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);