aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-io.c
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-07-02 19:53:24 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2010-07-02 19:53:24 +0000
commitdfd6ece2cb3000d9882a7448b8e8ca379a9949b9 (patch)
tree6f03ec4e9f3206b3a12d1205d91d3a68e28415f4 /gcc/fortran/trans-io.c
parent0acba2b4cc842831c3893d172082e65ce291608e (diff)
downloadgcc-dfd6ece2cb3000d9882a7448b8e8ca379a9949b9.zip
gcc-dfd6ece2cb3000d9882a7448b8e8ca379a9949b9.tar.gz
gcc-dfd6ece2cb3000d9882a7448b8e8ca379a9949b9.tar.bz2
trans-types.h (gfc_add_field_to_struct): Add tree ** parameter.
* trans-types.h (gfc_add_field_to_struct): Add tree ** parameter. * trans-types.c (gfc_add_field_to_struct_1): New function, most of which comes from... (gfc_add_field_to_struct): ...here. Call it. Add new parameter. (gfc_get_desc_dim_type): Call gfc_add_field_to_struct_1 for building fields. (gfc_get_array_descriptor_base): Likewise. (gfc_get_mixed_entry_union): Likewise. (gfc_get_derived_type): Add extra chain parameter for gfc_add_field_to_struct. * trans-stmt.c (gfc_trans_character_select): Likewise. * trans-io.c (gfc_build_st_parameter): Likewise. From-SVN: r161738
Diffstat (limited to 'gcc/fortran/trans-io.c')
-rw-r--r--gcc/fortran/trans-io.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index 1608a5e..9926d2f 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -156,6 +156,7 @@ gfc_build_st_parameter (enum ioparam_type ptype, tree *types)
char name[64];
size_t len;
tree t = make_node (RECORD_TYPE);
+ tree *chain = NULL;
len = strlen (st_parameter[ptype].name);
gcc_assert (len <= sizeof (name) - sizeof ("__st_parameter_"));
@@ -177,12 +178,12 @@ gfc_build_st_parameter (enum ioparam_type ptype, tree *types)
case IOPARM_type_pad:
p->field = gfc_add_field_to_struct (&TYPE_FIELDS (t), t,
get_identifier (p->name),
- types[p->type]);
+ types[p->type], &chain);
break;
case IOPARM_type_char1:
p->field = gfc_add_field_to_struct (&TYPE_FIELDS (t), t,
get_identifier (p->name),
- pchar_type_node);
+ pchar_type_node, &chain);
/* FALLTHROUGH */
case IOPARM_type_char2:
len = strlen (p->name);
@@ -191,17 +192,19 @@ gfc_build_st_parameter (enum ioparam_type ptype, tree *types)
memcpy (name + len, "_len", sizeof ("_len"));
p->field_len = gfc_add_field_to_struct (&TYPE_FIELDS (t), t,
get_identifier (name),
- gfc_charlen_type_node);
+ gfc_charlen_type_node,
+ &chain);
if (p->type == IOPARM_type_char2)
p->field = gfc_add_field_to_struct (&TYPE_FIELDS (t), t,
get_identifier (p->name),
- pchar_type_node);
+ pchar_type_node, &chain);
break;
case IOPARM_type_common:
p->field
= gfc_add_field_to_struct (&TYPE_FIELDS (t), t,
get_identifier (p->name),
- st_parameter[IOPARM_ptype_common].type);
+ st_parameter[IOPARM_ptype_common].type,
+ &chain);
break;
case IOPARM_type_num:
gcc_unreachable ();