diff mbox

Remove fold-const.h as a dependency for gimple.h

Message ID 558D92E5.1090907@redhat.com
State New
Headers show

Commit Message

Andrew MacLeod June 26, 2015, 5:59 p.m. UTC
On 06/26/2015 05:40 AM, Richard Biener wrote:
> On Thu, Jun 25, 2015 at 10:57 PM, Jeff Law <law@redhat.com> wrote:
>> On 06/25/2015 02:31 PM, Andrew MacLeod wrote:
>>> 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.
>>>
>> OK.
> Well, it's also just lazy in using build_fold_addr_expr_loc because it
> doesn't want to spell out the all-tree.h
>
>     build1_loc (gimple_location (gs), ADDR_EXPR, build_pointer_type
> (decl), decl);
>
> there is nothing to be simplified (setting a location here is also a waste).
>
> Richard.
>
>
Easy enough... how about this for trunk?

bootstraps on x86_64-unknown-linux-gnu with no new regressions.
Andrew

Comments

Jeff Law June 26, 2015, 10:38 p.m. UTC | #1
On 06/26/2015 11:59 AM, Andrew MacLeod wrote:
> On 06/26/2015 05:40 AM, Richard Biener wrote:
>> On Thu, Jun 25, 2015 at 10:57 PM, Jeff Law <law@redhat.com> wrote:
>>> On 06/25/2015 02:31 PM, Andrew MacLeod wrote:
>>>> 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.
>>>>
>>> OK.
>> Well, it's also just lazy in using build_fold_addr_expr_loc because it
>> doesn't want to spell out the all-tree.h
>>
>>     build1_loc (gimple_location (gs), ADDR_EXPR, build_pointer_type
>> (decl), decl);
>>
>> there is nothing to be simplified (setting a location here is also a
>> waste).
>>
>> Richard.
>>
>>
> Easy enough... how about this for trunk?
>
> bootstraps on x86_64-unknown-linux-gnu with no new regressions.
> Andrew
OK.
jeff
diff mbox

Patch

2015-06-26  Andrew MacLeod  <amacleod@redhat.com>

	* gimple.c (gimple_call_set_fndecl): Remove.
	* gimple.h (gimple_call_set_fndecl): Relocate to gimple.h and call
	build1_loc directly instead of build_fold_addr_expr_loc.

Index: gimple.c
===================================================================
*** gimple.c	(revision 225011)
--- gimple.c	(working copy)
*************** gimple_build_return (tree retval)
*** 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
--- 199,204 ----
Index: gimple.h
===================================================================
*** gimple.h	(revision 225011)
--- gimple.h	(working copy)
*************** extern gimple currently_expanding_gimple
*** 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, ...);
--- 1296,1301 ----
*************** gimple_call_set_fn (gcall *gs, tree fn)
*** 2760,2765 ****
--- 2759,2777 ----
  }
  
  
+ /* 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, build1_loc (gimple_location (gs), ADDR_EXPR,
+ 				     build_pointer_type (TREE_TYPE (decl)),
+ 				     decl));
+ }
+ 
+ 
  /* Set internal function FN to be the function called by call statement CALL_STMT.  */
  
  static inline void