diff mbox

More tree-flow.h prototypes.

Message ID 524B3820.9070702@redhat.com
State New
Headers show

Commit Message

Andrew MacLeod Oct. 1, 2013, 9:01 p.m. UTC
This patch moves prototypes into gimple-fold.h (which already existed). 
There were a few in tree-flow.h and a bunch in gimple.h. The routines 
are used frequently enough that it makes sense to include gimple-fold.h 
from gimple.h instead of from within each .c file that needs it. 
(presumably why the prototypes were in gimple.h to begin with). I took 
gimple-fold.h out of whatever .c files it was included in.

tree-ssa-copy.h was also created for the prototypes in that file and 
included from tree-ssa.h.

Bootstraps and no new regressions.  OK?

Andrew

Comments

Richard Biener Oct. 2, 2013, 8:37 a.m. UTC | #1
On Tue, Oct 1, 2013 at 11:01 PM, Andrew MacLeod <amacleod@redhat.com> wrote:
> This patch moves prototypes into gimple-fold.h (which already existed).
> There were a few in tree-flow.h and a bunch in gimple.h. The routines are
> used frequently enough that it makes sense to include gimple-fold.h from
> gimple.h instead of from within each .c file that needs it. (presumably why
> the prototypes were in gimple.h to begin with). I took gimple-fold.h out of
> whatever .c files it was included in.
>
> tree-ssa-copy.h was also created for the prototypes in that file and
> included from tree-ssa.h.

These should probably be moved elsewhere (tree-ssa-copy.c is supposed
to be the copy propagation pass file).  But that can be done as followup.

> Bootstraps and no new regressions.  OK?

Ok.

Thanks,
Richard.

> Andrew
Andrew MacLeod Oct. 2, 2013, 11:58 a.m. UTC | #2
On 10/02/2013 04:37 AM, Richard Biener wrote:
> On Tue, Oct 1, 2013 at 11:01 PM, Andrew MacLeod <amacleod@redhat.com> wrote:
>> This patch moves prototypes into gimple-fold.h (which already existed).
>> There were a few in tree-flow.h and a bunch in gimple.h. The routines are
>> used frequently enough that it makes sense to include gimple-fold.h from
>> gimple.h instead of from within each .c file that needs it. (presumably why
>> the prototypes were in gimple.h to begin with). I took gimple-fold.h out of
>> whatever .c files it was included in.
>>
>> tree-ssa-copy.h was also created for the prototypes in that file and
>> included from tree-ssa.h.
> These should probably be moved elsewhere (tree-ssa-copy.c is supposed
> to be the copy propagation pass file).  But that can be done as followup.
>
>
hmm, easy enough to move them *all* to tree-ssa-propagate.[ch] right now 
and check it in...  That seems like the right place for all of them and 
then we don't even need to create tree-ssa-copy.h...?

Andrew
Richard Biener Oct. 2, 2013, 12:59 p.m. UTC | #3
On Wed, Oct 2, 2013 at 1:58 PM, Andrew MacLeod <amacleod@redhat.com> wrote:
> On 10/02/2013 04:37 AM, Richard Biener wrote:
>>
>> On Tue, Oct 1, 2013 at 11:01 PM, Andrew MacLeod <amacleod@redhat.com>
>> wrote:
>>>
>>> This patch moves prototypes into gimple-fold.h (which already existed).
>>> There were a few in tree-flow.h and a bunch in gimple.h. The routines are
>>> used frequently enough that it makes sense to include gimple-fold.h from
>>> gimple.h instead of from within each .c file that needs it. (presumably
>>> why
>>> the prototypes were in gimple.h to begin with). I took gimple-fold.h out
>>> of
>>> whatever .c files it was included in.
>>>
>>> tree-ssa-copy.h was also created for the prototypes in that file and
>>> included from tree-ssa.h.
>>
>> These should probably be moved elsewhere (tree-ssa-copy.c is supposed
>> to be the copy propagation pass file).  But that can be done as followup.
>>
>>
> hmm, easy enough to move them *all* to tree-ssa-propagate.[ch] right now and
> check it in...  That seems like the right place for all of them and then we
> don't even need to create tree-ssa-copy.h...?

Yeah.

Richard.

> Andrew
diff mbox

Patch


	* tree-flow.h: Remove some prototypes.
	* gimple-fold.h: Add prototypes from gimple.h and tree-flow.h.
	* tree-ssa-copy.h: New file.  Relocate prototypes from tree-flow.h.
	* gimple.h: Include gimple-fold.h, move prototypes into gimple-fold.h.
	* tree-ssa.h: Include tree-ssa-copy.h.
	* gimple-fold.c: Remove gimple-fold.h from include list.
	* tree-vrp.c: Remove gimple-fold.h from include list.
	* tree-ssa-sccvn.c: Remove gimple-fold.h from include list.
	* tree-ssa-ccp.c: Remove gimple-fold.h from include list.

Index: tree-flow.h
===================================================================
*** tree-flow.h	(revision 203075)
--- tree-flow.h	(working copy)
*************** void mark_virtual_operands_for_renaming 
*** 297,306 ****
  tree get_current_def (tree);
  void set_current_def (tree, tree);
  
- /* In tree-ssa-ccp.c  */
- tree fold_const_aggregate_ref (tree);
- tree gimple_fold_stmt_to_constant (gimple, tree (*)(tree));
- 
  /* In tree-ssa-dom.c  */
  extern void dump_dominator_optimization_stats (FILE *);
  extern void debug_dominator_optimization_stats (void);
--- 297,302 ----
*************** int loop_depth_of_name (tree);
*** 308,322 ****
  tree degenerate_phi_result (gimple);
  bool simple_iv_increment_p (gimple);
  
- /* In tree-ssa-copy.c  */
- extern void propagate_value (use_operand_p, tree);
- extern void propagate_tree_value (tree *, tree);
- extern void propagate_tree_value_into_stmt (gimple_stmt_iterator *, tree);
- extern void replace_exp (use_operand_p, tree);
- extern bool may_propagate_copy (tree, tree);
- extern bool may_propagate_copy_into_stmt (gimple, tree);
- extern bool may_propagate_copy_into_asm (tree);
- 
  /* In tree-ssa-loop-ch.c  */
  bool do_while_loop_p (struct loop *);
  
--- 304,309 ----
Index: gimple-fold.h
===================================================================
*** gimple-fold.h	(revision 203075)
--- gimple-fold.h	(working copy)
*************** along with GCC; see the file COPYING3.  
*** 22,31 ****
  #ifndef GCC_GIMPLE_FOLD_H
  #define GCC_GIMPLE_FOLD_H
  
! tree fold_const_aggregate_ref_1 (tree, tree (*) (tree));
! tree fold_const_aggregate_ref (tree);
! 
! tree gimple_fold_stmt_to_constant_1 (gimple, tree (*) (tree));
! tree gimple_fold_stmt_to_constant (gimple, tree (*) (tree));
  
  #endif  /* GCC_GIMPLE_FOLD_H */
--- 22,43 ----
  #ifndef GCC_GIMPLE_FOLD_H
  #define GCC_GIMPLE_FOLD_H
  
! extern tree canonicalize_constructor_val (tree, tree);
! extern tree get_symbol_constant_value (tree);
! extern void gimplify_and_update_call_from_tree (gimple_stmt_iterator *, tree);
! extern tree gimple_fold_builtin (gimple);
! extern tree gimple_extract_devirt_binfo_from_cst (tree, tree);
! extern bool fold_stmt (gimple_stmt_iterator *);
! extern bool fold_stmt_inplace (gimple_stmt_iterator *);
! extern tree maybe_fold_and_comparisons (enum tree_code, tree, tree, 
! 					enum tree_code, tree, tree);
! extern tree maybe_fold_or_comparisons (enum tree_code, tree, tree,
! 				       enum tree_code, tree, tree);
! extern tree gimple_fold_stmt_to_constant_1 (gimple, tree (*) (tree));
! extern tree gimple_fold_stmt_to_constant (gimple, tree (*) (tree));
! extern tree fold_const_aggregate_ref_1 (tree, tree (*) (tree));
! extern tree fold_const_aggregate_ref (tree);
! extern tree gimple_get_virt_method_for_binfo (HOST_WIDE_INT, tree);
! extern bool gimple_val_nonnegative_real_p (tree);
  
  #endif  /* GCC_GIMPLE_FOLD_H */
Index: tree-ssa-copy.h
===================================================================
*** tree-ssa-copy.h	(revision 0)
--- tree-ssa-copy.h	(revision 0)
***************
*** 0 ****
--- 1,31 ----
+ /* Header file for copy propagation and SSA_NAME replacement.
+    Copyright (C) 2013 Free Software Foundation, Inc.
+ 
+ This file is part of GCC.
+ 
+ GCC is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 3, or (at your option) any later
+ version.
+ 
+ GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+  for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #ifndef GCC_TREE_SSA_COPY_H
+ #define GCC_TREE_SSA_COPY_H
+ 
+ extern bool may_propagate_copy (tree, tree);
+ extern bool may_propagate_copy_into_stmt (gimple, tree);
+ extern bool may_propagate_copy_into_asm (tree);
+ extern void propagate_value (use_operand_p, tree);
+ extern void replace_exp (use_operand_p, tree);
+ extern void propagate_tree_value (tree *, tree);
+ extern void propagate_tree_value_into_stmt (gimple_stmt_iterator *, tree);
+ 
+ #endif /* GCC_TREE_SSA_COPY_H */
Index: gimple.h
===================================================================
*** gimple.h	(revision 203075)
--- gimple.h	(working copy)
*************** along with GCC; see the file COPYING3.  
*** 30,35 ****
--- 30,36 ----
  #include "tree.h"
  #include "tree-ssa-alias.h"
  #include "internal-fn.h"
+ #include "gimple-fold.h"
  
  typedef gimple gimple_seq_node;
  
*************** unsigned get_gimple_rhs_num_ops (enum tr
*** 833,840 ****
  #define gimple_alloc(c, n) gimple_alloc_stat (c, n MEM_STAT_INFO)
  gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL);
  const char *gimple_decl_printable_name (tree, int);
- tree gimple_get_virt_method_for_binfo (HOST_WIDE_INT, tree);
- tree gimple_extract_devirt_binfo_from_cst (tree, tree);
  
  /* Returns true iff T is a scalar register variable.  */
  extern bool is_gimple_reg (tree);
--- 834,839 ----
*************** gimple_alloc_kind (enum gimple_code code
*** 5421,5441 ****
  
  extern void dump_gimple_statistics (void);
  
- /* In gimple-fold.c.  */
- void gimplify_and_update_call_from_tree (gimple_stmt_iterator *, tree);
- tree gimple_fold_builtin (gimple);
- bool fold_stmt (gimple_stmt_iterator *);
- bool fold_stmt_inplace (gimple_stmt_iterator *);
- tree get_symbol_constant_value (tree);
- tree canonicalize_constructor_val (tree, tree);
- extern tree maybe_fold_and_comparisons (enum tree_code, tree, tree, 
- 					enum tree_code, tree, tree);
- extern tree maybe_fold_or_comparisons (enum tree_code, tree, tree,
- 				       enum tree_code, tree, tree);
- 
- bool gimple_val_nonnegative_real_p (tree);
- 
- 
  /* Set the location of all statements in SEQ to LOC.  */
  
  static inline void
--- 5420,5425 ----
Index: tree-ssa.h
===================================================================
*** tree-ssa.h	(revision 203075)
--- tree-ssa.h	(working copy)
*************** along with GCC; see the file COPYING3.  
*** 26,31 ****
--- 26,32 ----
  #include "gimple-ssa.h"
  #include "ssa-iterators.h"
  #include "tree-ssanames.h"
+ #include "tree-ssa-copy.h"
  #include "tree-flow.h"
  
  /* Mapping for redirected edges.  */
Index: gimple-fold.c
===================================================================
*** gimple-fold.c	(revision 203075)
--- gimple-fold.c	(working copy)
*************** along with GCC; see the file COPYING3.  
*** 29,35 ****
  #include "tree-ssa.h"
  #include "tree-ssa-propagate.h"
  #include "target.h"
- #include "gimple-fold.h"
  #include "ipa-utils.h"
  #include "gimple-pretty-print.h"
  
--- 29,34 ----
Index: tree-vrp.c
===================================================================
*** tree-vrp.c	(revision 203075)
--- tree-vrp.c	(working copy)
*************** along with GCC; see the file COPYING3.  
*** 37,43 ****
  #include "tree-ssa-propagate.h"
  #include "tree-chrec.h"
  #include "tree-ssa-threadupdate.h"
- #include "gimple-fold.h"
  #include "expr.h"
  #include "optabs.h"
  
--- 37,42 ----
Index: tree-ssa-sccvn.c
===================================================================
*** tree-ssa-sccvn.c	(revision 203075)
--- tree-ssa-sccvn.c	(working copy)
*************** along with GCC; see the file COPYING3.  
*** 37,43 ****
  #include "params.h"
  #include "tree-ssa-propagate.h"
  #include "tree-ssa-sccvn.h"
- #include "gimple-fold.h"
  
  /* This algorithm is based on the SCC algorithm presented by Keith
     Cooper and L. Taylor Simpson in "SCC-Based Value numbering"
--- 37,42 ----
Index: tree-ssa-ccp.c
===================================================================
*** tree-ssa-ccp.c	(revision 203075)
--- tree-ssa-ccp.c	(working copy)
*************** along with GCC; see the file COPYING3.  
*** 127,133 ****
  #include "target.h"
  #include "diagnostic-core.h"
  #include "dbgcnt.h"
- #include "gimple-fold.h"
  #include "params.h"
  #include "hash-table.h"
  
--- 127,132 ----