Commit 0182d016 by Basile Starynkevitch Committed by Rafael Espindola

gengtype.c (write_types, [...]): Add the output_header argument.

2009-09-22  Basile Starynkevitch  <basile@starynkevitch.net>
            Rafael Avila de Espindola  <espindola@google.com>

	* gengtype.c (write_types, write_local): Add the output_header
	argument. Update all callers.


Co-Authored-By: Rafael Avila de Espindola <espindola@google.com>

From-SVN: r152046
parent d40a19da
2009-09-22 Basile Starynkevitch <basile@starynkevitch.net>
Rafael Avila de Espindola <espindola@google.com>
* gengtype.c (write_types, write_local): Add the output_header
argument. Update all callers.
2009-09-22 Dodji Seketeli <dodji@redhat.com> 2009-09-22 Dodji Seketeli <dodji@redhat.com>
* dwarf2out.c (template_parameter_pack_die, * dwarf2out.c (template_parameter_pack_die,
......
...@@ -1876,14 +1876,16 @@ static void write_func_for_structure ...@@ -1876,14 +1876,16 @@ static void write_func_for_structure
const struct write_types_data *wtd); const struct write_types_data *wtd);
static void write_types_process_field static void write_types_process_field
(type_p f, const struct walk_type_data *d); (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, type_p param_structs,
const struct write_types_data *wtd); const struct write_types_data *wtd);
static void write_types_local_process_field static void write_types_local_process_field
(type_p f, const struct walk_type_data *d); (type_p f, const struct walk_type_data *d);
static void write_local_func_for_structure static void write_local_func_for_structure
(type_p orig_s, type_p s, type_p * param); (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); type_p param_structs);
static void write_enum_defn (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); static int contains_scalar_p (type_p t);
...@@ -2698,12 +2700,12 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param, ...@@ -2698,12 +2700,12 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param,
/* Write out marker routines for STRUCTURES and PARAM_STRUCTS. */ /* Write out marker routines for STRUCTURES and PARAM_STRUCTS. */
static void 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) const struct write_types_data *wtd)
{ {
type_p s; 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) for (s = structures; s; s = s->next)
if (s->gc_used == GC_POINTED_TO if (s->gc_used == GC_POINTED_TO
|| s->gc_used == GC_MAYBE_POINTED_TO) || s->gc_used == GC_MAYBE_POINTED_TO)
...@@ -2714,13 +2716,13 @@ write_types (type_p structures, type_p param_structs, ...@@ -2714,13 +2716,13 @@ write_types (type_p structures, type_p param_structs,
&& s->u.s.line.file == NULL) && s->u.s.line.file == NULL)
continue; continue;
oprintf (header_file, "#define gt_%s_", wtd->prefix); oprintf (output_header, "#define gt_%s_", wtd->prefix);
output_mangled_typename (header_file, s); output_mangled_typename (output_header, s);
oprintf (header_file, "(X) do { \\\n"); oprintf (output_header, "(X) do { \\\n");
oprintf (header_file, oprintf (output_header,
" if (X != NULL) gt_%sx_%s (X);\\\n", wtd->prefix, " if (X != NULL) gt_%sx_%s (X);\\\n", wtd->prefix,
s->u.s.tag); s->u.s.tag);
oprintf (header_file, oprintf (output_header,
" } while (0)\n"); " } while (0)\n");
for (opt = s->u.s.opt; opt; opt = opt->next) for (opt = s->u.s.opt; opt; opt = opt->next)
...@@ -2730,7 +2732,7 @@ write_types (type_p structures, type_p param_structs, ...@@ -2730,7 +2732,7 @@ write_types (type_p structures, type_p param_structs,
if (t->kind == TYPE_STRUCT if (t->kind == TYPE_STRUCT
|| t->kind == TYPE_UNION || t->kind == TYPE_UNION
|| t->kind == TYPE_LANG_STRUCT) || t->kind == TYPE_LANG_STRUCT)
oprintf (header_file, oprintf (output_header,
"#define gt_%sx_%s gt_%sx_%s\n", "#define gt_%sx_%s gt_%sx_%s\n",
wtd->prefix, s->u.s.tag, wtd->prefix, t->u.s.tag); wtd->prefix, s->u.s.tag, wtd->prefix, t->u.s.tag);
else else
...@@ -2742,7 +2744,7 @@ write_types (type_p structures, type_p param_structs, ...@@ -2742,7 +2744,7 @@ write_types (type_p structures, type_p param_structs,
continue; continue;
/* Declare the marker procedure only once. */ /* Declare the marker procedure only once. */
oprintf (header_file, oprintf (output_header,
"extern void gt_%sx_%s (void *);\n", "extern void gt_%sx_%s (void *);\n",
wtd->prefix, s->u.s.tag); wtd->prefix, s->u.s.tag);
...@@ -2770,9 +2772,9 @@ write_types (type_p structures, type_p param_structs, ...@@ -2770,9 +2772,9 @@ write_types (type_p structures, type_p param_structs,
type_p stru = s->u.param_struct.stru; type_p stru = s->u.param_struct.stru;
/* Declare the marker procedure. */ /* Declare the marker procedure. */
oprintf (header_file, "extern void gt_%s_", wtd->prefix); oprintf (output_header, "extern void gt_%s_", wtd->prefix);
output_mangled_typename (header_file, s); output_mangled_typename (output_header, s);
oprintf (header_file, " (void *);\n"); oprintf (output_header, " (void *);\n");
if (stru->u.s.line.file == NULL) if (stru->u.s.line.file == NULL)
{ {
...@@ -2887,13 +2889,13 @@ write_local_func_for_structure (type_p orig_s, type_p s, type_p *param) ...@@ -2887,13 +2889,13 @@ write_local_func_for_structure (type_p orig_s, type_p s, type_p *param)
/* Write out local marker routines for STRUCTURES and PARAM_STRUCTS. */ /* Write out local marker routines for STRUCTURES and PARAM_STRUCTS. */
static void 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; type_p s;
if (!header_file) if (!output_header)
return; 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) for (s = structures; s; s = s->next)
if (s->gc_used == GC_POINTED_TO if (s->gc_used == GC_POINTED_TO
|| s->gc_used == GC_MAYBE_POINTED_TO) || s->gc_used == GC_MAYBE_POINTED_TO)
...@@ -2911,11 +2913,11 @@ write_local (type_p structures, type_p param_structs) ...@@ -2911,11 +2913,11 @@ write_local (type_p structures, type_p param_structs)
|| t->kind == TYPE_UNION || t->kind == TYPE_UNION
|| t->kind == TYPE_LANG_STRUCT) || t->kind == TYPE_LANG_STRUCT)
{ {
oprintf (header_file, "#define gt_pch_p_"); oprintf (output_header, "#define gt_pch_p_");
output_mangled_typename (header_file, s); output_mangled_typename (output_header, s);
oprintf (header_file, " gt_pch_p_"); oprintf (output_header, " gt_pch_p_");
output_mangled_typename (header_file, t); output_mangled_typename (output_header, t);
oprintf (header_file, "\n"); oprintf (output_header, "\n");
} }
else else
error_at_line (&s->u.s.line, error_at_line (&s->u.s.line,
...@@ -2926,9 +2928,9 @@ write_local (type_p structures, type_p param_structs) ...@@ -2926,9 +2928,9 @@ write_local (type_p structures, type_p param_structs)
continue; continue;
/* Declare the marker procedure only once. */ /* Declare the marker procedure only once. */
oprintf (header_file, "extern void gt_pch_p_"); oprintf (output_header, "extern void gt_pch_p_");
output_mangled_typename (header_file, s); output_mangled_typename (output_header, s);
oprintf (header_file, oprintf (output_header,
"\n (void *, void *, gt_pointer_operator, void *);\n"); "\n (void *, void *, gt_pointer_operator, void *);\n");
if (s->kind == TYPE_LANG_STRUCT) if (s->kind == TYPE_LANG_STRUCT)
...@@ -2948,9 +2950,9 @@ write_local (type_p structures, type_p param_structs) ...@@ -2948,9 +2950,9 @@ write_local (type_p structures, type_p param_structs)
type_p stru = s->u.param_struct.stru; type_p stru = s->u.param_struct.stru;
/* Declare the marker procedure. */ /* Declare the marker procedure. */
oprintf (header_file, "extern void gt_pch_p_"); oprintf (output_header, "extern void gt_pch_p_");
output_mangled_typename (header_file, s); output_mangled_typename (output_header, s);
oprintf (header_file, oprintf (output_header,
"\n (void *, void *, gt_pointer_operator, void *);\n"); "\n (void *, void *, gt_pointer_operator, void *);\n");
if (stru->u.s.line.file == NULL) if (stru->u.s.line.file == NULL)
...@@ -3689,9 +3691,9 @@ main (int argc, char **argv) ...@@ -3689,9 +3691,9 @@ main (int argc, char **argv)
open_base_files (); open_base_files ();
write_enum_defn (structures, param_structs); write_enum_defn (structures, param_structs);
write_types (structures, param_structs, &ggc_wtd); write_types (header_file, structures, param_structs, &ggc_wtd);
write_types (structures, param_structs, &pch_wtd); write_types (header_file, structures, param_structs, &pch_wtd);
write_local (structures, param_structs); write_local (header_file, structures, param_structs);
write_roots (variables); write_roots (variables);
write_rtx_next (); write_rtx_next ();
close_output_files (); close_output_files ();
......
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