/* 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.
This file is part of GCC.
struct outf* inpoutf; /* Cached corresponding output file, computed
in get_output_file_with_visibility. */
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. */
};
+/* 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. */
struct outf
{
extern const char *read_state_filename; /* (-r) program argument. */
extern const char *write_state_filename; /* (-w) program argument. */
+/* Functions reading and writing the entire gengtype state, called from
+ main, and implemented in file gengtype-state.c. */
+void read_state (const char* path);
+/* Write the state, and update the state_number field in types. */
+void write_state (const char* path);
+
+
/* Print an error message. */
extern void error_at_line
(const struct fileloc *pos, const char *msg, ...) ATTRIBUTE_PRINTF_2;