This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Remove fold-const.h as a dependency for gimple.h


I proposed including fold-const.h into gimple.h, but didn't notice that its actually only needed by one inline function. Moving that function to gimple.c means its no longer required.

160 places need cgraph.h, so by removing this dependency, the number of those files which still need fold-const.h drops to 108 uses. The other 2 files are generally used by many of the files which include gimple.h, so trying to break those dependencies doesn't accomplish much.

This patch is currently undergoing testing, but expect no problems . Assuming it bootstraps on x86_64-unknown-linux-gnu with no new regressions, OK for trunk?

Andrew
	* gimple.h (gimple_call_set_fn): Move inline function.
	* gimple.c (gimple_call_set_fn): Relocate here.

Index: gimple.h
===================================================================
*** gimple.h	(revision 224985)
--- gimple.h	(working copy)
*************** extern gimple currently_expanding_gimple
*** 1296,1301 ****
--- 1296,1302 ----
  #define gimple_alloc(c, n) gimple_alloc_stat (c, n MEM_STAT_INFO)
  gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL);
  greturn *gimple_build_return (tree);
+ void gimple_call_set_fndecl (gimple, tree);
  void gimple_call_reset_alias_info (gcall *);
  gcall *gimple_build_call_vec (tree, vec<tree> );
  gcall *gimple_build_call (tree, unsigned, ...);
*************** gimple_call_set_fn (gcall *gs, tree fn)
*** 2759,2775 ****
  }
  
  
- /* Set FNDECL to be the function called by call statement GS.  */
- 
- static inline void
- gimple_call_set_fndecl (gimple gs, tree decl)
- {
-   GIMPLE_CHECK (gs, GIMPLE_CALL);
-   gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
-   gimple_set_op (gs, 1, build_fold_addr_expr_loc (gimple_location (gs), decl));
- }
- 
- 
  /* Set internal function FN to be the function called by call statement CALL_STMT.  */
  
  static inline void
--- 2760,2765 ----
Index: gimple.c
===================================================================
*** gimple.c	(revision 224986)
--- gimple.c	(working copy)
*************** gimple_build_return (tree retval)
*** 199,204 ****
--- 199,214 ----
    return s;
  }
  
+ /* Set FNDECL to be the function called by call statement GS.  */
+ 
+ void
+ gimple_call_set_fndecl (gimple gs, tree decl)
+ {
+   GIMPLE_CHECK (gs, GIMPLE_CALL);
+   gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
+   gimple_set_op (gs, 1, build_fold_addr_expr_loc (gimple_location (gs), decl));
+ }
+ 
  /* Reset alias information on call S.  */
  
  void

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]