Commit 8c5666b4 by Bernd Schmidt Committed by Mark Mitchell

function.h (struct function): Add new element LANGUAGE.

 	* 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.

From-SVN: r29095
parent 0c174a68
No preview for this file type
...@@ -120,6 +120,10 @@ static int virtuals_instantiated; ...@@ -120,6 +120,10 @@ static int virtuals_instantiated;
void (*save_machine_status) PROTO((struct function *)); void (*save_machine_status) PROTO((struct function *));
void (*restore_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. */ /* The FUNCTION_DECL for an inline function currently being expanded. */
tree inline_function_decl; tree inline_function_decl;
...@@ -287,9 +291,10 @@ find_function_data (decl) ...@@ -287,9 +291,10 @@ find_function_data (decl)
} }
/* Save the current context for compilation of a nested function. /* Save the current context for compilation of a nested function.
This is called from language-specific code. This is called from language-specific code. The caller should use
The caller is responsible for saving any language-specific status, the save_lang_status callback to save any language-specific state,
since this function knows only about language-independent variables. */ since this function knows only about language-independent
variables. */
void void
push_function_context_to (context) push_function_context_to (context)
...@@ -308,6 +313,8 @@ push_function_context_to (context) ...@@ -308,6 +313,8 @@ push_function_context_to (context)
save_tree_status (p, context); save_tree_status (p, context);
save_varasm_status (p, context); save_varasm_status (p, context);
if (save_lang_status)
(*save_lang_status) (p);
if (save_machine_status) if (save_machine_status)
(*save_machine_status) (p); (*save_machine_status) (p);
...@@ -344,6 +351,8 @@ pop_function_context_from (context) ...@@ -344,6 +351,8 @@ pop_function_context_from (context)
if (restore_machine_status) if (restore_machine_status)
(*restore_machine_status) (p); (*restore_machine_status) (p);
if (restore_lang_status)
(*restore_lang_status) (p);
/* Finish doing put_var_into_stack for any of our variables /* Finish doing put_var_into_stack for any of our variables
which became addressable during the nested function. */ which became addressable during the nested function. */
......
...@@ -440,6 +440,9 @@ struct function ...@@ -440,6 +440,9 @@ struct function
/* tm.h can use this to store whatever it likes. */ /* tm.h can use this to store whatever it likes. */
struct machine_function *machine; struct machine_function *machine;
/* Language-specific code can use this to store whatever it likes. */
struct language_function *language;
/* For reorg. */ /* For reorg. */
/* If some insns can be deferred to the delay slots of the epilogue, the /* 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 *)); ...@@ -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 (*save_machine_status) PROTO((struct function *));
extern void (*restore_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. */ /* Save and restore status information for a nested function. */
extern void save_tree_status PROTO((struct function *, tree)); extern void save_tree_status PROTO((struct function *, tree));
extern void restore_tree_status PROTO((struct function *, tree)); extern void restore_tree_status PROTO((struct function *, tree));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment