GCC Middle and Back End API Reference
gengtype.c File Reference
#include "getopt.h"
#include "double-int.h"
Include dependency graph for gengtype.c:

Data Structures

struct  file_rule_st
struct  flist
struct  write_types_data
struct  walk_type_data

Typedefs

typedef outf_pfrul_actionrout_t )(input_file *, char **, char **)
typedef void(* process_field_fn )(type_p f, const struct walk_type_data *p)
typedef void(* func_name_fn )(type_p s, const struct walk_type_data *p)

Enumerations

enum  rtx_code { NUM_RTX_CODE, LAST_AND_UNUSED_RTX_CODE }
enum  insn_note { NOTE_INSN_MAX, NOTE_INSN_MAX }
enum  alloc_quantity { single, vector }

Functions

static outf_p create_file (const char *, const char *)
static const char * get_file_basename (const input_file *)
static const char * get_file_realbasename (const input_file *)
static int get_prefix_langdir_index (const char *)
static const char * get_file_langdir (const input_file *)
static void dump_pair (int indent, pair_p p)
static void dump_type (int indent, type_p p)
static void dump_type_list (int indent, type_p p)
static void gen_rtx_next (void)
static void write_rtx_next (void)
static void open_base_files (void)
static void close_output_files (void)
void error_at_line ()
char * xasprintf ()
void dbgprint_count_type_at ()
static size_t measure_input_list ()
static bool read_input_line ()
static void read_input_list ()
static type_p find_param_structure (type_p t, type_p param[NUM_PARAM])
static type_p adjust_field_tree_exp (type_p t, options_p opt)
static type_p adjust_field_rtx_def (type_p t, options_p opt)
void do_typedef ()
void do_scalar_typedef ()
type_p create_user_defined_type ()
static type_p type_for_name ()
static type_p create_undefined_type ()
type_p resolve_typedef ()
type_p new_structure (const char *name, enum typekind kind, struct fileloc *pos, pair_p fields, options_p o)
type_p find_structure ()
static type_p find_param_structure ()
type_p create_scalar_type ()
type_p create_pointer ()
type_p create_array ()
options_p create_string_option ()
options_p create_type_option ()
options_p create_nested_option (options_p next, const char *name, struct nested_ptr_data *info)
options_p create_nested_ptr_option (options_p next, type_p t, const char *to, const char *from)
void note_variable ()
static pair_p create_field_all (pair_p next, type_p type, const char *name, options_p opt, const input_file *inpf, int line)
pair_p create_field_at (pair_p next, type_p type, const char *name, options_p opt, struct fileloc *pos)
static pair_p create_optional_field_ (pair_p next, type_p type, const char *name, const char *cond, int line)
pair_p nreverse_pairs ()
static type_p adjust_field_rtx_def (type_p t, options_p ARG_UNUSED(opt))
static type_p adjust_field_tree_exp ()
type_p adjust_field_type ()
static void set_gc_used_type (type_p, enum gc_used_enum, type_p *, bool=false)
static void set_gc_used (pair_p)
static void process_gc_options (options_p opt, enum gc_used_enum level, int *maybe_undef, int *pass_param, int *length, int *skip, type_p *nested_ptr)
static void set_gc_used_type (type_p t, enum gc_used_enum level, type_p param[NUM_PARAM], bool allow_undefined_types)
static void set_gc_used ()
static outf_p create_file ()
void oprintf ()
static const char * get_file_realbasename ()
const char * get_file_srcdir_relative_path ()
static const char * get_file_basename ()
static int get_prefix_langdir_index ()
static const char * get_file_langdir ()
static const char * get_file_gtfilename ()
static outf_p header_dot_h_frul (input_file *, char **, char **)
static outf_p source_dot_c_frul (input_file *, char **, char **)
static outf_p source_dot_c_frul ()
static char * matching_file_name_substitute (const char *filnam, regmatch_t pmatch[10], const char *trs)
outf_p get_output_file_with_visibility ()
const char * get_output_file_name ()
static bool is_file_equal ()
static void output_escaped_param (struct walk_type_data *d, const char *, const char *)
static void output_mangled_typename (outf_p, const_type_p)
static void walk_type (type_p t, struct walk_type_data *d)
static void write_func_for_structure (type_p orig_s, type_p s, type_p *param, 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 (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 (const_type_p orig_s, type_p s, type_p *param)
static void write_local (outf_p output_header, type_p structures, type_p param_structs)
static int contains_scalar_p (type_p t)
static void put_mangled_filename (outf_p, const input_file *)
static void finish_root_table (struct flist *flp, const char *pfx, const char *tname, const char *lastname, const char *name)
static void write_root (outf_p, pair_p, type_p, const char *, int, struct fileloc *, const char *, bool)
static void write_array (outf_p f, pair_p v, const struct write_types_data *wtd)
static void write_roots (pair_p, bool)
static const char * filter_type_name ()
static void output_mangled_typename ()
static void walk_type ()
static void write_types_process_field ()
static outf_p get_output_file_for_structure ()
static const char * get_type_specifier ()
static void write_type_decl ()
static void write_marker_function_name ()
static void write_user_func_for_structure_ptr ()
static void write_user_func_for_structure_body (type_p s, const char *prefix, struct walk_type_data *d)
static void write_user_marking_functions (type_p s, const char *prefix, struct walk_type_data *d)
static void write_types_local_user_process_field ()
static void write_pch_user_walking_for_structure_body ()
static void write_pch_user_walking_functions ()
static void write_types_local_process_field ()
static void write_local_func_for_structure ()
static void write_local ()
static int contains_scalar_p ()
static void put_mangled_filename ()
static bool start_root_entry ()
static void write_field_root (outf_p f, pair_p v, type_p type, const char *name, int has_length, struct fileloc *line, const char *if_marked, bool emit_pch, type_p field_type, const char *field_name)
static void write_array ()
static void write_roots ()
static bool variable_size_p ()
static void write_typed_alloc_def (outf_p f, bool variable_size, const char *type_specifier, const char *type_name, const char *allocator_type, enum alloc_quantity quantity)
static void write_typed_struct_alloc_def (outf_p f, const type_p s, const char *allocator_type, enum alloc_quantity quantity)
static void write_typed_typedef_alloc_def (outf_p f, const pair_p p, const char *allocator_type, enum alloc_quantity quantity)
static void write_typed_alloc_defns (outf_p f, const type_p structures, const pair_p typedefs)
static void output_typename ()
static void write_splay_tree_allocator_def ()
static void write_splay_tree_allocators ()
static void dump_typekind ()
static void dump_gc_used ()
static void dump_options ()
static void dump_fileloc ()
static void dump_type_u_s ()
static void dump_type_u_a ()
static void dump_type_u_param_struct ()
static void dump_type_list ()
static void dump_type ()
static void dump_pair ()
static void dump_pair_list ()
static void dump_structures ()
static void dump_everything ()
static void print_usage ()
static void print_version ()
static void parse_program_options ()
input_fileinput_file_by_name ()
static hashval_t htab_hash_inputfile ()
static int htab_eq_inputfile ()
int main ()

Variables

outf_p output_files
outf_p header_file
static char * inputlist
static input_file ** plugin_files
static size_t nb_plugin_files
static outf_p plugin_output
static char * plugin_output_filename
const char * srcdir
size_t srcdir_len
const char * read_state_filename
const char * write_state_filename
int do_dump
int do_debug
int verbosity_level
static int type_count
static const char * backup_dir
bool hit_error = false
const input_file ** gt_files
size_t num_gt_files
input_filethis_file
input_filesystem_h_file
const char ** lang_dir_names
size_t num_lang_dirs
static outf_pbase_files
struct type string_type
struct type scalar_nonchar
struct type scalar_char
pair_p typedefs = NULL
type_p structures = NULL
type_p param_structs = NULL
pair_p variables = NULL
static const char *const rtx_name [NUM_RTX_CODE]
static const char *const rtx_format [NUM_RTX_CODE]
static int rtx_next_new [NUM_RTX_CODE]
static const char *const note_insn_name [NOTE_INSN_MAX+1]
struct file_rule_st files_rules []
static struct write_types_data ggc_wtd
static struct write_types_data pch_wtd
static htab_t seen_types
static struct option gengtype_long_options []
static htab_t input_file_htab

Typedef Documentation

typedef outf_p( frul_actionrout_t)(input_file *, char **, char **)
Each input_file has its associated output file outf_p.  The
   association is computed by the function
   get_output_file_with_visibility.  The associated file is cached
   inside input_file in its inpoutf field, so is really computed only
   once.  Associated output file paths (i.e. output_name-s) are
   computed by a rule based regexp machinery, using the files_rules
   array of struct file_rule_st.  A for_name is also computed, giving
   the source file name for which the output_file is generated; it is
   often the last component of the input_file path.   
Signature of actions in file rules.   
typedef void(* func_name_fn)(type_p s, const struct walk_type_data *p)
typedef void(* process_field_fn)(type_p f, const struct walk_type_data *p)
For scalars and strings, given the item in 'val'.
   For structures, given a pointer to the item in 'val'.
   For misc. pointers, given the item in 'val'.

Enumeration Type Documentation

Enumerator:
single 
vector 
enum insn_note
We also need codes and names for insn notes (not register notes).
   Note that we do *not* bias the note values here.   
Enumerator:
NOTE_INSN_MAX 
NOTE_INSN_MAX 
enum rtx_code
We don't want to see codes that are only for generator files.   
Enumerator:
NUM_RTX_CODE 
LAST_AND_UNUSED_RTX_CODE 

Function Documentation

static type_p adjust_field_rtx_def ( type_p  t,
options_p  opt 
)
static

Referenced by adjust_field_type().

static type_p adjust_field_rtx_def ( type_p  t,
options_p   ARG_UNUSEDopt 
)
static
Handle `special("rtx_def")'.  This is a special case for field
   `fld' of struct rtx_def, which is an array of unions whose values
   are based in a complex way on the type of RTL.   

References create_pointer(), create_string_option(), error_at_line(), find_structure(), type::kind, lexer_line, new_structure(), NOTE_INSN_MAX, note_insn_name, NUM_RTX_CODE, pair::opt, rtx_format, rtx_name, scalar_nonchar, string_type, strlen(), TYPE_STRUCT, TYPE_UNION, and xasprintf().

static type_p adjust_field_tree_exp ( type_p  t,
options_p  opt 
)
static

Referenced by adjust_field_type().

static type_p adjust_field_tree_exp ( )
static
Handle `special("tree_exp")'.  This is a special case for
   field `operands' of struct tree_exp, which although it claims to contain
   pointers to trees, actually sometimes contains pointers to RTL too.
   Passed T, the old type of the field, and OPT its options.  Returns
   a new type for the field.   

References create_string_option(), error_at_line(), type::kind, lexer_line, new_structure(), pair::opt, string_type, TYPE_ARRAY, and TYPE_UNION.

type_p adjust_field_type ( )
Perform any special processing on a type T, about to become the type
   of a field.  Return the appropriate type for the field.
   At present:
   - Converts pointer-to-char, with no length parameter, to TYPE_STRING;
   - Similarly for arrays of pointer-to-char;
   - Converts structures for which a parameter is provided to
     TYPE_PARAM_STRUCT;
   - Handles "special" options.

References type::a, adjust_field_rtx_def(), adjust_field_tree_exp(), create_array(), create_pointer(), error_at_line(), find_param_structure(), options::info, options::kind, type::kind, lexer_line, options::name, options::next, OPTION_STRING, OPTION_TYPE, type::p, type::scalar_is_char, options::string, string_type, options::type, TYPE_ARRAY, TYPE_POINTER, TYPE_SCALAR, TYPE_STRING, type::u, and union_or_struct_p().

Referenced by absdecl(), create_field_at(), create_nested_ptr_option(), and extern_or_static().

static void close_output_files ( )
static
Copy the output to its final destination,
   but don't unnecessarily change modification times.   

References backup_dir, outf::buf, outf::buflength, outf::bufused, errno, fatal(), free(), is_file_equal(), outf::name, outf::next, progname, and verbosity_level.

Referenced by main().

static int contains_scalar_p ( type_p  t)
static

Referenced by contains_scalar_p(), and write_roots().

static int contains_scalar_p ( )
static
Might T contain any non-pointer elements?   

References type::a, contains_scalar_p(), type::kind, TYPE_ARRAY, TYPE_POINTER, TYPE_STRING, TYPE_USER_STRUCT, and type::u.

type_p create_array ( )
static pair_p create_field_all ( pair_p  next,
type_p  type,
const char *  name,
options_p  opt,
const input_file inpf,
int  line 
)
static
Most-general structure field creator.   

References fileloc::file, fileloc::line, pair::line, pair::name, pair::next, pair::opt, pair::type, and type().

Referenced by create_field_at(), and create_optional_field_().

pair_p create_field_at ( pair_p  next,
type_p  type,
const char *  name,
options_p  opt,
struct fileloc pos 
)
Create a field that came from the source code we are scanning,
   i.e. we have a 'struct fileloc', and possibly options; also,
   adjust_field_type should be called.   

References adjust_field_type(), create_field_all(), fileloc::file, and fileloc::line.

Referenced by create_user_defined_type(), and struct_field_seq().

static outf_p create_file ( const char *  ,
const char *   
)
static
static outf_p create_file ( )
static
File mapping routines.  For each input file, there is one output .c file
   (but some output files have many input files), and there is one .h file
   for the whole build.   
Output file handling.   
Create and return an outf_p for a new file for NAME, to be called
   ONAME.   

References outf::name, outf::next, oprintf(), and output_files.

options_p create_nested_option ( options_p  next,
const char *  name,
struct nested_ptr_data info 
)
Create a nested pointer options structure with name NAME and info
   INFO.  NEXT is the next option in the chain.   

References options::info, options::kind, options::name, options::nested, options::next, type::next, and OPTION_NESTED.

Referenced by create_nested_ptr_option().

options_p create_nested_ptr_option ( options_p  next,
type_p  t,
const char *  to,
const char *  from 
)
Return an options structure for a "nested_ptr" option.   

References adjust_field_type(), nested_ptr_data::convert_from, nested_ptr_data::convert_to, create_nested_option(), and nested_ptr_data::type.

Referenced by nestedptr_optvalue().

static pair_p create_optional_field_ ( pair_p  next,
type_p  type,
const char *  name,
const char *  cond,
int  line 
)
static
Like create_field, but the field is only valid when condition COND
   is true.   

References create_field_all(), create_string_option(), lexer_line, new_structure(), pair::opt, TYPE_UNION, and xasprintf().

type_p create_scalar_type ( )
Return a scalar type with name NAME.   

References scalar_char, and scalar_nonchar.

Referenced by array_and_function_declarators_opt(), and type().

options_p create_string_option ( )
Return a string options structure with name NAME and info INFO.
   NEXT is the next option in the chain.   

References options::info, options::kind, options::name, options::next, type::next, OPTION_STRING, and options::string.

Referenced by adjust_field_rtx_def(), adjust_field_tree_exp(), create_optional_field_(), option(), and str_optvalue_opt().

options_p create_type_option ( )
Create a type options structure with name NAME and info INFO.  NEXT
   is the next option in the chain.   

References options::info, options::kind, options::name, options::next, type::next, OPTION_TYPE, and options::type.

Referenced by type_optvalue().

static type_p create_undefined_type ( )
static
Create an undefined type with name S and location POS.  Return the
   newly created type.   

References do_typedef(), fileloc::file, find_structure(), get_lang_bitmap(), type::s, TYPE_UNDEFINED, and type::u.

Referenced by resolve_typedef().

type_p create_user_defined_type ( )
Define TYPE_NAME to be a user defined type at location POS.   

References create_field_at(), do_typedef(), type::fields, fileloc::file, find_structure(), free(), get_lang_bitmap(), type::kind, resolve_typedef(), type::s, TYPE_USER_STRUCT, and type::u.

Referenced by resolve_typedef(), and type().

void dbgprint_count_type_at ( )
Utility debugging function, printing the various type counts within
   a list of types.  Called through the DBGPRINT_COUNT_TYPE macro.   

References type::kind, type::next, type::p, TYPE_ARRAY, TYPE_LANG_STRUCT, TYPE_NONE, TYPE_PARAM_STRUCT, TYPE_POINTER, TYPE_SCALAR, TYPE_STRING, TYPE_STRUCT, TYPE_UNDEFINED, TYPE_UNION, and TYPE_USER_STRUCT.

void do_scalar_typedef ( )
Define S as a typename of a scalar.  Cannot be used to define
   typedefs of 'char'.  Note: is also used for pointer-to-function
   typedefs (which are therefore not treated as pointers).   

References do_typedef().

Referenced by main().

static void dump_everything ( )
static
Dumps the internal structures of gengtype.  This is useful to debug
   gengtype itself, or to understand what it does, e.g. for plugin
   developers.   

References dump_pair_list(), and dump_structures().

Referenced by main().

static void dump_fileloc ( )
static
Dumps the source file location in LINE.   

References fileloc::file, get_input_file_name(), and fileloc::line.

Referenced by dump_pair(), dump_type_u_param_struct(), and dump_type_u_s().

static void dump_gc_used ( )
static
Dumps the value of GC_USED flag.   

References GC_MAYBE_POINTED_TO, GC_POINTED_TO, GC_UNUSED, and GC_USED.

Referenced by dump_type().

static void dump_options ( )
static
static void dump_pair ( int  indent,
pair_p  p 
)
static

Referenced by dump_pair_list(), and dump_type_u_s().

static void dump_pair ( )
static
static void dump_pair_list ( )
static
Dumps the list of pairs PP.   

References dump_pair(), and pair::next.

Referenced by dump_everything().

static void dump_structures ( )
static
Dumps the STRUCTURES.   

References dump_type_list().

Referenced by dump_everything().

static void dump_type ( int  indent,
type_p  p 
)
static
static void dump_type_list ( int  indent,
type_p  p 
)
static
static void dump_type_list ( )
static
Recursively dumps the type list T.   

References dump_type(), and type::next.

static void dump_type_u_a ( )
static
Recursively dumps the array T.   

References type::a, dump_type_list(), type::kind, TYPE_ARRAY, and type::u.

Referenced by dump_type().

static void dump_type_u_param_struct ( )
static
Recursively dumps the parameterized struct T.   

References dump_fileloc(), dump_type(), dump_type_list(), type::kind, type::param_struct, TYPE_PARAM_STRUCT, and type::u.

Referenced by dump_type().

static void dump_type_u_s ( )
static
Recursively dumps the struct, union, or a language-specific
   struct T.   

References dump_fileloc(), dump_options(), dump_pair(), dump_type_list(), type::kind, pair::next, type::s, TYPE_LANG_STRUCT, type::u, and union_or_struct_p().

Referenced by dump_type().

static void dump_typekind ( )
static
static const char* filter_type_name ( )
static
Given a string TYPE_NAME, representing a C++ typename, return a valid
   pre-processor identifier to use in a #define directive.  This replaces
   special characters used in C++ identifiers like '>', '<' and ':' with
   '_'.

   If no C++ special characters are found in TYPE_NAME, return
   TYPE_NAME.  Otherwise, return a copy of TYPE_NAME with the special
   characters replaced with '_'.  In this case, the caller is
   responsible for freeing the allocated string.   

References strlen().

Referenced by output_mangled_typename(), write_marker_function_name(), write_root(), write_typed_alloc_def(), and write_types().

static type_p find_param_structure ( type_p  t,
type_p  param[NUM_PARAM] 
)
static
static type_p find_param_structure ( )
static
Return the previously-defined parameterized structure for structure
   T and parameters PARAM, or a new parameterized empty structure or
   union if none was defined previously.   

References type::kind, memcpy(), type::next, type::param, type::param_struct, param_structs, type::state_number, type_count, TYPE_PARAM_STRUCT, and type::u.

type_p find_structure ( )
Return the previously-defined structure or union with tag NAME,
   or a new empty structure or union if none was defined previously.
   The KIND of structure must be one of TYPE_STRUCT, TYPE_UNION or
   TYPE_USER_STRUCT.   

References type::kind, type::next, type::s, type::state_number, structures, type_count, TYPE_UNDEFINED, TYPE_UNION, type::u, and union_or_struct_p().

Referenced by adjust_field_rtx_def(), create_undefined_type(), create_user_defined_type(), type(), and write_roots().

static void finish_root_table ( struct flist flp,
const char *  pfx,
const char *  lastname,
const char *  tname,
const char *  name 
)
static
Finish off the currently-created root tables in FLP.  PFX, TNAME,
   LASTNAME, and NAME are all strings to insert in various places in
   the resulting code.   

References base_files, flist::f, flist::file, get_lang_bitmap(), flist::next, num_lang_dirs, oprintf(), put_mangled_filename(), and flist::started_p.

Referenced by write_roots().

static void gen_rtx_next ( )
static
Generate the contents of the rtx_next array.  This really doesn't belong
   in gengtype at all, but it's needed for adjust_field_rtx_def.   

References NUM_RTX_CODE, rtx_format, rtx_next_new, SET, and strlen().

Referenced by main().

static const char* get_file_basename ( const input_file )
static
static const char* get_file_basename ( )
static
For INPF an input_file, return the relative path to INPF from
    $(srcdir) if the latter is a prefix in INPF, or the real basename
    of INPF otherwise.  

References get_file_realbasename(), and get_file_srcdir_relative_path().

static const char* get_file_gtfilename ( )
static
The gt- output file name for INPF.   

References get_file_langdir(), get_file_realbasename(), memcpy(), and xasprintf().

Referenced by source_dot_c_frul().

static const char* get_file_langdir ( const input_file )
static

Referenced by get_file_gtfilename().

static const char* get_file_langdir ( )
static
For INPF an input file, return the name of language directory where
   F is located, if any, NULL otherwise.   

References get_file_srcdir_relative_path(), get_prefix_langdir_index(), and lang_dir_names.

static const char* get_file_realbasename ( const input_file )
static
static const char* get_file_realbasename ( )
static
For INPF an input file, return the real basename of INPF, with all
   the directory components skipped.   

References get_input_file_name().

const char* get_file_srcdir_relative_path ( )
For INPF a filename, return the relative path to INPF from
   $(srcdir) if the latter is a prefix in INPF, NULL otherwise.   

References get_input_file_name(), srcdir, srcdir_len, and strlen().

Referenced by get_file_basename(), get_file_langdir(), state_writer::write_state_fileloc(), and state_writer::write_state_files_list().

static outf_p get_output_file_for_structure ( )
static
Return an output file that is suitable for definitions which can
   reference struct S  

References get_output_file_with_visibility(), type::p, type::s, TYPE_POINTER, type::u, and union_or_struct_p().

Referenced by write_func_for_structure(), and write_local_func_for_structure().

const char* get_output_file_name ( )
The name of an output file, suitable for definitions, that can see
   declarations made in INPF and is linked into every language that
   uses INPF.   

References get_output_file_with_visibility(), and outf::name.

Referenced by put_mangled_filename().

outf_p get_output_file_with_visibility ( )
An output file, suitable for definitions, that can see declarations
   made in INPF and is linked into every language that uses INPF.
   Since the result is cached inside INPF, that argument cannot be
   declared constant, but is "almost" constant.  

References create_file(), file_rule_st::frul_action, file_rule_st::frul_re, file_rule_st::frul_srcexpr, get_input_file_name(), input_file_st::inpoutf, matching_file_name_substitute(), memset(), outf::name, nb_plugin_files, outf::next, plugin_output, and system_h_file.

Referenced by get_output_file_for_structure(), get_output_file_name(), write_roots(), write_rtx_next(), and write_splay_tree_allocator_def().

static int get_prefix_langdir_index ( const char *  )
static
static int get_prefix_langdir_index ( )
static
For F a filename, return the lang_dir_names relative index of the language
   directory that is a prefix in F, if any, -1 otherwise.   

References lang_dir_names, num_lang_dirs, and strlen().

static const char* get_type_specifier ( )
static
Returns the specifier keyword for a string or union type S, empty string
   otherwise.   

References type::kind, type::s, TYPE_LANG_STRUCT, TYPE_STRUCT, TYPE_UNION, and type::u.

Referenced by write_type_decl(), and write_typed_struct_alloc_def().

static outf_p header_dot_h_frul ( input_file inpf,
char **  poutname,
char **  pforname 
)
static
File rule action handling *.h files.   
Special file rules action for handling *.h header files.  It gives
   "gtype-desc.c" for common headers and corresponding output
   files for language-specific header files.   

References free(), get_file_basename(), get_input_file_name(), and get_prefix_langdir_index().

static int htab_eq_inputfile ( )
static

References get_input_file_name().

Referenced by main().

static hashval_t htab_hash_inputfile ( )
static
Hash table support routines for input_file-s.   

References get_input_file_name().

Referenced by main().

static bool is_file_equal ( )
static
Check if existing file is equal to the in memory buffer.  

References outf::buf, outf::bufused, and outf::name.

Referenced by close_output_files().

static char* matching_file_name_substitute ( const char *  filnam,
regmatch_t  pmatch[10],
const char *  trs 
)
static
Utility function for get_output_file_with_visibility which returns
 * a malloc-ed substituted string using TRS on matching of the FILNAM
 * file name, using the PMATCH array.   

References obstack.

Referenced by get_output_file_with_visibility().

static size_t measure_input_list ( )
static
Scan the input file, LIST, and determine how much space we need to
   store strings in.  Also, count the number of language directories
   and files.  The numbers returned are overestimates as they does not
   consider repeated files.   

References nb_plugin_files, num_gt_files, and num_lang_dirs.

Referenced by read_input_list().

type_p new_structure ( const char *  name,
enum typekind  kind,
struct fileloc pos,
pair_p  fields,
options_p  o 
)
Create and return a new structure with tag NAME at POS with fields
   FIELDS and options O.  The KIND of structure must be one of
   TYPE_STRUCT, TYPE_UNION or TYPE_USER_STRUCT.   

References error_at_line(), type::fields, fileloc::file, get_lang_bitmap(), type::kind, memcpy(), type::next, type::pointer_to, type::s, si, type::state_number, structures, type_count, TYPE_LANG_STRUCT, TYPE_UNION, type::u, and union_or_struct_p().

Referenced by adjust_field_rtx_def(), adjust_field_tree_exp(), create_optional_field_(), and type().

void note_variable ( )
Add a variable named S of type T with options O defined at POS,
   to `variables'.   

References pair::line, pair::name, pair::next, pair::opt, pair::type, and variables.

Referenced by extern_or_static().

pair_p nreverse_pairs ( )
Reverse a linked list of 'struct pair's in place.   

References pair::next.

Referenced by struct_field_seq().

static void open_base_files ( )
static
Open the global header file and the language-specific header files.   

References create_file(), lang_dir_names, nb_plugin_files, num_lang_dirs, oprintf(), and xasprintf().

Referenced by main().

static void output_escaped_param ( struct walk_type_data d,
const char *  param,
const char *  oname 
)
static
Print PARAM to D->OF processing escapes.  D->VAL references the
   current object, D->PREV_VAL the object containing the current
   object, ONAME is the name of the option and D->LINE is used to
   print error messages.   

References error_at_line(), walk_type_data::line, walk_type_data::of, oprintf(), walk_type_data::prev_val, strlen(), and walk_type_data::val.

Referenced by walk_type(), and write_func_for_structure().

static void output_typename ( )
static
Prints not-as-ugly version of a typename of T to OF.  Trades the uniquness
   guaranteee for somewhat increased readability.  If name conflicts do happen,
   this funcion will have to be adjusted to be more like
   output_mangled_typename.   

References type::kind, oprintf(), type::p, type::param_struct, type::s, TYPE_ARRAY, TYPE_LANG_STRUCT, TYPE_NONE, TYPE_PARAM_STRUCT, TYPE_POINTER, TYPE_SCALAR, TYPE_STRING, TYPE_STRUCT, TYPE_UNDEFINED, TYPE_UNION, TYPE_USER_STRUCT, and type::u.

Referenced by write_splay_tree_allocator_def(), and write_splay_tree_allocators().

static void parse_program_options ( )
static
static void print_usage ( void  )
static

References progname.

Referenced by parse_program_options().

static void print_version ( void  )
static
static void process_gc_options ( options_p  opt,
enum gc_used_enum  level,
int *  maybe_undef,
int *  pass_param,
int *  length,
int *  skip,
type_p nested_ptr 
)
static
static void put_mangled_filename ( outf_p  ,
const input_file  
)
static

Referenced by finish_root_table(), and write_roots().

static void put_mangled_filename ( )
static
Mangle INPF and print it to F.   

References get_output_file_name(), and oprintf().

static bool read_input_line ( )
static
Read one input line from LIST to HEREP (which is updated).  A
   pointer to the string is returned via LINEP.  If it was a language
   subdirectory in square brackets, strip off the square brackets and
   return true.  Otherwise, leave space before the string for a
   lang_bitmap, and return false.  At EOF, returns false, does not
   touch *HEREP, and sets *LINEP to NULL.  POS is used for
   diagnostics.   

References error_at_line(), type::line, and memset().

Referenced by read_input_list().

static void read_input_list ( )
static
Read the list of input files from LIST and compute all of the
   relevant tables.  There is one file per line of the list.  At
   first, all the files on the list are language-generic, but
   eventually a line will appear which is the name of a language
   subdirectory in square brackets, like this: [cp].  All subsequent
   files are specific to that language, until another language
   subdirectory tag appears.  Files can appear more than once, if
   they apply to more than one language.   

References errno, error(), error_at_line(), fatal(), fileloc::file, get_file_basename(), get_lang_bitmap(), input_file_by_name(), lang_dir_names, limit, fileloc::line, measure_input_list(), nb_plugin_files, num_gt_files, num_lang_dirs, read_input_line(), set_lang_bitmap(), and strlen().

Referenced by main().

type_p resolve_typedef ( )
Return the type previously defined for S.  Use POS to report errors.   

References create_undefined_type(), create_user_defined_type(), type::p, and type_for_name().

Referenced by create_user_defined_type(), main(), and type().

static void set_gc_used ( pair_p  )
static

Referenced by main().

static void set_gc_used ( )
static
Set the gc_used fields of all the types pointed to by VARIABLES.   

References GC_USED, pair::next, progname, set_gc_used_type(), pair::type, and verbosity_level.

static void set_gc_used_type ( type_p  ,
enum  gc_used_enum,
type_p ,
bool  = false 
)
static
static void set_gc_used_type ( type_p  t,
enum gc_used_enum  level,
type_p  param[NUM_PARAM],
bool  allow_undefined_types 
)
static
Set the gc_used field of T to LEVEL, and handle the types it references.

   If ALLOWED_UNDEFINED_TYPES is true, types of kind TYPE_UNDEFINED
   are set to GC_UNUSED.  Otherwise, an error is emitted for
   TYPE_UNDEFINED types.  This is used to support user-defined
   template types with non-type arguments.

   For instance, when we parse a template type with enum arguments
   (e.g. MyType<AnotherType, EnumValue>), the parser created two
   artificial fields for 'MyType', one for 'AnotherType', the other
   one for 'EnumValue'.

   At the time that we parse this type we don't know that 'EnumValue'
   is really an enum value, so the parser creates a TYPE_UNDEFINED
   type for it.  Since 'EnumValue' is never resolved to a known
   structure, it will stay with TYPE_UNDEFINED.

   Since 'MyType' is a TYPE_USER_STRUCT, we can simply ignore
   'EnumValue'.  Generating marking code for it would cause
   compilation failures since the marking routines assumes that
   'EnumValue' is a type.   

References type::a, error_at_line(), find_param_structure(), GC_MAYBE_POINTED_TO, GC_POINTED_TO, GC_UNUSED, GC_USED, type::gc_used, type::kind, pair::next, type::next, pair::opt, type::p, type::param_struct, process_gc_options(), type::s, set_gc_used_type(), pair::type, TYPE_ARRAY, TYPE_LANG_STRUCT, TYPE_PARAM_STRUCT, TYPE_POINTER, TYPE_STRUCT, TYPE_UNDEFINED, TYPE_UNION, TYPE_USER_STRUCT, and type::u.

static outf_p source_dot_c_frul ( input_file ,
char **  ,
char **   
)
static
File rule action handling *.c files.   
static outf_p source_dot_c_frul ( )
static
Special file rules action for handling *.c source files using
 * get_file_gtfilename to compute their output_name and
 * get_file_basename to compute their for_name.  The output_name is
 * gt-<LANG>-<BASE>.h for language specific source files, and
 * gt-<BASE>.h for common source files.   

References free(), get_file_basename(), get_file_gtfilename(), and get_input_file_name().

static bool start_root_entry ( )
static
Write the first three fields (pointer, count and stride) for
   root NAME to F.  V and LINE are as for write_root.

   Return true if the entry could be written; return false on error.   

References type::a, error_at_line(), type::kind, pair::name, oprintf(), pair::type, TYPE_ARRAY, and type::u.

Referenced by write_root().

static type_p type_for_name ( )
static
Given a typedef name S, return its associated type.  Return NULL if
   S is not a registered type name.   

References pair::name, pair::next, type::p, and pair::type.

Referenced by resolve_typedef().

static bool variable_size_p ( )
static
TRUE if type S has the GTY variable_size annotation.   

References options::name, options::next, type::s, and type::u.

Referenced by write_typed_struct_alloc_def(), and write_typed_typedef_alloc_def().

static void walk_type ( )
static
Call D->PROCESS_FIELD for every field (or subfield) of D->VAL,
   which is of type T.  Write code to D->OF to constrain execution (at
   the point that D->PROCESS_FIELD is called) to the appropriate
   cases.  Call D->PROCESS_FIELD on subobjects before calling it on
   pointers to those objects.  D->PREV_VAL lists the objects
   containing the current object, D->OPT is a list of options to
   apply, D->INDENT is the current indentation level, D->LINE is used
   to print error messages, D->BITMAP indicates which languages to
   print the structure for, and D->PARAM is the current parameter
   (from an enclosing param_is option).   

References type::a, walk_type_data::bitmap, nested_ptr_data::convert_from, nested_ptr_data::convert_to, walk_type_data::counter, create_array(), create_pointer(), error_at_line(), fileloc::file, find_param_structure(), walk_type_data::fn_wants_lvalue, free(), get_input_file_name(), walk_type_data::have_this_obj, walk_type_data::in_ptr_field, walk_type_data::in_record_p, walk_type_data::indent, options::info, options::kind, type::kind, fileloc::line, pair::line, walk_type_data::line, walk_type_data::loopcounter, options::name, pair::name, walk_type_data::needs_cast_p, options::nested, options::next, pair::next, type::next, walk_type_data::of, oprintf(), pair::opt, walk_type_data::opt, OPTION_NESTED, OPTION_STRING, output_escaped_param(), type::p, walk_type_data::param, type::param_struct, walk_type_data::prev_val, walk_type_data::process_field, walk_type_data::reorder_fn, type::s, options::string, nested_ptr_data::type, pair::type, TYPE_ARRAY, TYPE_LANG_STRUCT, TYPE_NONE, TYPE_PARAM_STRUCT, TYPE_POINTER, TYPE_SCALAR, TYPE_STRING, TYPE_STRUCT, TYPE_UNDEFINED, TYPE_UNION, TYPE_USER_STRUCT, type::u, union_or_struct_p(), walk_type_data::used_length, walk_type_data::val, walk_type(), and xasprintf().

static void write_array ( outf_p  f,
pair_p  v,
const struct write_types_data wtd 
)
static

Referenced by write_roots().

static void write_field_root ( outf_p  f,
pair_p  v,
type_p  type,
const char *  name,
int  has_length,
struct fileloc line,
const char *  if_marked,
bool  emit_pch,
type_p  field_type,
const char *  field_name 
)
static
A subroutine of write_root for writing the roots for field FIELD_NAME,
   which has type FIELD_TYPE.  Parameters F to EMIT_PCH are the parameters
   of the caller.   

References field_type(), type::kind, pair::name, pair::type, TYPE_ARRAY, and write_root().

Referenced by write_root().

static void write_local ( outf_p  output_header,
type_p  structures,
type_p  param_structs 
)
static

Referenced by main().

static void write_local_func_for_structure ( const_type_p  orig_s,
type_p  s,
type_p param 
)
static

Referenced by write_local().

static void write_local_func_for_structure ( )
static
static void write_marker_function_name ( )
static
Write on OF the name of the marker function for structure S. PREFIX
   is the prefix to use (to distinguish ggc from pch markers).   

References filter_type_name(), free(), type::kind, oprintf(), output_mangled_typename(), type::s, TYPE_PARAM_STRUCT, type::u, and union_or_struct_p().

Referenced by write_func_for_structure(), and write_user_func_for_structure_ptr().

static void write_pch_user_walking_for_structure_body ( )
static
Write a function to PCH walk all the fields of type S on OF.
   D contains data needed by walk_type to recurse into the fields of S.   

References walk_type_data::indent, walk_type_data::of, oprintf(), walk_type_data::process_field, walk_type_data::val, walk_type(), write_type_decl(), and write_types_local_user_process_field().

Referenced by write_pch_user_walking_functions().

static void write_pch_user_walking_functions ( )
static
Emit the user-callable functions needed to mark all the types used
   by the user structure S.  PREFIX is the prefix to use to
   distinguish ggc and pch markers. CHAIN_NEXT is set if S has the
   chain_next option defined.  D contains data needed to pass to
   walk_type when traversing the fields of a type.

   For every type T referenced by S, two routines are generated: one
   that takes 'T *', marks the pointer and calls the second routine,
   which just marks the fields of T.   

References type::kind, type::s, TYPE_USER_STRUCT, type::u, union_or_struct_p(), and write_pch_user_walking_for_structure_body().

Referenced by write_local_func_for_structure().

static void write_root ( outf_p  f,
pair_p  v,
type_p  type,
const char *  name,
int  has_length,
struct fileloc line,
const char *  if_marked,
bool  emit_pch 
)
static
Write out to F the table entry and any marker routines needed to
   mark NAME as TYPE.  V can be one of three values:

     - null, if NAME is too complex to represent using a single
       count and stride.  In this case, it is an error for NAME to
       contain any gc-ed data.

     - the outermost array that contains NAME, if NAME is part of an array.

     - the C variable that contains NAME, if NAME is not part of an array.

   LINE is the line of the C source that declares the root variable.
   HAS_LENGTH is nonzero iff V was a variable-length array.  IF_MARKED
   is nonzero iff we are building the root table for hash table caches.   

References type::a, error_at_line(), filter_type_name(), free(), options::info, options::kind, type::kind, options::name, pair::name, options::next, pair::next, oprintf(), pair::opt, OPTION_STRING, output_mangled_typename(), type::p, type::s, start_root_entry(), options::string, pair::type, TYPE_ARRAY, TYPE_LANG_STRUCT, TYPE_NONE, TYPE_PARAM_STRUCT, TYPE_POINTER, TYPE_SCALAR, TYPE_STRING, TYPE_STRUCT, TYPE_UNDEFINED, TYPE_UNION, TYPE_USER_STRUCT, type::u, union_or_struct_p(), write_field_root(), and xasprintf().

Referenced by write_field_root(), and write_roots().

static void write_roots ( pair_p  ,
bool   
)
static

Referenced by main().

static void write_rtx_next ( )
static
Write out the contents of the rtx_next array.   

References get_output_file_with_visibility(), NUM_RTX_CODE, oprintf(), and rtx_next_new.

Referenced by main().

static void write_splay_tree_allocator_def ( )
static
Writes a typed GC allocator for type S that is suitable as a callback for
   the splay tree implementation in libiberty.   

References get_output_file_with_visibility(), oprintf(), and output_typename().

Referenced by write_splay_tree_allocators().

static void write_splay_tree_allocators ( )
static
Writes typed GC allocators for PARAM_STRUCTS that are suitable as callbacks
   for the splay tree implementation in libiberty.   

References GC_POINTED_TO, type::gc_used, type::next, oprintf(), output_typename(), and write_splay_tree_allocator_def().

Referenced by main().

static void write_typed_alloc_def ( outf_p  f,
bool  variable_size,
const char *  type_specifier,
const char *  type_name,
const char *  allocator_type,
enum alloc_quantity  quantity 
)
static
Writes one typed allocator definition into output F for type
   identifier TYPE_NAME with optional type specifier TYPE_SPECIFIER.
   The allocator name will contain ALLOCATOR_TYPE.  If VARIABLE_SIZE
   is true, the allocator will have an extra parameter specifying
   number of bytes to allocate.  If QUANTITY is set to VECTOR, a
   vector allocator will be output.   

References filter_type_name(), free(), oprintf(), and vector.

Referenced by write_typed_struct_alloc_def(), and write_typed_typedef_alloc_def().

static void write_typed_alloc_defns ( outf_p  f,
const type_p  structures,
const pair_p  typedefs 
)
static
Writes typed allocator definitions into output F for the types in
   STRUCTURES and TYPEDEFS that are used by GC.   

References fileloc::file, input_file_st::inpisplugin, pair::name, nb_plugin_files, pair::next, type::next, oprintf(), type::s, single, pair::type, type_fileloc(), type::u, union_or_struct_p(), vector, write_typed_struct_alloc_def(), and write_typed_typedef_alloc_def().

Referenced by main().

static void write_typed_struct_alloc_def ( outf_p  f,
const type_p  s,
const char *  allocator_type,
enum alloc_quantity  quantity 
)
static
Writes a typed allocator definition into output F for a struct or
   union S, with a given ALLOCATOR_TYPE and QUANTITY for ZONE.   

References get_type_specifier(), type::s, type::u, union_or_struct_p(), variable_size_p(), and write_typed_alloc_def().

Referenced by write_typed_alloc_defns().

static void write_typed_typedef_alloc_def ( outf_p  f,
const pair_p  p,
const char *  allocator_type,
enum alloc_quantity  quantity 
)
static
Writes a typed allocator definition into output F for a typedef P,
   with a given ALLOCATOR_TYPE and QUANTITY for ZONE.   

References pair::name, pair::type, variable_size_p(), and write_typed_alloc_def().

Referenced by write_typed_alloc_defns().

static void write_types_local_process_field ( type_p  f,
const struct walk_type_data d 
)
static
static void write_types_local_user_process_field ( )
static
Write out the local pointer-walking routines.   
process_field routine for local pointer-walking for user-callable
   routines.  The difference between this and
   write_types_local_process_field is that, in this case, we do not
   need to check whether the given pointer matches the address of the
   parent structure.  This check was already generated by the call
   to gt_pch_nx in the main gt_pch_p_*() function that is calling
   this code.   

References walk_type_data::in_ptr_field, walk_type_data::indent, type::kind, walk_type_data::of, oprintf(), TYPE_ARRAY, TYPE_LANG_STRUCT, TYPE_NONE, TYPE_PARAM_STRUCT, TYPE_POINTER, TYPE_SCALAR, TYPE_STRING, TYPE_STRUCT, TYPE_UNDEFINED, TYPE_UNION, TYPE_USER_STRUCT, and walk_type_data::val.

Referenced by write_pch_user_walking_for_structure_body().

static void write_types_process_field ( type_p  f,
const struct walk_type_data d 
)
static
static void write_user_func_for_structure_body ( type_p  s,
const char *  prefix,
struct walk_type_data d 
)
static
Write a function to mark all the fields of type S on OF.  PREFIX
   and D are as in write_user_marking_functions.   

References walk_type_data::indent, walk_type_data::of, oprintf(), walk_type_data::val, walk_type(), and write_type_decl().

Referenced by write_user_marking_functions().

static void write_user_func_for_structure_ptr ( )
static
Write on OF a user-callable routine to act as an entry point for
   the marking routine for S, generated by write_func_for_structure.
   PREFIX is the prefix to use to distinguish ggc and pch markers.   

References oprintf(), type::s, type::u, union_or_struct_p(), write_marker_function_name(), and write_type_decl().

Referenced by write_user_marking_functions().

static void write_user_marking_functions ( type_p  s,
const char *  prefix,
struct walk_type_data d 
)
static
Emit the user-callable functions needed to mark all the types used
   by the user structure S.  PREFIX is the prefix to use to
   distinguish ggc and pch markers.  D contains data needed to pass to
   walk_type when traversing the fields of a type.

   For every type T referenced by S, two routines are generated: one
   that takes 'T *', marks the pointer and calls the second routine,
   which just marks the fields of T.   

References type::kind, walk_type_data::of, type::p, type::s, TYPE_POINTER, TYPE_USER_STRUCT, type::u, union_or_struct_p(), write_user_func_for_structure_body(), and write_user_func_for_structure_ptr().

Referenced by write_func_for_structure().

char* xasprintf ( )
asprintf, but produces fatal message on out-of-memory.   

References fatal().

Referenced by adjust_field_rtx_def(), create_optional_field_(), get_file_gtfilename(), open_base_files(), print_token(), type(), walk_type(), write_array(), and write_root().


Variable Documentation

const char* backup_dir
static
The backup directory should be in the same file system as the
   generated files, otherwise the rename(2) system call would fail.
   If NULL, no backup is made when overwriting a generated file.   

Referenced by close_output_files(), and parse_program_options().

outf_p* base_files
static
An array of output files suitable for definitions.  There is one
   BASE_FILES entry for each language.   

Referenced by finish_root_table().

int do_debug
Trace the execution by many DBGPRINTF (with the position inside
   gengtype source code).  Only useful to debug gengtype itself.   

Referenced by main(), and parse_program_options().

int do_dump
Variables to help debugging.   

Referenced by main(), and parse_program_options().

struct file_rule_st files_rules[]
The array of our rules governing file name generation.  Rules order
   matters, so change with extreme care!   
struct option gengtype_long_options[]
static
Initial value:
{
{"help", no_argument, NULL, 'h'},
{"version", no_argument, NULL, 'V'},
{"verbose", no_argument, NULL, 'v'},
{"dump", no_argument, NULL, 'd'},
{"debug", no_argument, NULL, 'D'},
{"plugin", required_argument, NULL, 'P'},
{"srcdir", required_argument, NULL, 'S'},
{"backupdir", required_argument, NULL, 'B'},
{"inputs", required_argument, NULL, 'I'},
{"read-state", required_argument, NULL, 'r'},
{"write-state", required_argument, NULL, 'w'},
{NULL, no_argument, NULL, 0},
}
Option specification for getopt_long.   
struct write_types_data ggc_wtd
static
Initial value:
{
"ggc_m", NULL, "ggc_mark", "ggc_test_and_set_mark", NULL,
"GC marker procedures. ",
FALSE
}
const input_file** gt_files
Input file handling.  
Table of all input files.   

Referenced by read_state_files_list(), and state_writer::write_state_files_list().

outf_p header_file
The output header file that is included into pretty much every
   source file.   

Referenced by main().

bool hit_error = false
Nonzero iff an error has occurred.   

Referenced by error_at_line(), main(), and parse_error().

htab_t input_file_htab
static
Hash table of unique input file names.   
char* inputlist
static
The name of the file containing the list of input files.   

Referenced by main(), and parse_program_options().

const char** lang_dir_names
const char* const note_insn_name[NOTE_INSN_MAX+1]
static
Initial value:
{
#define DEF_INSN_NOTE(NAME) #NAME,
#include "insn-notes.def"
#undef DEF_INSN_NOTE
}
We must allocate one more entry here, as we use NOTE_INSN_MAX as the
   default field for line number notes.   

Referenced by adjust_field_rtx_def().

outf_p output_files
Process source files and output type information.
   Copyright (C) 2002-2013 Free Software Foundation, Inc.

   This file is part of GCC.

   GCC is free software; you can redistribute it and/or modify it under
   the terms of the GNU General Public License as published by the Free
   Software Foundation; either version 3, or (at your option) any later
   version.

   GCC is distributed in the hope that it will be useful, but WITHOUT ANY
   WARRANTY; without even the implied warranty of MERCHANTABILITY or
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   for more details.

   You should have received a copy of the GNU General Public License
   along with GCC; see the file COPYING3.  If not see
   <http://www.gnu.org/licenses/>.   
Data types, macros, etc. used only in this file.   
The list of output files.   

Referenced by create_file().

struct write_types_data pch_wtd
static
Initial value:
{
"pch_n", "pch_p", "gt_pch_note_object", "gt_pch_note_object",
"gt_pch_note_reorder",
"PCH type-walking procedures. ",
TRUE
}
input_file** plugin_files
static
The plugin input files and their number; in that case only
   a single file is produced.   
outf_p plugin_output
static
The generated plugin output file and name.   

Referenced by get_output_file_with_visibility().

char* plugin_output_filename
static

Referenced by main(), and parse_program_options().

const char* read_state_filename
Variables used for reading and writing the state.   

Referenced by main(), and parse_program_options().

const char* const rtx_format[NUM_RTX_CODE]
static
Initial value:
{
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) FORMAT ,
#include "rtl.def"
#undef DEF_RTL_EXPR
}

Referenced by adjust_field_rtx_def(), and gen_rtx_next().

const char* const rtx_name[NUM_RTX_CODE]
static
Initial value:
{
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) NAME ,
#include "rtl.def"
#undef DEF_RTL_EXPR
}

Referenced by adjust_field_rtx_def(), create_pseudo_cfg(), dump_iv_info(), maybe_record_trace_start(), scan_trace(), and validate_pattern().

int rtx_next_new[NUM_RTX_CODE]
static

Referenced by gen_rtx_next(), and write_rtx_next().

struct type scalar_char
struct type scalar_nonchar
Initial value:
{
TYPE_SCALAR, 0, 0, 0, GC_USED, {0}
}
The two and only TYPE_SCALARs.  Their u.scalar_is_char flags are
   set early in main.   

Referenced by adjust_field_rtx_def(), create_scalar_type(), read_state_scalar_nonchar_type(), and state_writer::write_state_scalar_type().

htab_t seen_types
static
struct type string_type
input_file* system_h_file
The "system.h" file is likewise specially useful.   

Referenced by get_output_file_with_visibility().

input_file* this_file
A number of places use the name of this "gengtype.c" file for a
   location for things that we can't rely on the source to define.
   Make sure we can still use pointer comparison on filenames.   

Referenced by trim_filename().

int type_count
static
We have a type count and use it to set the state_number of newly
   allocated types to some unique negative number.   

Referenced by create_array(), create_pointer(), find_param_structure(), find_structure(), main(), and new_structure().

pair_p typedefs = NULL
Lists of various things.   

Referenced by do_typedef(), read_state(), and state_writer::write_state_typedefs().

const char* write_state_filename

Referenced by main(), and parse_program_options().