PATCH for save_lang_status/restore_lang_status

Mark Mitchell mark@codesourcery.com
Fri Sep 3 19:18:00 GMT 1999


Here's some more goodness from the GC branch that enables the
C++-specific patch in my next message.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

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.
	
Index: function.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/function.c,v
retrieving revision 1.100
diff -c -p -r1.100 function.c
*** function.c	1999/08/31 19:39:04	1.100
--- function.c	1999/09/04 01:31:02
*************** static int virtuals_instantiated;
*** 120,125 ****
--- 120,129 ----
  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;
  
*************** push_function_context_to (context)
*** 308,313 ****
--- 312,319 ----
  
    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);
  
*************** pop_function_context_from (context)
*** 344,349 ****
--- 350,357 ----
  
    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.  */
Index: function.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/function.h,v
retrieving revision 1.24
diff -c -p -r1.24 function.h
*** function.h	1999/08/29 13:41:23	1.24
--- function.h	1999/09/04 01:31:02
*************** struct function
*** 440,445 ****
--- 440,448 ----
    /* 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
*************** extern HOST_WIDE_INT get_func_frame_size
*** 540,545 ****
--- 543,552 ----
     in push_function_context and pop_function_context.  */
  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));


More information about the Gcc-patches mailing list