#include "hconfig.h"#include "system.h"#include "gengtype.h"#include "gtyp-gen.h"#include "rtl.def"

Go to the source code of this file.
Data Types | |
| type | flist |
Defines | |
| #define | DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) ENUM , |
| #define | CONST_DOUBLE_FORMAT "ww" |
| #define | DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) FORMAT , |
| #define | DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) NAME , |
| #define | NUM_GT_FILES (ARRAY_SIZE (all_files) - 1) |
| #define | NUM_LANG_FILES (ARRAY_SIZE (lang_files) - 1) |
| #define | NUM_BASE_FILES (ARRAY_SIZE (lang_dir_names) - 1) |
Enumerations | |
| enum | rtx_code { DEF_RTL_EXPR, DEF_RTL_EXPR, DEF_RTL_EXPR, DEF_RTL_EXPR, DEF_RTL_EXPR, DEF_RTL_EXPR, DEF_RTL_EXPR, DEF_RTL_EXPR } |
Functions/Subroutines | |
| static void gen_rtx_next | PARAMS ((void)) |
| void error_at_line | VPARAMS ((struct fileloc *pos, const char *msg,...)) |
| int | xvasprintf (char **result, const char *format, va_list args) |
| char *xasprintf | VPARAMS ((const char *format,...)) |
| static void do_scalar_typedef | PARAMS ((const char *, struct fileloc *)) |
| static type_p find_param_structure | PARAMS ((type_p t, type_p param[NUM_PARAM])) |
| static type_p adjust_field_tree_exp | PARAMS ((type_p t, options_p opt)) |
| void | do_typedef (char *s, type_p t, struct fileloc *pos) const |
| static void | do_scalar_typedef (char *s, struct fileloc *pos) const |
| type_p | resolve_typedef (char *s, struct fileloc *pos) const |
| void | new_structure (char *name, int isunion, struct fileloc *pos, pair_p fields, options_p o) const |
| type_p | find_structure (char *name, int isunion) const |
| static type_p | find_param_structure (type_p t, param) |
| type_p | create_scalar_type (char *name, size_t name_len) const |
| type_p | create_pointer (type_p t) |
| type_p | create_array (type_p t, const char *len) |
| void | note_variable (char *s, type_p t, options_p o, struct fileloc *pos) const |
| static void | gen_rtx_next () |
| static void | write_rtx_next () |
| static type_p | adjust_field_rtx_def (type_p t, opt) |
| static type_p | adjust_field_tree_exp (type_p t, opt) |
| type_p | adjust_field_type (type_p t, options_p opt) |
| void | note_yacc_type (options_p o, pair_p fields, pair_p typeinfo, struct fileloc *pos) |
| static void process_gc_options | PARAMS ((options_p, enum gc_used_enum, int *, int *, int *)) |
| static void set_gc_used_type | PARAMS ((type_p, enum gc_used_enum, type_p *)) |
| static void set_gc_used | PARAMS ((pair_p)) |
| static void | process_gc_options (options_p opt, enum gc_used_enum level, int *maybe_undef, int *pass_param, int *length) |
| static void | set_gc_used_type (type_p t, enum gc_used_enum level, param) |
| static void | set_gc_used (pair_p variables) |
| static outf_p create_file | PARAMS ((const char *, const char *)) |
| static const char *get_file_basename | PARAMS ((const char *)) |
| static outf_p | create_file (char *name, const char *oname) const |
| void oprintf | VPARAMS ((outf_p o, const char *format,...)) |
| static void | open_base_files () |
| static const char * | get_file_basename (char *f) const |
| unsigned | get_base_file_bitmap (char *input_file) const |
| outf_p | get_output_file_with_visibility (char *input_file) const |
| const char * | get_output_file_name (char *input_file) const |
| static void | close_output_files () |
| static void output_escaped_param | PARAMS ((outf_p, const char *, const char *, const char *, const char *, struct fileloc *)) |
| static void output_mangled_typename | PARAMS ((outf_p, type_p)) |
| static void write_gc_structure_fields | PARAMS ((outf_p, type_p, const char *, const char *, options_p, int, struct fileloc *, lang_bitmap, type_p *)) |
| static void write_gc_marker_routine_for_structure | PARAMS ((type_p, type_p, type_p *)) |
| static void write_gc_types | PARAMS ((type_p structures, type_p param_structs)) |
| static void put_mangled_filename | PARAMS ((outf_p, const char *)) |
| static void finish_root_table | PARAMS ((struct flist *flp, const char *pfx, const char *tname, const char *lastname, const char *name)) |
| static void write_gc_root | PARAMS ((outf_p, pair_p, type_p, const char *, int, struct fileloc *, const char *)) |
| static void | output_escaped_param (outf_p of, const char *param, const char *val, const char *prev_val, const char *oname, struct fileloc *line) |
| static void | output_mangled_typename (outf_p of, type_p t) |
| static void | write_gc_structure_fields (outf_p of, type_p s, const char *val, const char *prev_val, options_p opts, int indent, struct fileloc *line, lang_bitmap bitmap, type_p *param) |
| static void | write_gc_marker_routine_for_structure (type_p orig_s, type_p s, type_p *param) |
| static void | write_gc_types (type_p structures, type_p param_structs) |
| static void | write_enum_defn (type_p structures, type_p param_structs) |
| static void | put_mangled_filename (outf_p f, const char *fn) |
| static void | finish_root_table (struct flist *flp, const char *pfx, const char *lastname, const char *tname, const char *name) |
| static void | write_gc_root (outf_p f, pair_p v, type_p type, const char *name, int has_length, struct fileloc *line, const char *if_marked) |
| static void | write_gc_roots (pair_p variables) |
| int main | PARAMS ((int argc, char **argv)) |
| int | main (argc, argv) |
Variables | |
| static int | hit_error = 0 |
| struct type | string_type |
| static pair_p | typedefs |
| static type_p | structures |
| static type_p | param_structs |
| static pair_p | variables |
| static const char *const | rtx_format [NUM_RTX_CODE] |
| static int | rtx_next [NUM_RTX_CODE] |
| static outf_p | output_files |
| outf_p | header_file |
| static int | srcdir_len = 0 |
| outf_p | base_files [NUM_BASE_FILES] |
| static int | gc_counter |
| #define CONST_DOUBLE_FORMAT "ww" |
| #define DEF_RTL_EXPR | ( | ENUM, | |||
| NAME, | |||||
| FORMAT, | |||||
| CLASS | ) | NAME , |
| #define DEF_RTL_EXPR | ( | ENUM, | |||
| NAME, | |||||
| FORMAT, | |||||
| CLASS | ) | FORMAT , |
| #define DEF_RTL_EXPR | ( | ENUM, | |||
| NAME, | |||||
| FORMAT, | |||||
| CLASS | ) | ENUM , |
| #define NUM_BASE_FILES (ARRAY_SIZE (lang_dir_names) - 1) |
Definition at line 1022 of file gengtype.c.
Referenced by finish_root_table(), get_base_file_bitmap(), get_file_basename(), get_output_file_with_visibility(), and open_base_files().
| #define NUM_GT_FILES (ARRAY_SIZE (all_files) - 1) |
| #define NUM_LANG_FILES (ARRAY_SIZE (lang_files) - 1) |
| enum rtx_code |
| DEF_RTL_EXPR | |
| DEF_RTL_EXPR | |
| DEF_RTL_EXPR | |
| DEF_RTL_EXPR | |
| DEF_RTL_EXPR | |
| DEF_RTL_EXPR | |
| DEF_RTL_EXPR | |
| DEF_RTL_EXPR |
Definition at line 348 of file gengtype.c.
Definition at line 412 of file gengtype.c.
References __LINE__, c, create_pointer(), create_scalar_type(), error_at_line(), fileloc::file, find_structure(), i, options::info, lexer_line, fileloc::line, pair::line, MEM, pair::name, options::name, new_structure(), options::next, pair::next, NULL, NUM_RTX_CODE, pair::opt, REG, rtx_name, strlen(), TOUPPER, pair::type, TYPE_ARRAY, xasprintf(), xmalloc(), and xstrdup().
Referenced by adjust_field_type().
Definition at line 644 of file gengtype.c.
References __LINE__, type::a, ARRAY_SIZE, create_pointer(), error_at_line(), fileloc::file, find_structure(), i, options::info, lexer_line, fileloc::line, pair::line, pair::name, options::name, new_structure(), options::next, pair::next, NULL, pair::opt, r_index, pair::type, TYPE_ARRAY, type::u, xasprintf(), and xmalloc().
Referenced by adjust_field_type().
Definition at line 1313 of file gengtype.c.
References outf::buf, outf::bufused, EOF, exit(), fclose(), fgetc(), fopen, fwrite, i, outf::name, outf::next, NULL, and perror().
Referenced by main().
Definition at line 315 of file gengtype.c.
Referenced by adjust_field_type(), main(), walk_type(), write_gc_structure_fields(), and yyparse().
| static outf_p create_file | ( | char * | name, | |
| const char * | oname | |||
| ) | const [static] |
Definition at line 1032 of file gengtype.c.
References ARRAY_SIZE, f, i, outf::name, outf::next, oprintf(), and xcalloc().
Referenced by get_output_file_with_visibility(), open_base_files(), test_for_changes(), and write_replacement().
Definition at line 299 of file gengtype.c.
Referenced by adjust_field_rtx_def(), adjust_field_tree_exp(), adjust_field_type(), main(), walk_type(), write_gc_structure_fields(), and yyparse().
Definition at line 286 of file gengtype.c.
References type::kind, r, type::sc, TYPE_SCALAR, type::u, xcalloc(), and xmemdup().
Referenced by adjust_field_rtx_def(), do_scalar_typedef(), main(), resolve_typedef(), and yyparse().
Definition at line 131 of file gengtype.c.
References create_scalar_type(), do_typedef(), and strlen().
Referenced by main().
Definition at line 102 of file gengtype.c.
References error_at_line(), pair::line, pair::name, pair::next, NULL, p, strcmp(), pair::type, and xmalloc().
Referenced by do_scalar_typedef(), main(), note_yacc_type(), and yyparse().
Definition at line 260 of file gengtype.c.
References type::kind, memcmp, memcpy, type::next, NULL, type::param, type::param_struct, TYPE_PARAM_STRUCT, type::u, and xcalloc().
Referenced by adjust_field_type(), set_gc_used_type(), walk_type(), and write_gc_structure_fields().
| type_p find_structure | ( | char * | name, | |
| int | isunion | |||
| ) | const |
Definition at line 235 of file gengtype.c.
References type::kind, type::next, NULL, s, type::s, strcmp(), TYPE_STRUCT, TYPE_UNION, type::u, UNION_P, and xcalloc().
Referenced by adjust_field_rtx_def(), adjust_field_tree_exp(), note_yacc_type(), write_gc_roots(), write_roots(), and yyparse().
| static void finish_root_table | ( | struct flist * | flp, | |
| const char * | pfx, | |||
| const char * | lastname, | |||
| const char * | tname, | |||
| const char * | name | |||
| ) | [static] |
Definition at line 2123 of file gengtype.c.
References flist::f, get_base_file_bitmap(), flist::name, flist::next, oprintf(), put_mangled_filename(), and flist::started_p.
Referenced by write_gc_roots(), and write_roots().
Definition at line 369 of file gengtype.c.
References i, NUM_RTX_CODE, SET, strlen(), and strncmp().
Referenced by main().
| unsigned get_base_file_bitmap | ( | char * | input_file | ) | const |
Definition at line 1183 of file gengtype.c.
References abort, basename, get_file_basename(), i, lang_dir_names, lang_files, langs_for_lang_files, memcmp, NUM_BASE_FILES, NUM_LANG_FILES, strchr, strcmp(), and strlen().
Referenced by finish_root_table(), new_structure(), and write_array().
| static const char* get_file_basename | ( | char * | f | ) | const [static] |
Definition at line 1137 of file gengtype.c.
References abort, basename, i, l1, l2, lang_dir_names, len, memcmp, NUM_BASE_FILES, s1, s2, strlen(), and strrchr().
Referenced by get_base_file_bitmap(), and get_output_file_with_visibility().
| const char* get_output_file_name | ( | char * | input_file | ) | const |
Definition at line 1301 of file gengtype.c.
References get_output_file_with_visibility(), and outf::name.
Referenced by put_mangled_filename().
| outf_p get_output_file_with_visibility | ( | char * | input_file | ) | const |
Definition at line 1236 of file gengtype.c.
References basename, create_file(), get_file_basename(), i, ISALNUM, lang_dir_names, len, memcmp, memcpy, outf::name, outf::next, NULL, NUM_BASE_FILES, r, s, strcmp(), strlen(), and xasprintf().
Referenced by get_output_file_name(), write_func_for_structure(), write_gc_marker_routine_for_structure(), write_gc_roots(), write_local_func_for_structure(), write_roots(), and write_rtx_next().
| int main | ( | argc | , | |
| argv | ||||
| ) |
Definition at line 2571 of file gengtype.c.
References __LINE__, all_files, close_output_files(), create_array(), create_pointer(), create_scalar_type(), do_scalar_typedef(), do_typedef(), exit(), gen_rtx_next(), hit_error, i, NUM_GT_FILES, open_base_files(), parse_file(), set_gc_used(), srcdir, strcmp(), strlen(), write_enum_defn(), write_gc_roots(), write_gc_types(), and write_rtx_next().
| void new_structure | ( | char * | name, | |
| int | isunion, | |||
| struct fileloc * | pos, | |||
| pair_p | fields, | |||
| options_p | o | |||
| ) | const |
Definition at line 157 of file gengtype.c.
References error_at_line(), fileloc::file, get_base_file_bitmap(), type::kind, memcpy, type::next, NULL, type::pointer_to, s, type::s, si, strcmp(), TYPE_LANG_STRUCT, TYPE_STRUCT, TYPE_UNION, type::u, UNION_P, and xcalloc().
Referenced by adjust_field_rtx_def(), adjust_field_tree_exp(), create_optional_field(), note_yacc_type(), and yyparse().
Definition at line 332 of file gengtype.c.
References pair::line, n, pair::name, pair::next, pair::opt, pair::type, and xmalloc().
Referenced by yyparse().
Definition at line 1104 of file gengtype.c.
References create_file(), i, lang_dir_names, NULL, NUM_BASE_FILES, oprintf(), and xasprintf().
Referenced by main().
| static void output_escaped_param | ( | outf_p | of, | |
| const char * | param, | |||
| const char * | val, | |||
| const char * | prev_val, | |||
| const char * | oname, | |||
| struct fileloc * | line | |||
| ) | [static] |
Definition at line 1393 of file gengtype.c.
References error_at_line(), oprintf(), p, and strlen().
Referenced by walk_type(), write_func_for_structure(), write_gc_marker_routine_for_structure(), and write_gc_structure_fields().
Definition at line 1435 of file gengtype.c.
References abort, i, type::kind, NULL, NUM_PARAM, oprintf(), type::p, type::param_struct, type::s, strlen(), TYPE_ARRAY, TYPE_LANG_STRUCT, TYPE_PARAM_STRUCT, TYPE_POINTER, TYPE_SCALAR, TYPE_STRING, TYPE_STRUCT, TYPE_UNION, and type::u.
Referenced by output_mangled_typename(), output_type_enum(), write_enum_defn(), write_func_for_structure(), write_gc_marker_routine_for_structure(), write_gc_root(), write_gc_roots(), write_gc_structure_fields(), write_gc_types(), write_local(), write_local_func_for_structure(), write_root(), write_types(), and write_types_process_field().
| int main PARAMS | ( | (int argc, char **argv) | ) |
| static void write_gc_root PARAMS | ( | (outf_p, pair_p, type_p, const char *, int, struct fileloc *, const char *) | ) | [static] |
| static void finish_root_table PARAMS | ( | (struct flist *flp, const char *pfx, const char *tname, const char *lastname, const char *name) | ) | [static] |
| static void write_gc_types PARAMS | ( | (type_p structures, type_p param_structs) | ) | [static] |
| static void write_gc_structure_fields PARAMS | ( | (outf_p, type_p, const char *, const char *, options_p, int, struct fileloc *, lang_bitmap, type_p *) | ) | [static] |
| static void output_escaped_param PARAMS | ( | (outf_p, const char *, const char *, const char *, const char *, struct fileloc *) | ) | [static] |
| static const char* get_file_basename PARAMS | ( | (const char *) | ) | [static] |
Definition at line 635 of file mips-tfile.c.
| static outf_p create_file PARAMS | ( | (const char *, const char *) | ) | [static] |
| static void set_gc_used_type PARAMS | ( | (type_p, enum gc_used_enum, type_p *) | ) | [static] |
| static void process_gc_options PARAMS | ( | (options_p, enum gc_used_enum, int *, int *, int *) | ) | [static] |
Definition at line 77 of file cplus-dem.c.
| static void process_gc_options | ( | options_p | opt, | |
| enum gc_used_enum | level, | |||
| int * | maybe_undef, | |||
| int * | pass_param, | |||
| int * | length | |||
| ) | [static] |
Definition at line 894 of file gengtype.c.
References GC_POINTED_TO, options::info, options::name, options::next, NULL, o, set_gc_used_type(), and strcmp().
Referenced by set_gc_used_type().
Definition at line 2106 of file gengtype.c.
References get_output_file_name(), ISALNUM, and oprintf().
Referenced by finish_root_table(), write_gc_roots(), and write_roots().
Definition at line 141 of file gengtype.c.
References create_scalar_type(), error_at_line(), pair::name, pair::next, NULL, p, strcmp(), and pair::type.
Definition at line 994 of file gengtype.c.
References GC_USED, pair::next, NULL, p, set_gc_used_type(), and pair::type.
Referenced by main().
| static void set_gc_used_type | ( | type_p | t, | |
| enum gc_used_enum | level, | |||
| param | ||||
| ) | [static] |
Definition at line 916 of file gengtype.c.
References f, find_param_structure(), GC_MAYBE_POINTED_TO, GC_POINTED_TO, GC_UNUSED, GC_USED, i, type::kind, length, pair::next, NULL, pair::opt, type::p, process_gc_options(), pair::type, TYPE_ARRAY, TYPE_LANG_STRUCT, TYPE_PARAM_STRUCT, TYPE_POINTER, TYPE_STRUCT, TYPE_UNION, and type::u.
Referenced by process_gc_options(), set_gc_used(), and set_gc_used_type().
Definition at line 1074 of file gengtype.c.
References outf::buf, outf::buflength, outf::bufused, free(), memcpy, s, VA_CLOSE, VA_FIXEDARG, VA_OPEN, xrealloc(), and xvasprintf().
| char* xasprintf VPARAMS | ( | (const char *format,...) | ) |
Definition at line 69 of file gengtype.c.
References result, VA_CLOSE, VA_FIXEDARG, VA_OPEN, and xvasprintf().
Definition at line 37 of file gengtype.c.
References fileloc::file, fprintf(), fputc(), hit_error, fileloc::line, VA_CLOSE, VA_FIXEDARG, VA_OPEN, and vfprintf().
Definition at line 2071 of file gengtype.c.
References GC_MAYBE_POINTED_TO, GC_POINTED_TO, type::gc_used, type::next, NULL, oprintf(), output_mangled_typename(), s, type::s, and type::u.
Referenced by main().
| static void write_gc_marker_routine_for_structure | ( | type_p | orig_s, | |
| type_p | s, | |||
| type_p * | param | |||
| ) | [static] |
Definition at line 1878 of file gengtype.c.
References error_at_line(), f, get_output_file_with_visibility(), i, if(), options::info, type::kind, options::name, options::next, NULL, NUM_PARAM, oprintf(), opt, output_escaped_param(), output_mangled_typename(), type::p, type::s, strcmp(), TYPE_POINTER, TYPE_UNION, type::u, UNION_OR_STRUCT_P, and write_gc_structure_fields().
Referenced by write_gc_types().
| static void write_gc_root | ( | outf_p | f, | |
| pair_p | v, | |||
| type_p | type, | |||
| const char * | name, | |||
| int | has_length, | |||
| struct fileloc * | line, | |||
| const char * | if_marked | |||
| ) | [static] |
Definition at line 2200 of file gengtype.c.
References type::a, error_at_line(), free(), options::info, type::kind, pair::name, options::name, options::next, pair::next, NULL, o, oprintf(), pair::opt, output_mangled_typename(), type::p, type::s, strcmp(), tag, pair::type, TYPE_ARRAY, TYPE_PARAM_STRUCT, TYPE_POINTER, TYPE_SCALAR, TYPE_STRING, TYPE_STRUCT, TYPE_UNION, type::u, UNION_OR_STRUCT_P, and xasprintf().
Referenced by write_gc_root(), and write_gc_roots().
Definition at line 2350 of file gengtype.c.
References error_at_line(), flist::f, f, fileloc::file, find_structure(), finish_root_table(), get_output_file_with_visibility(), if(), options::info, ISDIGIT, type::kind, length, pair::line, pair::name, flist::name, options::name, options::next, flist::next, pair::next, NULL, o, oprintf(), pair::opt, output_mangled_typename(), type::p, type::param_struct, put_mangled_filename(), s, type::s, flist::started_p, strcmp(), strncmp(), pair::type, TYPE_PARAM_STRUCT, TYPE_POINTER, TYPE_STRUCT, TYPE_UNION, type::u, UNION_OR_STRUCT_P, write_gc_root(), write_gc_structure_fields(), and xmalloc().
Referenced by main().
| static void write_gc_structure_fields | ( | outf_p | of, | |
| type_p | s, | |||
| const char * | val, | |||
| const char * | prev_val, | |||
| options_p | opts, | |||
| int | indent, | |||
| struct fileloc * | line, | |||
| lang_bitmap | bitmap, | |||
| type_p * | param | |||
| ) | [static] |
Definition at line 1480 of file gengtype.c.
References type::a, create_array(), create_pointer(), dot, error_at_line(), f, find_param_structure(), free(), i, if(), options::info, ISDIGIT, type::kind, len, length, pair::line, pair::name, options::name, options::next, pair::next, type::next, NULL, oprintf(), pair::opt, output_escaped_param(), output_mangled_typename(), type::p, type::s, sprintf(), strcmp(), strlen(), strncmp(), ti, pair::type, TYPE_ARRAY, TYPE_LANG_STRUCT, TYPE_PARAM_STRUCT, TYPE_POINTER, TYPE_SCALAR, TYPE_STRING, TYPE_STRUCT, TYPE_UNION, type::u, UNION_OR_STRUCT_P, UNION_P, xasprintf(), and xmalloc().
Referenced by write_gc_marker_routine_for_structure(), write_gc_roots(), and write_gc_structure_fields().
Definition at line 1974 of file gengtype.c.
References error_at_line(), fprintf(), GC_MAYBE_POINTED_TO, GC_POINTED_TO, type::gc_used, if(), options::info, type::kind, options::name, options::next, type::next, NULL, oprintf(), opt, output_mangled_typename(), type::param_struct, s, type::s, ss, strcmp(), TYPE_LANG_STRUCT, TYPE_STRUCT, TYPE_UNION, type::u, and write_gc_marker_routine_for_structure().
Referenced by main().
Definition at line 390 of file gengtype.c.
References f, get_output_file_with_visibility(), i, NULL, NUM_RTX_CODE, and oprintf().
Referenced by main().
| int xvasprintf | ( | char ** | result, | |
| const char * | format, | |||
| va_list | args | |||
| ) |
Definition at line 53 of file gengtype.c.
References fputs(), NULL, ret, vasprintf(), and xexit().
Referenced by oprintf(), VPARAMS(), and xasprintf().
| outf_p base_files[NUM_BASE_FILES] |
Definition at line 1023 of file gengtype.c.
int gc_counter [static] |
Definition at line 1386 of file gengtype.c.
Definition at line 1011 of file gengtype.c.
int hit_error = 0 [static] |
outf_p output_files [static] |
Definition at line 1007 of file gengtype.c.
type_p param_structs [static] |
Definition at line 90 of file gengtype.c.
const char* const rtx_format[NUM_RTX_CODE] [static] |
Definition at line 357 of file gengtype.c.
Referenced by adjust_field_rtx_def(), and gen_rtx_next().
int rtx_next[NUM_RTX_CODE] [static] |
Definition at line 363 of file gengtype.c.
int srcdir_len = 0 [static] |
Definition at line 1020 of file gengtype.c.
Initial value:
{
TYPE_STRING, NULL, NULL, GC_USED
UNION_INIT_ZERO
}
Definition at line 81 of file gengtype.c.
type_p structures [static] |
Definition at line 89 of file gengtype.c.
Definition at line 88 of file gengtype.c.
Definition at line 91 of file gengtype.c.
1.5.6