* parse.y (java_stabilize_reference): Use save_expr instead of
building a SAVE_EXPR node.
(java_complete_lhs): Patch the resulting string of the `+='
operator (if necessary) and complete the RHS after having built
the cast.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25797
138bc75d-0d04-0410-961f-
82ee72b054a4
+1999-03-16 Alexandre Petit-Bianco <apbianco@cygnus.com>
+
+ * parse.y (java_stabilize_reference): Use save_expr instead of
+ building a SAVE_EXPR node.
+ (java_complete_lhs): Patch the resulting string of the `+='
+ operator (if necessary) and complete the RHS after having built
+ the cast.
+
Mon Mar 15 12:18:29 1999 Per Bothner <bothner@cygnus.com>
* class.c (make_class): Don't set CLASS_P here (because
{
tree op0 = TREE_OPERAND (node, 0);
tree op1 = TREE_OPERAND (node, 1);
- TREE_OPERAND (node, 0) = build1 (SAVE_EXPR, TREE_TYPE (op0), op0);
+ TREE_OPERAND (node, 0) = save_expr (op0);
TREE_OPERAND (node, 1) = java_stabilize_reference (op1);
return node;
}
/* Now complete the RHS. We write it back later on. */
nn = java_complete_tree (TREE_OPERAND (node, 1));
+ if ((cn = patch_string (nn)))
+ nn = cn;
+
/* The last part of the rewrite for E1 op= E2 is to have
E1 = (T)(E1 op E2), with T being the type of E1. */
- nn = build_cast (EXPR_WFL_LINECOL (wfl_op2), TREE_TYPE (lvalue), nn);
+ nn = java_complete_tree (build_cast (EXPR_WFL_LINECOL (wfl_op2),
+ TREE_TYPE (lvalue), nn));
}
/* If we're about to patch a NEW_ARRAY_INIT, we call a special
{
tree result;
int side_effects = TREE_SIDE_EFFECTS (op1) | TREE_SIDE_EFFECTS (op2);
-
/* Try to do some static optimization */
if ((result = string_constant_concatenation (op1, op2)))
{
tree op0 = TREE_OPERAND (node, 0);
tree op1 = TREE_OPERAND (node, 1);
- TREE_OPERAND (node, 0) = build1 (SAVE_EXPR, TREE_TYPE (op0), op0);
+ TREE_OPERAND (node, 0) = save_expr (op0);
TREE_OPERAND (node, 1) = java_stabilize_reference (op1);
return node;
}
/* Now complete the RHS. We write it back later on. */
nn = java_complete_tree (TREE_OPERAND (node, 1));
+ if ((cn = patch_string (nn)))
+ nn = cn;
+
/* The last part of the rewrite for E1 op= E2 is to have
E1 = (T)(E1 op E2), with T being the type of E1. */
- nn = build_cast (EXPR_WFL_LINECOL (wfl_op2), TREE_TYPE (lvalue), nn);
+ nn = java_complete_tree (build_cast (EXPR_WFL_LINECOL (wfl_op2),
+ TREE_TYPE (lvalue), nn));
}
/* If we're about to patch a NEW_ARRAY_INIT, we call a special
{
tree result;
int side_effects = TREE_SIDE_EFFECTS (op1) | TREE_SIDE_EFFECTS (op2);
-
/* Try to do some static optimization */
if ((result = string_constant_concatenation (op1, op2)))