diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-05 10:01:06 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-05 10:01:06 +0000 |
commit | d4086afc2b0e18f785e297548064d4439300ee4c (patch) | |
tree | 711988c1c31f3270678e410234acb2d699dc72c1 /gcc/treelang | |
parent | c4e709d6206bb34841724728366fbeb5afc1e3a3 (diff) | |
download | gcc-d4086afc2b0e18f785e297548064d4439300ee4c.tar.gz |
2005-12-05 Richard Guenther <rguenther@suse.de>
* treetree.c (tree_code_if_start, tree_code_create_variable,
tree_code_generate_return, tree_code_get_expression,
tree_code_add_parameter): Use fold_convert where appropriate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108051 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/treelang')
-rw-r--r-- | gcc/treelang/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/treelang/treetree.c | 19 |
2 files changed, 15 insertions, 10 deletions
diff --git a/gcc/treelang/ChangeLog b/gcc/treelang/ChangeLog index 25602d68ba2..69963642ee5 100644 --- a/gcc/treelang/ChangeLog +++ b/gcc/treelang/ChangeLog @@ -1,3 +1,9 @@ +2005-12-05 Richard Guenther <rguenther@suse.de> + + * treetree.c (tree_code_if_start, tree_code_create_variable, + tree_code_generate_return, tree_code_get_expression, + tree_code_add_parameter): Use fold_convert where appropriate. + 2005-11-07 James A. Morrison <phython@gcc.gnu.org> PR treelang/24066 diff --git a/gcc/treelang/treetree.c b/gcc/treelang/treetree.c index b783dedcabe..2bfbb2a6ba0 100644 --- a/gcc/treelang/treetree.c +++ b/gcc/treelang/treetree.c @@ -259,8 +259,7 @@ tree_code_if_start (tree exp, location_t loc) { tree cond_exp, cond; cond_exp = fold_build2 (NE_EXPR, boolean_type_node, exp, - fold_build1 (CONVERT_EXPR, TREE_TYPE (exp), - integer_zero_node)); + build_int_cst (TREE_TYPE (exp), 0)); SET_EXPR_LOCATION (cond_exp, loc); cond = build3 (COND_EXPR, void_type_node, cond_exp, NULL_TREE, NULL_TREE); @@ -526,7 +525,7 @@ tree_code_create_variable (unsigned int storage_class, /* 3a. Initialization. */ if (init) - DECL_INITIAL (var_decl) = fold_build1 (CONVERT_EXPR, var_type, init); + DECL_INITIAL (var_decl) = fold_convert (var_type, init); else DECL_INITIAL (var_decl) = NULL_TREE; @@ -586,7 +585,7 @@ tree_code_generate_return (tree type, tree exp) { setret = fold_build2 (MODIFY_EXPR, type, DECL_RESULT (current_function_decl), - fold_build1 (CONVERT_EXPR, type, exp)); + fold_convert (type, exp)); TREE_SIDE_EFFECTS (setret) = 1; TREE_USED (setret) = 1; setret = build1 (RETURN_EXPR, type, setret); @@ -663,7 +662,7 @@ tree_code_get_expression (unsigned int exp_type, gcc_assert (op1 && op2); operator = MODIFY_EXPR; ret1 = fold_build2 (operator, void_type_node, op1, - fold_build1 (CONVERT_EXPR, TREE_TYPE (op1), op2)); + fold_convert (TREE_TYPE (op1), op2)); break; @@ -683,8 +682,8 @@ tree_code_get_expression (unsigned int exp_type, binary_expression: gcc_assert (op1 && op2); ret1 = fold_build2 (operator, type, - fold_build1 (CONVERT_EXPR, type, op1), - fold_build1 (CONVERT_EXPR, type, op2)); + fold_convert (type, op1), + fold_convert (type, op2)); break; /* Reference to a variable. This is dead easy, just return the @@ -697,7 +696,7 @@ tree_code_get_expression (unsigned int exp_type, if (type == TREE_TYPE (op1)) ret1 = build1 (NOP_EXPR, type, op1); else - ret1 = fold_build1 (CONVERT_EXPR, type, op1); + ret1 = fold_convert (type, op1); break; case EXP_FUNCTION_INVOCATION: @@ -734,8 +733,8 @@ tree_code_add_parameter (tree list, tree proto_exp, tree exp) { tree new_exp; new_exp = tree_cons (NULL_TREE, - fold_build1 (CONVERT_EXPR, TREE_TYPE (proto_exp), - exp), NULL_TREE); + fold_convert (TREE_TYPE (proto_exp), + exp), NULL_TREE); if (!list) return new_exp; return chainon (new_exp, list); |