diff options
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/function.c | 15 | ||||
-rw-r--r-- | gcc/function.h | 7 |
3 files changed, 29 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d0e19edf1d8..4e7eb169c5b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +Fri Sep 3 19:02:38 1999 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de> + + * function.h (struct function): Add new element LANGUAGE. + (save_lang_status): Declare new variable. + (restore_lang_status): Likewise. + * function.c (save_lang_status): Define. + (restore_lang_status): Likewise. + (push_function_context_to): Call language-specific save function. + (pop_function_context_from): Call language-specific restore function. + Fri Sep 3 01:16:18 1999 Alasdair Baird <alasdair@wildcat.demon.co.uk> * i386.md (movsf_1): Check REG_P before use of REGNO. diff --git a/gcc/function.c b/gcc/function.c index 6fb5368a3a3..c86792164eb 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -120,6 +120,10 @@ static int virtuals_instantiated; void (*save_machine_status) PROTO((struct function *)); void (*restore_machine_status) PROTO((struct function *)); +/* Likewise, but for language-specific data. */ +void (*save_lang_status) PROTO((struct function *)); +void (*restore_lang_status) PROTO((struct function *)); + /* The FUNCTION_DECL for an inline function currently being expanded. */ tree inline_function_decl; @@ -287,9 +291,10 @@ find_function_data (decl) } /* Save the current context for compilation of a nested function. - This is called from language-specific code. - The caller is responsible for saving any language-specific status, - since this function knows only about language-independent variables. */ + This is called from language-specific code. The caller should use + the save_lang_status callback to save any language-specific state, + since this function knows only about language-independent + variables. */ void push_function_context_to (context) @@ -308,6 +313,8 @@ push_function_context_to (context) save_tree_status (p, context); save_varasm_status (p, context); + if (save_lang_status) + (*save_lang_status) (p); if (save_machine_status) (*save_machine_status) (p); @@ -344,6 +351,8 @@ pop_function_context_from (context) if (restore_machine_status) (*restore_machine_status) (p); + if (restore_lang_status) + (*restore_lang_status) (p); /* Finish doing put_var_into_stack for any of our variables which became addressable during the nested function. */ diff --git a/gcc/function.h b/gcc/function.h index 86d2c3cf9f0..9a9156ae2a8 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -440,6 +440,9 @@ struct function /* tm.h can use this to store whatever it likes. */ struct machine_function *machine; + /* Language-specific code can use this to store whatever it likes. */ + struct language_function *language; + /* For reorg. */ /* If some insns can be deferred to the delay slots of the epilogue, the @@ -541,6 +544,10 @@ extern HOST_WIDE_INT get_func_frame_size PROTO((struct function *)); extern void (*save_machine_status) PROTO((struct function *)); extern void (*restore_machine_status) PROTO((struct function *)); +/* Likewise, but for language-specific data. */ +extern void (*save_lang_status) PROTO((struct function *)); +extern void (*restore_lang_status) PROTO((struct function *)); + /* Save and restore status information for a nested function. */ extern void save_tree_status PROTO((struct function *, tree)); extern void restore_tree_status PROTO((struct function *, tree)); |