function.h (free_after_compilation): Remove decl parameter.
authorMark Mitchell <mark@codesourcery.com>
Thu, 9 Sep 1999 18:55:37 +0000 (18:55 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Thu, 9 Sep 1999 18:55:37 +0000 (18:55 +0000)
* function.h (free_after_compilation): Remove decl parameter.
(free_varasm_status0: Likewise.
(free_emit_status): Likewise.
(free_stmt_status): Likewise.
(free_after_compilation): Likewise.
(init_lang_status): New variable.
(free_lang_status): Likewise.
* emit-rtl.c (free_emit_status): Make decl parameter implicit.
* function.c (init_lang_status): New variable.
(free_lang_status): Likewise.
(push_function_context_to): Don't set function::decl here.
(free_after_copmilation): Make decl parameter implicit.  Call
free_lang_status if defined.
(prepare_function_start): Call init_lang_status if defined.
(init_function_start): Set function::decl here.
* profile.c (output_func_start_profiler): Don't call pushdecl
until we've actually started the function.
* stmt.c (free_stmt_status): Make decl parameter implicit.
* toplev.c (rest_of_compilation): Don't pass decl to
free_after_compilation.
* varasm.c (free_varasm_status): Likewise.

From-SVN: r29239

gcc/ChangeLog
gcc/emit-rtl.c
gcc/function.c
gcc/function.h
gcc/profile.c
gcc/stmt.c
gcc/toplev.c
gcc/varasm.c

index 87f8f7afb4092a81b8a8e6d49552a8ee94e5f6ef..5e26b572a7e0ac570363153a9483975201befdd8 100644 (file)
@@ -1,3 +1,27 @@
+Thu Sep  9 09:40:58 1999  Mark Mitchell  <mark@codesourcery.com>
+
+       * function.h (free_after_compilation): Remove decl parameter.
+       (free_varasm_status0: Likewise.
+       (free_emit_status): Likewise.
+       (free_stmt_status): Likewise.
+       (free_after_compilation): Likewise.
+       (init_lang_status): New variable.
+       (free_lang_status): Likewise.
+       * emit-rtl.c (free_emit_status): Make decl parameter implicit.
+       * function.c (init_lang_status): New variable.
+       (free_lang_status): Likewise.
+       (push_function_context_to): Don't set function::decl here.
+       (free_after_copmilation): Make decl parameter implicit.  Call
+       free_lang_status if defined. 
+       (prepare_function_start): Call init_lang_status if defined.
+       (init_function_start): Set function::decl here.
+       * profile.c (output_func_start_profiler): Don't call pushdecl
+       until we've actually started the function.
+       * stmt.c (free_stmt_status): Make decl parameter implicit.
+       * toplev.c (rest_of_compilation): Don't pass decl to
+       free_after_compilation.
+       * varasm.c (free_varasm_status): Likewise.
+       
 Thu Sep  9 17:23:19 1999  Bernd Schmidt  <bernds@cygnus.co.uk>
 
        * except.c (call_get_eh_context): Add root when allocating static
index 9837b6811b0d3b3b2acf769e25f3d104aa38ca4c..e7150c296ab52931d1722aa00f54eccccdf5861f 100644 (file)
@@ -1609,15 +1609,13 @@ restore_emit_status (p)
 
 /* Clear out all parts of the state in F that can safely be discarded
    after the function has been compiled, to let garbage collection
-   reclaim the memory.  D is the declaration for the function just
-   compiled.  Its output may have been deferred.  */
+   reclaim the memory.  */
 
 void
-free_emit_status (f, d)
+free_emit_status (f)
      struct function *f;
-     tree d;
 {
-  if (DECL_DEFER_OUTPUT (d))
+  if (DECL_DEFER_OUTPUT (f->decl))
     return;
 
   free (f->emit->x_regno_reg_rtx);
index 3f14350b8add3f6fb0181494fc00c9e39618ba1c..b6e4f87b20325c82f7621b06e6af8bdac5b2b089 100644 (file)
@@ -124,9 +124,11 @@ void (*restore_machine_status) PROTO((struct function *));
 void (*mark_machine_status) PROTO((struct function *));
 
 /* Likewise, but for language-specific data.  */
+void (*init_lang_status) PROTO((struct function *));
 void (*save_lang_status) PROTO((struct function *));
 void (*restore_lang_status) PROTO((struct function *));
 void (*mark_lang_status) PROTO((struct function *));
+void (*free_lang_status) PROTO((struct function *));
 
 /* The FUNCTION_DECL for an inline function currently being expanded.  */
 tree inline_function_decl;
@@ -323,7 +325,6 @@ push_function_context_to (context)
 
   p->next = outer_function_chain;
   outer_function_chain = p;
-  p->decl = current_function_decl;
   p->fixup_var_refs_queue = 0;
 
   save_tree_status (p);
@@ -390,19 +391,19 @@ pop_function_context ()
 
 /* Clear out all parts of the state in F that can safely be discarded
    after the function has been compiled, to let garbage collection
-   reclaim the memory.  D is the declaration for the function just
-   compiled.  Its output may have been deferred.  */
+   reclaim the memory.  */
 
 void
-free_after_compilation (f, d)
+free_after_compilation (f)
      struct function *f;
-     tree d;
 {
-  free_emit_status (f, d);
-  free_varasm_status (f, d);
-  free_stmt_status (f, d);
+  free_emit_status (f);
+  free_varasm_status (f);
+  free_stmt_status (f);
+  if (free_lang_status)
+    (*free_lang_status) (f);
 
-  if (!DECL_DEFER_OUTPUT (d))
+  if (!DECL_DEFER_OUTPUT (f->decl))
     {
       free (f->x_parm_reg_stack_loc);
       f->can_garbage_collect = 1;
@@ -5621,6 +5622,8 @@ prepare_function_start ()
 
   current_function_outgoing_args_size = 0;
 
+  if (init_lang_status)
+    (*init_lang_status) (current_function);
   if (init_machine_status)
     (*init_machine_status) (current_function);
 }
@@ -5651,6 +5654,7 @@ init_function_start (subr, filename, line)
   all_functions = current_function;
   
   current_function_name = (*decl_printable_name) (subr, 2);
+  current_function->decl = subr;
 
   /* Nonzero if this is a nested function that uses a static chain.  */
 
index 76ee362734d490fcdecbcb6b5a8e6874fb3249a4..789fdbf164716378c2c49005818702144f5c51b2 100644 (file)
@@ -541,24 +541,22 @@ extern void (*save_machine_status)        PROTO((struct function *));
 extern void (*restore_machine_status)  PROTO((struct function *));
 
 /* Likewise, but for language-specific data.  */
+extern void (*init_lang_status)         PROTO((struct function *));
 extern void (*mark_lang_status)                PROTO((struct function *));
 extern void (*save_lang_status)                PROTO((struct function *));
 extern void (*restore_lang_status)     PROTO((struct function *));
+extern void (*free_lang_status)         PROTO((struct function *));
 
 /* Save and restore status information for a nested function.  */
 extern void save_tree_status           PROTO((struct function *));
 extern void restore_tree_status                PROTO((struct function *));
 extern void restore_emit_status                PROTO((struct function *));
-extern void free_after_compilation     PROTO((struct function *,
-                                              tree));
+extern void free_after_compilation     PROTO((struct function *));
 
 extern void init_varasm_status         PROTO((struct function *));
-extern void free_varasm_status         PROTO((struct function *,
-                                              tree));
-extern void free_emit_status           PROTO((struct function *,
-                                              tree));
-extern void free_stmt_status            PROTO((struct function *,
-                                              tree));
+extern void free_varasm_status         PROTO((struct function *));
+extern void free_emit_status           PROTO((struct function *));
+extern void free_stmt_status            PROTO((struct function *));
 extern rtx get_first_block_beg         PROTO((void));
 
 extern void init_virtual_regs          PROTO((struct emit_status *));
index e2b54fbef16b11986fd52715b4c7e29c8506e0f1..871f55789cd2a9bfd2c6e98f5809b1ea9ed6769d 100644 (file)
@@ -1672,9 +1672,9 @@ output_func_start_profiler ()
   current_function_decl = fndecl;
   DECL_INITIAL (fndecl) = error_mark_node;
   temporary_allocation ();
-  pushlevel (0);
   make_function_rtl (fndecl);
   init_function_start (fndecl, input_filename, lineno);
+  pushlevel (0);
   expand_function_start (fndecl, 0);
 
   /* Actually generate the code to call __bb_init_func. */
index aef2b70ef2e5b65be24ca3530ddee952543202bc..ad45fddcc334c17240200f780c216ec00c2fbd97 100644 (file)
@@ -552,13 +552,11 @@ mark_goto_fixup (g)
 
 /* Clear out all parts of the state in F that can safely be discarded
    after the function has been compiled, to let garbage collection
-   reclaim the memory.  D is the declaration for the function just
-   compiled.  Its output may have been deferred.  */
+   reclaim the memory.  */
 
 void
-free_stmt_status (f, d)
+free_stmt_status (f)
      struct function *f;
-     tree d ATTRIBUTE_UNUSED;
 {
   /* We're about to free the function obstack.  If we hold pointers to
      things allocated there, then we'll try to mark them when we do
index 483db339a0c18a7c71aef26fa98713264f2dbbb1..29c4a3c1e689ebd94e7a9582f5b73cd26029cc1a 100644 (file)
@@ -4469,7 +4469,7 @@ rest_of_compilation (decl)
   init_recog_no_volatile ();
 
   /* We're done with this function.  Free up memory if we can.  */
-  free_after_compilation (current_function, decl);
+  free_after_compilation (current_function);
 
   current_function = 0;
 
index 887fc787c3421c69b0e645e8ddb8ce1de965d11a..b3817ccd09e066eac12d8564fb42faf573cea1dd 100644 (file)
@@ -3235,17 +3235,15 @@ mark_varasm_state (p)
 
 /* Clear out all parts of the state in F that can safely be discarded
    after the function has been compiled, to let garbage collection
-   reclaim the memory.  D is the declaration for the function just
-   compiled.  Its output may have been deferred.  */
+   reclaim the memory.  */
 
 void
-free_varasm_status (f, d)
+free_varasm_status (f)
      struct function *f;
-     tree d;
 {
   struct varasm_status *p;
 
-  if (DECL_DEFER_OUTPUT (d))
+  if (DECL_DEFER_OUTPUT (f->decl))
     return;
 
   p = f->varasm;