[C++] remove unnecesary code from expand_body

Jan Hubicka jh@suse.cz
Wed Apr 18 00:01:00 GMT 2007


Hi,
this patch removes some code I believe is now completely obsoletted by
unit-at-a-time code from C++ expand_body (my goal is to get rid of
expand_body langhook but apparently it is too twisted to do at once)

Bootstrapped/regtested i686-linux, OK?

Honza

	* cp/semantics.c (expand_body): Remove unnecesary code.
Index: cp/semantics.c
===================================================================
*** cp/semantics.c	(revision 123821)
--- cp/semantics.c	(working copy)
*************** emit_associated_thunks (tree fn)
*** 3102,3125 ****
  void
  expand_body (tree fn)
  {
-   tree saved_function;
- 
    /* Compute the appropriate object-file linkage for inline
       functions.  */
    if (DECL_DECLARED_INLINE_P (fn))
      import_export_decl (fn);
  
-   /* If FN is external, then there's no point in generating RTL for
-      it.  This situation can arise with an inline function under
-      `-fexternal-templates'; we instantiate the function, even though
-      we're not planning on emitting it, in case we get a chance to
-      inline it.  */
-   if (DECL_EXTERNAL (fn))
-     return;
- 
-   /* ??? When is this needed?  */
-   saved_function = current_function_decl;
- 
    /* Emit any thunks that should be emitted at the same time as FN.  */
    emit_associated_thunks (fn);
  
--- 3102,3112 ----
*************** expand_body (tree fn)
*** 3129,3156 ****
    gcc_assert (function_depth == 0);
  
    c_expand_body (fn);
- 
-   current_function_decl = saved_function;
- 
-   if (DECL_CLONED_FUNCTION_P (fn))
-     {
-       /* If this is a clone, go through the other clones now and mark
- 	 their parameters used.  We have to do that here, as we don't
- 	 know whether any particular clone will be expanded, and
- 	 therefore cannot pick one arbitrarily.  */
-       tree probe;
- 
-       for (probe = TREE_CHAIN (DECL_CLONED_FUNCTION (fn));
- 	   probe && DECL_CLONED_FUNCTION_P (probe);
- 	   probe = TREE_CHAIN (probe))
- 	{
- 	  tree parms;
- 
- 	  for (parms = DECL_ARGUMENTS (probe);
- 	       parms; parms = TREE_CHAIN (parms))
- 	    TREE_USED (parms) = 1;
- 	}
-     }
  }
  
  /* Generate RTL for FN.  */
--- 3116,3121 ----



More information about the Gcc-patches mailing list