Commit fb88e1dd by Eric Botcazou Committed by Eric Botcazou

utils.c (finish_record_type): Return early for padded types and tidy up.

	* gcc-interface/utils.c (finish_record_type): Return early for padded
	types and tidy up.

From-SVN: r185778
parent 47a1ae3c
2012-03-25 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils.c (finish_record_type): Return early for padded
types and tidy up.
2012-03-20 Arnaud Charlet <charlet@adacore.com> 2012-03-20 Arnaud Charlet <charlet@adacore.com>
* hlo.ads, hlo.adb: Removed, no longer used. * hlo.ads, hlo.adb: Removed, no longer used.
......
...@@ -863,12 +863,15 @@ finish_record_type (tree record_type, tree field_list, int rep_level, ...@@ -863,12 +863,15 @@ finish_record_type (tree record_type, tree field_list, int rep_level,
void void
rest_of_record_type_compilation (tree record_type) rest_of_record_type_compilation (tree record_type)
{ {
tree field_list = TYPE_FIELDS (record_type);
tree field;
enum tree_code code = TREE_CODE (record_type);
bool var_size = false; bool var_size = false;
tree field;
for (field = field_list; field; field = DECL_CHAIN (field)) /* If this is a padded type, the bulk of the debug info has already been
generated for the field's type. */
if (TYPE_IS_PADDING_P (record_type))
return;
for (field = TYPE_FIELDS (record_type); field; field = DECL_CHAIN (field))
{ {
/* We need to make an XVE/XVU record if any field has variable size, /* We need to make an XVE/XVU record if any field has variable size,
whether or not the record does. For example, if we have a union, whether or not the record does. For example, if we have a union,
...@@ -879,7 +882,7 @@ rest_of_record_type_compilation (tree record_type) ...@@ -879,7 +882,7 @@ rest_of_record_type_compilation (tree record_type)
if (TREE_CODE (DECL_SIZE (field)) != INTEGER_CST if (TREE_CODE (DECL_SIZE (field)) != INTEGER_CST
/* If a field has a non-constant qualifier, the record will have /* If a field has a non-constant qualifier, the record will have
variable size too. */ variable size too. */
|| (code == QUAL_UNION_TYPE || (TREE_CODE (record_type) == QUAL_UNION_TYPE
&& TREE_CODE (DECL_QUALIFIER (field)) != INTEGER_CST)) && TREE_CODE (DECL_QUALIFIER (field)) != INTEGER_CST))
{ {
var_size = true; var_size = true;
...@@ -887,12 +890,9 @@ rest_of_record_type_compilation (tree record_type) ...@@ -887,12 +890,9 @@ rest_of_record_type_compilation (tree record_type)
} }
} }
/* If this record is of variable size, rename it so that the /* If this record type is of variable size, make a parallel record type that
debugger knows it is and make a new, parallel, record will tell the debugger how the former is laid out (see exp_dbug.ads). */
that tells the debugger how the record is laid out. See if (var_size)
exp_dbug.ads. But don't do this for records that are padding
since they confuse GDB. */
if (var_size && !TYPE_IS_PADDING_P (record_type))
{ {
tree new_record_type tree new_record_type
= make_node (TREE_CODE (record_type) == QUAL_UNION_TYPE = make_node (TREE_CODE (record_type) == QUAL_UNION_TYPE
...@@ -1052,8 +1052,7 @@ rest_of_record_type_compilation (tree record_type) ...@@ -1052,8 +1052,7 @@ rest_of_record_type_compilation (tree record_type)
prev_old_field = old_field; prev_old_field = old_field;
} }
TYPE_FIELDS (new_record_type) TYPE_FIELDS (new_record_type) = nreverse (TYPE_FIELDS (new_record_type));
= nreverse (TYPE_FIELDS (new_record_type));
add_parallel_type (TYPE_STUB_DECL (record_type), new_record_type); add_parallel_type (TYPE_STUB_DECL (record_type), new_record_type);
} }
......
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