Cleanup tree_rest_of_compilation interface

Jan Hubicka jh@suse.cz
Fri Oct 1 12:38:00 GMT 2004


Hi,
this patch kills next to last use of ggc_push_context.  Regtested/bootstrapped
ppc-linux, OK?

Honza
2004-10-01  Jan Hubicka  <jh@suse.cz>
	* c-decl.c (c_expand_body): Update call tree_rest_of_compilation.
	* cgraphunit.c (cgraph_build_static_cdtor): Likewise.
	* toplev.h (tree_rest_of_compilation): Update prototype.
	* tree-optimize.c (tree_rest_of_compilation):  Kill nested_p argument.

	* misc.c (gnat_expand_body): Update call of tree_rest_of_compilation.

	* semantics.c (expand_body): Update call of tree_rest_of_compilation.

	* f95-lang.c (gfc_expand_function): Update call of
	tree_rest_of_compilation.
	* trans-decl.c (gfc_generate_constructors): Likewise.

	* java.c (java_expand_body): Update call of tree_rest_of_compilation.

	* treetree.c (treeland_expand_function): Update call of
	tree_rest_of_compilation.
Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.592
diff -c -3 -p -r1.592 c-decl.c
*** c-decl.c	30 Sep 2004 00:09:42 -0000	1.592
--- c-decl.c	30 Sep 2004 21:13:51 -0000
*************** c_expand_body (tree fndecl)
*** 6324,6330 ****
        || DECL_INITIAL (fndecl) == error_mark_node)
      return;
  
!   tree_rest_of_compilation (fndecl, false);
  
    if (DECL_STATIC_CONSTRUCTOR (fndecl)
        && targetm.have_ctors_dtors)
--- 6324,6330 ----
        || DECL_INITIAL (fndecl) == error_mark_node)
      return;
  
!   tree_rest_of_compilation (fndecl);
  
    if (DECL_STATIC_CONSTRUCTOR (fndecl)
        && targetm.have_ctors_dtors)
Index: cgraphunit.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraphunit.c,v
retrieving revision 1.85
diff -c -3 -p -r1.85 cgraphunit.c
*** cgraphunit.c	26 Sep 2004 19:53:10 -0000	1.85
--- cgraphunit.c	30 Sep 2004 21:13:52 -0000
*************** cgraph_build_static_cdtor (char which, t
*** 2923,2929 ****
  
    /* ??? We will get called LATE in the compilation process.  */
    if (cgraph_global_info_ready)
!     tree_rest_of_compilation (decl, false);
    else
      cgraph_finalize_function (decl, 0);
    
--- 2923,2929 ----
  
    /* ??? We will get called LATE in the compilation process.  */
    if (cgraph_global_info_ready)
!     tree_rest_of_compilation (decl);
    else
      cgraph_finalize_function (decl, 0);
    
Index: toplev.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.h,v
retrieving revision 1.129
diff -c -3 -p -r1.129 toplev.h
*** toplev.h	6 Sep 2004 10:07:56 -0000	1.129
--- toplev.h	30 Sep 2004 21:13:53 -0000
*************** extern void inform (const char *, ...) A
*** 76,82 ****
  extern void rest_of_decl_compilation (tree, int, int);
  extern void rest_of_type_compilation (tree, int);
  extern void rest_of_compilation (void);
! extern void tree_rest_of_compilation (tree, bool);
  extern void init_tree_optimization_passes (void);
  extern void finish_optimization_passes (void);
  extern bool enable_rtl_dump_file (int);
--- 76,82 ----
  extern void rest_of_decl_compilation (tree, int, int);
  extern void rest_of_type_compilation (tree, int);
  extern void rest_of_compilation (void);
! extern void tree_rest_of_compilation (tree);
  extern void init_tree_optimization_passes (void);
  extern void finish_optimization_passes (void);
  extern bool enable_rtl_dump_file (int);
Index: tree-optimize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-optimize.c,v
retrieving revision 2.53
diff -c -3 -p -r2.53 tree-optimize.c
*** tree-optimize.c	29 Sep 2004 09:47:39 -0000	2.53
--- tree-optimize.c	30 Sep 2004 21:13:53 -0000
*************** update_inlined_to_pointers (struct cgrap
*** 566,572 ****
     compilation for FNDECL.  */
  
  void
! tree_rest_of_compilation (tree fndecl, bool nested_p)
  {
    location_t saved_loc;
    struct cgraph_node *saved_node = NULL, *node;
--- 566,572 ----
     compilation for FNDECL.  */
  
  void
! tree_rest_of_compilation (tree fndecl)
  {
    location_t saved_loc;
    struct cgraph_node *saved_node = NULL, *node;
*************** tree_rest_of_compilation (tree fndecl, b
*** 630,640 ****
    if (!vars_to_rename)
      vars_to_rename = BITMAP_XMALLOC ();
  
-   /* If this is a nested function, protect the local variables in the stack
-      above us from being collected while we're compiling this function.  */
-   if (nested_p)
-     ggc_push_context ();
- 
    /* Perform all tree transforms and optimizations.  */
    execute_pass_list (all_passes);
  
--- 630,635 ----
*************** tree_rest_of_compilation (tree fndecl, b
*** 690,696 ****
  	}
      }
  
!   if (!nested_p && !flag_inline_trees)
      {
        DECL_SAVED_TREE (fndecl) = NULL;
        if (DECL_STRUCT_FUNCTION (fndecl) == 0
--- 685,691 ----
  	}
      }
  
!   if (!flag_inline_trees)
      {
        DECL_SAVED_TREE (fndecl) = NULL;
        if (DECL_STRUCT_FUNCTION (fndecl) == 0
*************** tree_rest_of_compilation (tree fndecl, b
*** 709,717 ****
    input_location = saved_loc;
  
    ggc_collect ();
- 
-   /* Undo the GC context switch.  */
-   if (nested_p)
-     ggc_pop_context ();
    timevar_pop (TV_EXPAND);
  }
--- 704,708 ----
Index: ada/misc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/misc.c,v
retrieving revision 1.91
diff -c -3 -p -r1.91 misc.c
*** ada/misc.c	17 Sep 2004 21:54:48 -0000	1.91
--- ada/misc.c	30 Sep 2004 21:13:53 -0000
*************** gnat_expand_body (tree gnu_decl)
*** 649,655 ****
    if (!DECL_INITIAL (gnu_decl) || DECL_INITIAL (gnu_decl) == error_mark_node)
      return;
  
!   tree_rest_of_compilation (gnu_decl, false);
  }
  
  /* Adjusts the RLI used to layout a record after all the fields have been
--- 649,655 ----
    if (!DECL_INITIAL (gnu_decl) || DECL_INITIAL (gnu_decl) == error_mark_node)
      return;
  
!   tree_rest_of_compilation (gnu_decl);
  }
  
  /* Adjusts the RLI used to layout a record after all the fields have been
Index: cp/semantics.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/semantics.c,v
retrieving revision 1.440
diff -c -3 -p -r1.440 semantics.c
*** cp/semantics.c	27 Sep 2004 18:47:29 -0000	1.440
--- cp/semantics.c	30 Sep 2004 21:13:54 -0000
*************** expand_body (tree fn)
*** 2892,2898 ****
       generating trees for a function.  */
    gcc_assert (function_depth == 0);
  
!   tree_rest_of_compilation (fn, 0);
  
    current_function_decl = saved_function;
  
--- 2892,2898 ----
       generating trees for a function.  */
    gcc_assert (function_depth == 0);
  
!   tree_rest_of_compilation (fn);
  
    current_function_decl = saved_function;
  
Index: fortran/f95-lang.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/f95-lang.c,v
retrieving revision 1.22
diff -c -3 -p -r1.22 f95-lang.c
*** fortran/f95-lang.c	17 Sep 2004 21:54:57 -0000	1.22
--- fortran/f95-lang.c	30 Sep 2004 21:13:54 -0000
*************** tree *ridpointers = NULL;
*** 196,202 ****
  static void
  gfc_expand_function (tree fndecl)
  {
!   tree_rest_of_compilation (fndecl, 0);
  }
  
  
--- 196,202 ----
  static void
  gfc_expand_function (tree fndecl)
  {
!   tree_rest_of_compilation (fndecl);
  }
  
  
Index: fortran/trans-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-decl.c,v
retrieving revision 1.44
diff -c -3 -p -r1.44 trans-decl.c
*** fortran/trans-decl.c	20 Sep 2004 20:38:29 -0000	1.44
--- fortran/trans-decl.c	30 Sep 2004 21:13:54 -0000
*************** gfc_generate_constructors (void)
*** 2353,2359 ****
    free_after_parsing (cfun);
    free_after_compilation (cfun);
  
!   tree_rest_of_compilation (fndecl, 0);
  
    current_function_decl = NULL_TREE;
  #endif
--- 2353,2359 ----
    free_after_parsing (cfun);
    free_after_compilation (cfun);
  
!   tree_rest_of_compilation (fndecl);
  
    current_function_decl = NULL_TREE;
  #endif
Index: java/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/decl.c,v
retrieving revision 1.199
diff -c -3 -p -r1.199 decl.c
*** java/decl.c	30 Sep 2004 02:16:45 -0000	1.199
--- java/decl.c	30 Sep 2004 21:13:54 -0000
*************** finish_method (tree fndecl)
*** 1970,1976 ****
  void
  java_expand_body (tree fndecl)
  {
!   tree_rest_of_compilation (fndecl, 0);
  }
  
  /* We pessimistically marked all methods and fields external until we
--- 1970,1976 ----
  void
  java_expand_body (tree fndecl)
  {
!   tree_rest_of_compilation (fndecl);
  }
  
  /* We pessimistically marked all methods and fields external until we
Index: treelang/treetree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/treelang/treetree.c,v
retrieving revision 1.45
diff -c -3 -p -r1.45 treetree.c
*** treelang/treetree.c	17 Sep 2004 21:55:02 -0000	1.45
--- treelang/treetree.c	30 Sep 2004 21:13:55 -0000
*************** static void
*** 1278,1284 ****
  treelang_expand_function (tree fndecl)
  {
    /* We have nothing special to do while expanding functions for treelang.  */
!   tree_rest_of_compilation (fndecl, 0);
  }
  
  #include "debug.h" /* for debug_hooks, needed by gt-treelang-treetree.h */
--- 1278,1284 ----
  treelang_expand_function (tree fndecl)
  {
    /* We have nothing special to do while expanding functions for treelang.  */
!   tree_rest_of_compilation (fndecl);
  }
  
  #include "debug.h" /* for debug_hooks, needed by gt-treelang-treetree.h */



More information about the Gcc-patches mailing list