aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog24
-rw-r--r--gcc/emit-rtl.c8
-rw-r--r--gcc/function.c22
-rw-r--r--gcc/function.h14
-rw-r--r--gcc/profile.c2
-rw-r--r--gcc/stmt.c6
-rw-r--r--gcc/toplev.c2
-rw-r--r--gcc/varasm.c8
8 files changed, 53 insertions, 33 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 87f8f7a..5e26b57 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 9837b68..e7150c2 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -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);
diff --git a/gcc/function.c b/gcc/function.c
index 3f14350..b6e4f87 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -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. */
diff --git a/gcc/function.h b/gcc/function.h
index 76ee362..789fdbf 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -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 *));
diff --git a/gcc/profile.c b/gcc/profile.c
index e2b54fb..871f557 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -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. */
diff --git a/gcc/stmt.c b/gcc/stmt.c
index aef2b70..ad45fdd 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -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
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 483db33..29c4a3c 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -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;
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 887fc78..b3817cc 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -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;