re PR middle-end/46745 ('#'mem_ref' not supported by dump_expr#<expression error>')
2010-12-03 Richard Guenther <rguenther@suse.de> PR c/46745 * c-pretty-print.c (pp_c_postfix_expression): Handle MEM_REF. (pp_c_unary_expression): Likewise. (pp_c_expression): Likewise. cp/ * error.c (dump_expr): Handle MEM_REF. From-SVN: r167433
This commit is contained in:
parent
928a231bb9
commit
892f61197b
4 changed files with 71 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
2010-12-03 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR c/46745
|
||||
* c-pretty-print.c (pp_c_postfix_expression): Handle MEM_REF.
|
||||
(pp_c_unary_expression): Likewise.
|
||||
(pp_c_expression): Likewise.
|
||||
|
||||
2010-11-30 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||
|
||||
* c-common.h (objc_finish_function): New.
|
||||
|
|
|
@ -1531,6 +1531,10 @@ pp_c_postfix_expression (c_pretty_printer *pp, tree e)
|
|||
}
|
||||
break;
|
||||
|
||||
case MEM_REF:
|
||||
pp_c_expression (pp, e);
|
||||
break;
|
||||
|
||||
case COMPLEX_CST:
|
||||
case VECTOR_CST:
|
||||
pp_c_compound_literal (pp, e);
|
||||
|
@ -1661,6 +1665,32 @@ pp_c_unary_expression (c_pretty_printer *pp, tree e)
|
|||
pp_c_cast_expression (pp, TREE_OPERAND (e, 0));
|
||||
break;
|
||||
|
||||
case MEM_REF:
|
||||
if (TREE_CODE (TREE_OPERAND (e, 0)) == ADDR_EXPR
|
||||
&& integer_zerop (TREE_OPERAND (e, 1)))
|
||||
pp_c_expression (pp, TREE_OPERAND (TREE_OPERAND (e, 0), 0));
|
||||
else
|
||||
{
|
||||
pp_c_star (pp);
|
||||
if (!integer_zerop (TREE_OPERAND (e, 1)))
|
||||
{
|
||||
pp_c_left_paren (pp);
|
||||
if (!integer_onep (TYPE_SIZE_UNIT
|
||||
(TREE_TYPE (TREE_TYPE (TREE_OPERAND (e, 0))))))
|
||||
pp_c_type_cast (pp, ptr_type_node);
|
||||
}
|
||||
pp_c_cast_expression (pp, TREE_OPERAND (e, 0));
|
||||
if (!integer_zerop (TREE_OPERAND (e, 1)))
|
||||
{
|
||||
pp_plus (pp);
|
||||
pp_c_integer_constant (pp,
|
||||
fold_convert (ssizetype,
|
||||
TREE_OPERAND (e, 1)));
|
||||
pp_c_right_paren (pp);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case REALPART_EXPR:
|
||||
case IMAGPART_EXPR:
|
||||
pp_c_ws_string (pp, code == REALPART_EXPR ? "__real__" : "__imag__");
|
||||
|
@ -2065,6 +2095,7 @@ pp_c_expression (c_pretty_printer *pp, tree e)
|
|||
case CONJ_EXPR:
|
||||
case ADDR_EXPR:
|
||||
case INDIRECT_REF:
|
||||
case MEM_REF:
|
||||
case NEGATE_EXPR:
|
||||
case BIT_NOT_EXPR:
|
||||
case TRUTH_NOT_EXPR:
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2010-12-03 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR c/46745
|
||||
* error.c (dump_expr): Handle MEM_REF.
|
||||
|
||||
2010-12-03 Laurynas Biveinis <laurynas.biveinis@gmail.com>
|
||||
|
||||
* cp-tree.h (struct aggr_init_expr_arg_iterator_d): Remove GTY
|
||||
|
|
|
@ -1928,6 +1928,34 @@ dump_expr (tree t, int flags)
|
|||
}
|
||||
break;
|
||||
|
||||
case MEM_REF:
|
||||
if (TREE_CODE (TREE_OPERAND (t, 0)) == ADDR_EXPR
|
||||
&& integer_zerop (TREE_OPERAND (t, 1)))
|
||||
dump_expr (TREE_OPERAND (TREE_OPERAND (t, 0), 0), flags);
|
||||
else
|
||||
{
|
||||
pp_cxx_star (cxx_pp);
|
||||
if (!integer_zerop (TREE_OPERAND (t, 1)))
|
||||
{
|
||||
pp_cxx_left_paren (cxx_pp);
|
||||
if (!integer_onep (TYPE_SIZE_UNIT
|
||||
(TREE_TYPE (TREE_TYPE (TREE_OPERAND (t, 0))))))
|
||||
{
|
||||
pp_cxx_left_paren (cxx_pp);
|
||||
dump_type (ptr_type_node, flags);
|
||||
pp_cxx_right_paren (cxx_pp);
|
||||
}
|
||||
}
|
||||
dump_expr (TREE_OPERAND (t, 0), flags);
|
||||
if (!integer_zerop (TREE_OPERAND (t, 1)))
|
||||
{
|
||||
pp_cxx_ws_string (cxx_pp, "+");
|
||||
dump_expr (fold_convert (ssizetype, TREE_OPERAND (t, 1)), flags);
|
||||
pp_cxx_right_paren (cxx_pp);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case NEGATE_EXPR:
|
||||
case BIT_NOT_EXPR:
|
||||
case TRUTH_NOT_EXPR:
|
||||
|
|
Loading…
Add table
Reference in a new issue