tree-pretty-print.c (dump_generic_node, [...]): Use access functions for lower bound and element size and only output if...

* tree-pretty-print.c (dump_generic_node, case ARRAY_REF): Use
	access functions for lower bound and element size and only output
	if lower bound nonzero or element size not same as that of type.
	(dump_generic_node, case COMPONENT_REF): Use access func. for offset.

From-SVN: r83997
This commit is contained in:
Richard Kenner 2004-07-01 19:32:27 +00:00 committed by Richard Kenner
parent 695e0fbfe0
commit 8e6b96d398
2 changed files with 19 additions and 12 deletions

View File

@ -1,3 +1,10 @@
2004-07-01 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* tree-pretty-print.c (dump_generic_node, case ARRAY_REF): Use
access functions for lower bound and element size and only output
if lower bound nonzero or element size not same as that of type.
(dump_generic_node, case COMPONENT_REF): Use access func. for offset.
2004-07-01 Paolo Bonzini <bonzini@gnu.org> 2004-07-01 Paolo Bonzini <bonzini@gnu.org>
* c-pretty-print.c (pp_c_postfix_expression): Fix pasto. * c-pretty-print.c (pp_c_postfix_expression): Fix pasto.

View File

@ -611,12 +611,12 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
pp_character (buffer, ')'); pp_character (buffer, ')');
pp_string (buffer, str); pp_string (buffer, str);
dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false); dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false);
if (TREE_OPERAND (node, 2)
&& TREE_CODE (TREE_OPERAND (node, 2)) != INTEGER_CST) op0 = component_ref_field_offset (node);
if (op0 && TREE_CODE (op0) != INTEGER_CST)
{ {
pp_string (buffer, "{off: "); pp_string (buffer, "{off: ");
dump_generic_node (buffer, TREE_OPERAND (node, 2), dump_generic_node (buffer, op0, spc, flags, false);
spc, flags, false);
pp_character (buffer, '}'); pp_character (buffer, '}');
} }
break; break;
@ -649,17 +649,17 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
pp_string (buffer, " ..."); pp_string (buffer, " ...");
pp_character (buffer, ']'); pp_character (buffer, ']');
if ((TREE_OPERAND (node, 2) op0 = array_ref_low_bound (node);
&& TREE_CODE (TREE_OPERAND (node, 2)) != INTEGER_CST) op1 = array_ref_element_size (node);
|| (TREE_OPERAND (node, 3)
&& TREE_CODE (TREE_OPERAND (node, 3)) != INTEGER_CST)) if (!integer_zerop (op0)
|| (TYPE_SIZE_UNIT (TREE_TYPE (node))
&& !operand_equal_p (op1, TYPE_SIZE_UNIT (TREE_TYPE (node)), 0)))
{ {
pp_string (buffer, "{lb: "); pp_string (buffer, "{lb: ");
dump_generic_node (buffer, TREE_OPERAND (node, 2), dump_generic_node (buffer, op0, spc, flags, false);
spc, flags, false);
pp_string (buffer, " sz: "); pp_string (buffer, " sz: ");
dump_generic_node (buffer, TREE_OPERAND (node, 3), dump_generic_node (buffer, op1, spc, flags, false);
spc, flags, false);
pp_character (buffer, '}'); pp_character (buffer, '}');
} }
break; break;