This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] Rename nondestructive folder
- From: law at redhat dot com
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 27 Feb 2003 11:33:24 -0700
- Subject: [tree-ssa] Rename nondestructive folder
- Reply-to: law at redhat dot com
No change in functionality here. Just renaming a couple functions to be
more clear and updating their header comments appropriately.
* fold-const.c (nondestructive_fold_binary_to_constant): Renamed
from nondestructive_fold_binary. Update comments slightly.
(nondestructive_fold_unary_to_constant): Similarly.
(fold_relational_hi_lo): Corresponding changes.
* tree-ssa-ccp.c (ccp_fold): Corresponding changes.
* tree.h: Corresponding changes.
Index: fold-const.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v
retrieving revision 1.213.2.24
diff -c -3 -p -r1.213.2.24 fold-const.c
*** fold-const.c 26 Feb 2003 20:32:49 -0000 1.213.2.24
--- fold-const.c 27 Feb 2003 18:21:54 -0000
*************** fold_relational_hi_lo (code_p, type_p, o
*** 4988,4997 ****
convert (st0, op0),
convert (st1, integer_zero_node));
! retval = nondestructive_fold_binary (TREE_CODE (exp),
! TREE_TYPE (exp),
! TREE_OPERAND (exp, 0),
! TREE_OPERAND (exp, 1));
return (retval ? retval : exp);
}
}
--- 4988,4998 ----
convert (st0, op0),
convert (st1, integer_zero_node));
! retval
! = nondestructive_fold_binary_to_constant (TREE_CODE (exp),
! TREE_TYPE (exp),
! TREE_OPERAND (exp, 0),
! TREE_OPERAND (exp, 1));
return (retval ? retval : exp);
}
}
*************** fold_relational_hi_lo (code_p, type_p, o
*** 5001,5010 ****
}
/* Given the components of a binary expression CODE, TYPE, OP0 and OP1,
! attempt to fold the expression without modifying TYPE, OP0 or OP1.
! If simplification was possible, return the simplified tree. if
! no simplification is possible return NULL_TREE.
Note this is primarily designed to be called after gimplification
of the tree structures and when at least one operand is a constant.
--- 5002,5013 ----
}
/* Given the components of a binary expression CODE, TYPE, OP0 and OP1,
! attempt to fold the expression to a constant without modifying TYPE,
! OP0 or OP1.
! If the expression could be simplified to a constant, then return
! the constant. If the expression would not be simplified to a
! constant, then return NULL_TREE.
Note this is primarily designed to be called after gimplification
of the tree structures and when at least one operand is a constant.
*************** fold_relational_hi_lo (code_p, type_p, o
*** 5012,5018 ****
simpler than the generic fold routine. */
tree
! nondestructive_fold_binary (code, type, op0, op1)
enum tree_code code;
tree type;
tree op0;
--- 5015,5021 ----
simpler than the generic fold routine. */
tree
! nondestructive_fold_binary_to_constant (code, type, op0, op1)
enum tree_code code;
tree type;
tree op0;
*************** nondestructive_fold_binary (code, type,
*** 5295,5304 ****
}
/* Given the components of a unary expression CODE, TYPE and OP0,
! attempt to fold the expression without modifying TYPE or OP0.
! If simplification was possible, return the simplified tree. if
! no simplification is possible return NULL_TREE.
Note this is primarily designed to be called after gimplification
of the tree structures and when op0 is a constant. As a result
--- 5298,5309 ----
}
/* Given the components of a unary expression CODE, TYPE and OP0,
! attempt to fold the expression to a constant without modifying
! TYPE or OP0.
! If the expression could be simplified to a constant, then return
! the constant. If the expression would not be simplified to a
! constant, then return NULL_TREE.
Note this is primarily designed to be called after gimplification
of the tree structures and when op0 is a constant. As a result
*************** nondestructive_fold_binary (code, type,
*** 5306,5312 ****
the generic fold routine. */
tree
! nondestructive_fold_unary (code, type, op0)
enum tree_code code;
tree type;
tree op0;
--- 5311,5317 ----
the generic fold routine. */
tree
! nondestructive_fold_unary_to_constant (code, type, op0)
enum tree_code code;
tree type;
tree op0;
Index: tree-ssa-ccp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-ccp.c,v
retrieving revision 1.1.2.59
diff -c -3 -p -r1.1.2.59 tree-ssa-ccp.c
*** tree-ssa-ccp.c 26 Feb 2003 23:09:32 -0000 1.1.2.59
--- tree-ssa-ccp.c 27 Feb 2003 18:21:56 -0000
*************** ccp_fold (stmt)
*** 666,672 ****
op0 = get_value (op0)->const_val;
}
! retval = nondestructive_fold_unary (code, TREE_TYPE (rhs), op0);
/* If we could not fold the expression, but the arguments are all
constants and simple values, then build and return the new
--- 666,674 ----
op0 = get_value (op0)->const_val;
}
! retval = nondestructive_fold_unary_to_constant (code,
! TREE_TYPE (rhs),
! op0);
/* If we could not fold the expression, but the arguments are all
constants and simple values, then build and return the new
*************** ccp_fold (stmt)
*** 712,718 ****
op1 = val->const_val;
}
! retval = nondestructive_fold_binary (code, TREE_TYPE (rhs), op0, op1);
/* If we could not fold the expression, but the arguments are all
constants and simple values, then build and return the new
--- 714,722 ----
op1 = val->const_val;
}
! retval = nondestructive_fold_binary_to_constant (code,
! TREE_TYPE (rhs),
! op0, op1);
/* If we could not fold the expression, but the arguments are all
constants and simple values, then build and return the new
Index: tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.342.2.49
diff -c -3 -p -r1.342.2.49 tree.h
*** tree.h 24 Feb 2003 19:32:27 -0000 1.342.2.49
--- tree.h 27 Feb 2003 18:23:35 -0000
*************** extern void using_eh_for_cleanups PARAM
*** 3192,3199 ****
subexpressions are not changed. */
extern tree fold PARAMS ((tree));
! extern tree nondestructive_fold_unary PARAMS ((enum tree_code, tree, tree));
! extern tree nondestructive_fold_binary PARAMS ((enum tree_code, tree, tree,
tree));
extern int force_fit_type PARAMS ((tree, int));
extern int add_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
--- 3192,3201 ----
subexpressions are not changed. */
extern tree fold PARAMS ((tree));
! extern tree nondestructive_fold_unary_to_constant
! PARAMS ((enum tree_code, tree, tree));
! extern tree nondestructive_fold_binary_to_constant
! PARAMS ((enum tree_code, tree, tree, tree));
extern int force_fit_type PARAMS ((tree, int));
extern int add_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,