summaryrefslogtreecommitdiffstats
path: root/gcc/ada/gcc-interface/utils.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-25 16:55:01 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-25 16:55:01 +0000
commit96e7147aaee1b8533e55b74c02294a7138ffe531 (patch)
tree9d90918e550bb6f18e87640e70026d658b0f2bb2 /gcc/ada/gcc-interface/utils.c
parent4dca9aca0c07effd59a00a690b56c44312a47d3b (diff)
downloadppe42-gcc-96e7147aaee1b8533e55b74c02294a7138ffe531.tar.gz
ppe42-gcc-96e7147aaee1b8533e55b74c02294a7138ffe531.zip
* gcc-interface/utils.c (finish_record_type): Return early for padded
types and tidy up. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185778 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r--gcc/ada/gcc-interface/utils.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 73833586a2a..18f9dac975d 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -863,12 +863,15 @@ finish_record_type (tree record_type, tree field_list, int rep_level,
void
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;
+ 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,
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)
if (TREE_CODE (DECL_SIZE (field)) != INTEGER_CST
/* If a field has a non-constant qualifier, the record will have
variable size too. */
- || (code == QUAL_UNION_TYPE
+ || (TREE_CODE (record_type) == QUAL_UNION_TYPE
&& TREE_CODE (DECL_QUALIFIER (field)) != INTEGER_CST))
{
var_size = true;
@@ -887,12 +890,9 @@ rest_of_record_type_compilation (tree record_type)
}
}
- /* If this record is of variable size, rename it so that the
- debugger knows it is and make a new, parallel, record
- that tells the debugger how the record is laid out. See
- 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))
+ /* If this record type is of variable size, make a parallel record type that
+ will tell the debugger how the former is laid out (see exp_dbug.ads). */
+ if (var_size)
{
tree new_record_type
= make_node (TREE_CODE (record_type) == QUAL_UNION_TYPE
@@ -1052,8 +1052,7 @@ rest_of_record_type_compilation (tree record_type)
prev_old_field = old_field;
}
- TYPE_FIELDS (new_record_type)
- = nreverse (TYPE_FIELDS (new_record_type));
+ TYPE_FIELDS (new_record_type) = nreverse (TYPE_FIELDS (new_record_type));
add_parallel_type (TYPE_STUB_DECL (record_type), new_record_type);
}
OpenPOWER on IntegriCloud