Commit e580d8ee by Eric Botcazou Committed by Eric Botcazou

dwarf2out.c (add_byte_size_attribute): Handle variable reference as size attribute.

	* dwarf2out.c (add_byte_size_attribute) <RECORD_TYPE>: Handle variable
	reference as size attribute.

From-SVN: r187384
parent 7b84aac0
2012-05-10 Eric Botcazou <ebotcazou@adacore.com> 2012-05-10 Eric Botcazou <ebotcazou@adacore.com>
* dwarf2out.c (add_byte_size_attribute) <RECORD_TYPE>: Handle variable
reference as size attribute.
2012-05-10 Eric Botcazou <ebotcazou@adacore.com>
Tristan Gingold <gingold@adacore.com> Tristan Gingold <gingold@adacore.com>
* doc/md.texi (Standard Names): Document probe_stack_address. * doc/md.texi (Standard Names): Document probe_stack_address.
......
...@@ -15156,6 +15156,7 @@ add_subscript_info (dw_die_ref type_die, tree type, bool collapse_p) ...@@ -15156,6 +15156,7 @@ add_subscript_info (dw_die_ref type_die, tree type, bool collapse_p)
static void static void
add_byte_size_attribute (dw_die_ref die, tree tree_node) add_byte_size_attribute (dw_die_ref die, tree tree_node)
{ {
dw_die_ref decl_die;
unsigned size; unsigned size;
switch (TREE_CODE (tree_node)) switch (TREE_CODE (tree_node))
...@@ -15167,6 +15168,12 @@ add_byte_size_attribute (dw_die_ref die, tree tree_node) ...@@ -15167,6 +15168,12 @@ add_byte_size_attribute (dw_die_ref die, tree tree_node)
case RECORD_TYPE: case RECORD_TYPE:
case UNION_TYPE: case UNION_TYPE:
case QUAL_UNION_TYPE: case QUAL_UNION_TYPE:
if (TREE_CODE (TYPE_SIZE_UNIT (tree_node)) == VAR_DECL
&& (decl_die = lookup_decl_die (TYPE_SIZE_UNIT (tree_node))))
{
add_AT_die_ref (die, DW_AT_byte_size, decl_die);
return;
}
size = int_size_in_bytes (tree_node); size = int_size_in_bytes (tree_node);
break; break;
case FIELD_DECL: case FIELD_DECL:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment