gengtype.h: Updated copyright year.

2011-04-19  Basile Starynkevitch  <basile@starynkevitch.net>

	* gengtype.h: Updated copyright year.
	(struct input_file_st): Add inpisplugin field.
	(type_fileloc): New function.
	* gengtype.c
	(write_typed_struct_alloc_def): Add gcc_assert.
	(write_typed_alloc_defns): Ditto. Don't output for plugin files.
	(write_typed_alloc_defns): Don't output for plugin files.
	(input_file_by_name): Clear inpisplugin field.
	(main): Set inpisplugin field for plugin files.

From-SVN: r172705
This commit is contained in:
Basile Starynkevitch 2011-04-19 09:45:18 +00:00
parent 897e0a890f
commit fbb20b29c8
3 changed files with 50 additions and 3 deletions

View File

@ -1,3 +1,16 @@
2011-04-19 Basile Starynkevitch <basile@starynkevitch.net>
* gengtype.h: Updated copyright year.
(struct input_file_st): Add inpisplugin field.
(type_fileloc): New function.
* gengtype.c
(write_typed_struct_alloc_def): Add gcc_assert.
(write_typed_alloc_defns): Ditto. Don't output for plugin files.
(write_typed_alloc_defns): Don't output for plugin files.
(input_file_by_name): Clear inpisplugin field.
(main): Set inpisplugin field for plugin files.
2011-04-19 Nicola Pero <nicola.pero@meta-innovation.com> 2011-04-19 Nicola Pero <nicola.pero@meta-innovation.com>
* gengtype-state.c (string_eq): New. * gengtype-state.c (string_eq): New.
@ -22,6 +35,7 @@
* config/vms/vms-ar.c: New file. * config/vms/vms-ar.c: New file.
* config/vms/t-vmsnative: New file. * config/vms/t-vmsnative: New file.
>>>>>>> .r172704
2011-04-18 Xinliang David Li <davidxl@google.com> 2011-04-18 Xinliang David Li <davidxl@google.com>
* final.c (dump_basic_block_info): Use ASM_COMMENT_START. * final.c (dump_basic_block_info): Use ASM_COMMENT_START.

View File

@ -4235,6 +4235,7 @@ write_typed_struct_alloc_def (outf_p f,
enum alloc_quantity quantity, enum alloc_quantity quantity,
enum alloc_zone zone) enum alloc_zone zone)
{ {
gcc_assert (UNION_OR_STRUCT_P (s));
write_typed_alloc_def (f, variable_size_p (s), get_type_specifier (s), write_typed_alloc_def (f, variable_size_p (s), get_type_specifier (s),
s->u.s.tag, allocator_type, quantity, zone); s->u.s.tag, allocator_type, quantity, zone);
} }
@ -4269,6 +4270,12 @@ write_typed_alloc_defns (outf_p f,
{ {
if (!USED_BY_TYPED_GC_P (s)) if (!USED_BY_TYPED_GC_P (s))
continue; continue;
gcc_assert (UNION_OR_STRUCT_P (s));
/* In plugin mode onput output ggc_alloc macro definitions
relevant to plugin input files. */
if (nb_plugin_files > 0
&& ((s->u.s.line.file == NULL) || !s->u.s.line.file->inpisplugin))
continue;
write_typed_struct_alloc_def (f, s, "", single, any_zone); write_typed_struct_alloc_def (f, s, "", single, any_zone);
write_typed_struct_alloc_def (f, s, "cleared_", single, any_zone); write_typed_struct_alloc_def (f, s, "cleared_", single, any_zone);
write_typed_struct_alloc_def (f, s, "vec_", vector, any_zone); write_typed_struct_alloc_def (f, s, "vec_", vector, any_zone);
@ -4287,6 +4294,14 @@ write_typed_alloc_defns (outf_p f,
s = p->type; s = p->type;
if (!USED_BY_TYPED_GC_P (s) || (strcmp (p->name, s->u.s.tag) == 0)) if (!USED_BY_TYPED_GC_P (s) || (strcmp (p->name, s->u.s.tag) == 0))
continue; continue;
/* In plugin mode onput output ggc_alloc macro definitions
relevant to plugin input files. */
if (nb_plugin_files > 0)
{
struct fileloc* filoc = type_fileloc(s);
if (!filoc || !filoc->file->inpisplugin)
continue;
};
write_typed_typedef_alloc_def (f, p, "", single, any_zone); write_typed_typedef_alloc_def (f, p, "", single, any_zone);
write_typed_typedef_alloc_def (f, p, "cleared_", single, any_zone); write_typed_typedef_alloc_def (f, p, "cleared_", single, any_zone);
write_typed_typedef_alloc_def (f, p, "vec_", vector, any_zone); write_typed_typedef_alloc_def (f, p, "vec_", vector, any_zone);
@ -4814,6 +4829,7 @@ input_file_by_name (const char* name)
f = XCNEWVAR (input_file, sizeof (input_file)+namlen+2); f = XCNEWVAR (input_file, sizeof (input_file)+namlen+2);
f->inpbitmap = 0; f->inpbitmap = 0;
f->inpoutf = NULL; f->inpoutf = NULL;
f->inpisplugin = false;
strcpy (f->inpname, name); strcpy (f->inpname, name);
slot = htab_find_slot (input_file_htab, f, INSERT); slot = htab_find_slot (input_file_htab, f, INSERT);
gcc_assert (slot != NULL); gcc_assert (slot != NULL);
@ -4945,8 +4961,11 @@ main (int argc, char **argv)
/* Parse our plugin files and augment the state. */ /* Parse our plugin files and augment the state. */
for (ix = 0; ix < nb_plugin_files; ix++) for (ix = 0; ix < nb_plugin_files; ix++)
parse_file (get_input_file_name (plugin_files[ix])); {
input_file* pluginput = plugin_files [ix];
pluginput->inpisplugin = true;
parse_file (get_input_file_name (pluginput));
}
if (hit_error) if (hit_error)
return 1; return 1;

View File

@ -1,5 +1,5 @@
/* Process source files and output type information. /* Process source files and output type information.
Copyright (C) 2002, 2003, 2004, 2007, 2008, 2010 Copyright (C) 2002, 2003, 2004, 2007, 2008, 2010, 2011
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
@ -33,6 +33,7 @@ struct input_file_st
struct outf* inpoutf; /* Cached corresponding output file, computed struct outf* inpoutf; /* Cached corresponding output file, computed
in get_output_file_with_visibility. */ in get_output_file_with_visibility. */
lang_bitmap inpbitmap; /* The set of languages using this file. */ lang_bitmap inpbitmap; /* The set of languages using this file. */
bool inpisplugin; /* Flag set for plugin input files. */
char inpname[1]; /* A variable-length array, ended by a null char inpname[1]; /* A variable-length array, ended by a null
char. */ char. */
}; };
@ -328,6 +329,19 @@ extern struct type scalar_char;
/* Give the file location of a type, if any. */
static inline struct fileloc*
type_fileloc (type_p t)
{
if (!t)
return NULL;
if (UNION_OR_STRUCT_P(t))
return &t->u.s.line;
if (t->kind == TYPE_PARAM_STRUCT)
return &t->u.param_struct.line;
return NULL;
}
/* Structure representing an output file. */ /* Structure representing an output file. */
struct outf struct outf
{ {