summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-29 21:42:27 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-29 21:42:27 +0000
commit523507f18505ae33b72cc565e8122044011f3e09 (patch)
tree95e869414cd56d97221294d797de9f2f5ddb9c7e /gcc
parent0a4b7550b17edd976d0b8ade6e6773247f197acd (diff)
downloadgcc-523507f18505ae33b72cc565e8122044011f3e09.tar.gz
* gengtype.c (write_func_for_structure): Split out ...
(output_type_enum): ... new function. Fix thinko accessing TYPE_PARAM_STRUCT data. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99020 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/gengtype.c67
2 files changed, 29 insertions, 45 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 534dba62dc0..4c5843aba37 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2005-04-29 Richard Henderson <rth@redhat.com>
+ Daniel Jacobowitz <dan@codesourcery.com>
+
+ * gengtype.c (write_func_for_structure): Split out ...
+ (output_type_enum): ... new function. Fix thinko accessing
+ TYPE_PARAM_STRUCT data.
+
2005-04-29 Tom Tromey <tromey@redhat.com>
* tree.c (build_block): Removed unused 'tags' argument.
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index 0ff0c116e62..042f92f886b 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -1976,6 +1976,25 @@ write_types_process_field (type_p f, const struct walk_type_data *d)
}
}
+/* A subroutine of write_func_for_structure. Write the enum tag for S. */
+
+static void
+output_type_enum (outf_p of, type_p s)
+{
+ if (s->kind == TYPE_PARAM_STRUCT && s->u.s.line.file != NULL)
+ {
+ oprintf (of, ", gt_e_");
+ output_mangled_typename (of, s);
+ }
+ else if (UNION_OR_STRUCT_P (s) && s->u.s.line.file != NULL)
+ {
+ oprintf (of, ", gt_ggc_e_");
+ output_mangled_typename (of, s);
+ }
+ else
+ oprintf (of, ", gt_types_enum_last");
+}
+
/* For S, a structure that's part of ORIG_S, and using parameters
PARAM, write out a routine that:
- Takes a parameter, a void * but actually of type *S
@@ -2050,21 +2069,7 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param,
{
oprintf (d.of, ", x, gt_%s_", wtd->param_prefix);
output_mangled_typename (d.of, orig_s);
-
- if (orig_s->u.p->kind == TYPE_PARAM_STRUCT
- && orig_s->u.p->u.s.line.file != NULL)
- {
- oprintf (d.of, ", gt_e_");
- output_mangled_typename (d.of, orig_s);
- }
- else if (UNION_OR_STRUCT_P (orig_s)
- && orig_s->u.s.line.file != NULL)
- {
- oprintf (d.of, ", gt_ggc_e_");
- output_mangled_typename (d.of, orig_s);
- }
- else
- oprintf (d.of, ", gt_types_enum_last");
+ output_type_enum (d.of, orig_s);
}
oprintf (d.of, "))\n");
}
@@ -2075,21 +2080,7 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param,
{
oprintf (d.of, ", xlimit, gt_%s_", wtd->param_prefix);
output_mangled_typename (d.of, orig_s);
-
- if (orig_s->u.p->kind == TYPE_PARAM_STRUCT
- && orig_s->u.p->u.s.line.file != NULL)
- {
- oprintf (d.of, ", gt_e_");
- output_mangled_typename (d.of, orig_s);
- }
- else if (UNION_OR_STRUCT_P (orig_s)
- && orig_s->u.s.line.file != NULL)
- {
- oprintf (d.of, ", gt_ggc_e_");
- output_mangled_typename (d.of, orig_s);
- }
- else
- oprintf (d.of, ", gt_types_enum_last");
+ output_type_enum (d.of, orig_s);
}
oprintf (d.of, "))\n");
oprintf (d.of, " xlimit = (");
@@ -2115,21 +2106,7 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param,
{
oprintf (d.of, ", xprev, gt_%s_", wtd->param_prefix);
output_mangled_typename (d.of, orig_s);
-
- if (orig_s->u.p->kind == TYPE_PARAM_STRUCT
- && orig_s->u.p->u.s.line.file != NULL)
- {
- oprintf (d.of, ", gt_e_");
- output_mangled_typename (d.of, orig_s);
- }
- else if (UNION_OR_STRUCT_P (orig_s)
- && orig_s->u.s.line.file != NULL)
- {
- oprintf (d.of, ", gt_ggc_e_");
- output_mangled_typename (d.of, orig_s);
- }
- else
- oprintf (d.of, ", gt_types_enum_last");
+ output_type_enum (d.of, orig_s);
}
oprintf (d.of, ");\n");
oprintf (d.of, " }\n");