const struct write_types_data *wtd);
static void write_types_process_field
(type_p f, const struct walk_type_data *d);
-static void write_types (type_p structures,
+static void write_types (outf_p output_header,
+ type_p structures,
type_p param_structs,
const struct write_types_data *wtd);
static void write_types_local_process_field
(type_p f, const struct walk_type_data *d);
static void write_local_func_for_structure
(type_p orig_s, type_p s, type_p * param);
-static void write_local (type_p structures,
+static void write_local (outf_p output_header,
+ type_p structures,
type_p param_structs);
static void write_enum_defn (type_p structures, type_p param_structs);
static int contains_scalar_p (type_p t);
/* Write out marker routines for STRUCTURES and PARAM_STRUCTS. */
static void
-write_types (type_p structures, type_p param_structs,
+write_types (outf_p output_header, type_p structures, type_p param_structs,
const struct write_types_data *wtd)
{
type_p s;
- oprintf (header_file, "\n/* %s*/\n", wtd->comment);
+ oprintf (output_header, "\n/* %s*/\n", wtd->comment);
for (s = structures; s; s = s->next)
if (s->gc_used == GC_POINTED_TO
|| s->gc_used == GC_MAYBE_POINTED_TO)
&& s->u.s.line.file == NULL)
continue;
- oprintf (header_file, "#define gt_%s_", wtd->prefix);
- output_mangled_typename (header_file, s);
- oprintf (header_file, "(X) do { \\\n");
- oprintf (header_file,
+ oprintf (output_header, "#define gt_%s_", wtd->prefix);
+ output_mangled_typename (output_header, s);
+ oprintf (output_header, "(X) do { \\\n");
+ oprintf (output_header,
" if (X != NULL) gt_%sx_%s (X);\\\n", wtd->prefix,
s->u.s.tag);
- oprintf (header_file,
+ oprintf (output_header,
" } while (0)\n");
for (opt = s->u.s.opt; opt; opt = opt->next)
if (t->kind == TYPE_STRUCT
|| t->kind == TYPE_UNION
|| t->kind == TYPE_LANG_STRUCT)
- oprintf (header_file,
+ oprintf (output_header,
"#define gt_%sx_%s gt_%sx_%s\n",
wtd->prefix, s->u.s.tag, wtd->prefix, t->u.s.tag);
else
continue;
/* Declare the marker procedure only once. */
- oprintf (header_file,
+ oprintf (output_header,
"extern void gt_%sx_%s (void *);\n",
wtd->prefix, s->u.s.tag);
type_p stru = s->u.param_struct.stru;
/* Declare the marker procedure. */
- oprintf (header_file, "extern void gt_%s_", wtd->prefix);
- output_mangled_typename (header_file, s);
- oprintf (header_file, " (void *);\n");
+ oprintf (output_header, "extern void gt_%s_", wtd->prefix);
+ output_mangled_typename (output_header, s);
+ oprintf (output_header, " (void *);\n");
if (stru->u.s.line.file == NULL)
{
/* Write out local marker routines for STRUCTURES and PARAM_STRUCTS. */
static void
-write_local (type_p structures, type_p param_structs)
+write_local (outf_p output_header, type_p structures, type_p param_structs)
{
type_p s;
- if (!header_file)
+ if (!output_header)
return;
- oprintf (header_file, "\n/* Local pointer-walking routines. */\n");
+ oprintf (output_header, "\n/* Local pointer-walking routines. */\n");
for (s = structures; s; s = s->next)
if (s->gc_used == GC_POINTED_TO
|| s->gc_used == GC_MAYBE_POINTED_TO)
|| t->kind == TYPE_UNION
|| t->kind == TYPE_LANG_STRUCT)
{
- oprintf (header_file, "#define gt_pch_p_");
- output_mangled_typename (header_file, s);
- oprintf (header_file, " gt_pch_p_");
- output_mangled_typename (header_file, t);
- oprintf (header_file, "\n");
+ oprintf (output_header, "#define gt_pch_p_");
+ output_mangled_typename (output_header, s);
+ oprintf (output_header, " gt_pch_p_");
+ output_mangled_typename (output_header, t);
+ oprintf (output_header, "\n");
}
else
error_at_line (&s->u.s.line,
continue;
/* Declare the marker procedure only once. */
- oprintf (header_file, "extern void gt_pch_p_");
- output_mangled_typename (header_file, s);
- oprintf (header_file,
+ oprintf (output_header, "extern void gt_pch_p_");
+ output_mangled_typename (output_header, s);
+ oprintf (output_header,
"\n (void *, void *, gt_pointer_operator, void *);\n");
if (s->kind == TYPE_LANG_STRUCT)
type_p stru = s->u.param_struct.stru;
/* Declare the marker procedure. */
- oprintf (header_file, "extern void gt_pch_p_");
- output_mangled_typename (header_file, s);
- oprintf (header_file,
+ oprintf (output_header, "extern void gt_pch_p_");
+ output_mangled_typename (output_header, s);
+ oprintf (output_header,
"\n (void *, void *, gt_pointer_operator, void *);\n");
if (stru->u.s.line.file == NULL)
open_base_files ();
write_enum_defn (structures, param_structs);
- write_types (structures, param_structs, &ggc_wtd);
- write_types (structures, param_structs, &pch_wtd);
- write_local (structures, param_structs);
+ write_types (header_file, structures, param_structs, &ggc_wtd);
+ write_types (header_file, structures, param_structs, &pch_wtd);
+ write_local (header_file, structures, param_structs);
write_roots (variables);
write_rtx_next ();
close_output_files ();