#include "bconfig.h"#include "system.h"#include "coretypes.h"#include "tm.h"#include "gengtype.h"#include "gtyp-gen.h"#include "errors.h"#include "rtl.def"#include "insn-notes.def"

Go to the source code of this file.
| #define CONST_DOUBLE_FORMAT "ww" |
Definition at line 385 of file gengtype.c.
| #define DEF_INSN_NOTE | ( | NAME | ) | #NAME, |
| #define DEF_INSN_NOTE | ( | NAME | ) | NAME, |
| #define DEF_RTL_EXPR | ( | ENUM, | |||
| NAME, | |||||
| FORMAT, | |||||
| CLASS | ) | FORMAT , |
| #define DEF_RTL_EXPR | ( | ENUM, | |||
| NAME, | |||||
| FORMAT, | |||||
| CLASS | ) | NAME , |
| #define DEF_RTL_EXPR | ( | ENUM, | |||
| NAME, | |||||
| FORMAT, | |||||
| CLASS | ) | ENUM , |
| #define GENERATOR_FILE |
Definition at line 429 of file gengtype.c.
| #define NUM_BASE_FILES (ARRAY_SIZE (lang_dir_names) - 1) |
Definition at line 1009 of file gengtype.c.
| #define NUM_GT_FILES (ARRAY_SIZE (all_files) - 1) |
Definition at line 1001 of file gengtype.c.
| #define NUM_LANG_FILES (ARRAY_SIZE (lang_files) - 1) |
Definition at line 1004 of file gengtype.c.
| typedef void(* func_name_fn)(type_p s, const struct walk_type_data *p) |
Definition at line 1371 of file gengtype.c.
| typedef void(* process_field_fn)(type_p f, const struct walk_type_data *p) |
Definition at line 1369 of file gengtype.c.
| enum insn_note |
Definition at line 412 of file gengtype.c.
| 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 389 of file gengtype.c.
Definition at line 478 of file gengtype.c.
References c, create_field(), create_option(), create_optional_field(), create_pointer(), create_scalar_type(), error_at_line(), find_structure(), i, type::kind, lexer_line, MEM, new_structure(), NOTE_INSN_BLOCK_BEG, NOTE_INSN_BLOCK_END, NOTE_INSN_EXPECTED_VALUE, NOTE_INSN_MAX, note_insn_name, NULL, NUM_RTX_CODE, pair::opt, REG, rtx_format, rtx_name, strlen(), TOUPPER, TYPE_UNION, xasprintf(), and xstrdup().
Definition at line 706 of file gengtype.c.
References create_field(), create_option(), error_at_line(), type::kind, lexer_line, new_structure(), NULL, pair::opt, and TYPE_ARRAY.
Definition at line 739 of file gengtype.c.
References type::a, adjust_field_rtx_def(), adjust_field_tree_exp(), create_array(), create_pointer(), error_at_line(), find_param_structure(), i, if(), options::info, ISDIGIT, type::kind, lexer_line, options::name, options::next, NULL, NUM_PARAM, type::p, type::sc, strcmp(), strncmp(), TYPE_ARRAY, TYPE_POINTER, TYPE_SCALAR, type::u, and UNION_OR_STRUCT_P.
Definition at line 1308 of file gengtype.c.
References outf::buf, outf::bufused, EOF, exit(), fclose(), fgetc(), fopen, fwrite, i, outf::name, outf::next, NULL, and perror().
| static int contains_scalar_p | ( | type_p | t | ) | [static] |
Definition at line 2467 of file gengtype.c.
References type::a, contains_scalar_p(), type::kind, TYPE_ARRAY, TYPE_POINTER, TYPE_STRING, and type::u.
Definition at line 299 of file gengtype.c.
References type::a, type::kind, TYPE_ARRAY, type::u, xcalloc(), and XCNEW.
Definition at line 343 of file gengtype.c.
References __LINE__, fileloc::file, fileloc::line, pair::line, pair::name, pair::next, NULL, pair::opt, pair::type, and XNEW.
Referenced by adjust_field_rtx_def(), adjust_field_tree_exp(), and create_optional_field().
| static outf_p create_file | ( | const char * | name, | |
| const char * | oname | |||
| ) | [static] |
Definition at line 1019 of file gengtype.c.
References ARRAY_SIZE, f, i, outf::name, outf::next, oprintf(), and XCNEW.
Definition at line 314 of file gengtype.c.
References options::info, options::name, options::next, o, and XNEW.
| static pair_p create_optional_field | ( | pair_p | next, | |
| type_p | type, | |||
| const char * | name, | |||
| const char * | cond | |||
| ) | [static] |
Definition at line 361 of file gengtype.c.
References create_field(), create_option(), lexer_line, new_structure(), NULL, pair::opt, union_type, and xasprintf().
Referenced by adjust_field_rtx_def().
Definition at line 284 of file gengtype.c.
References type::kind, type::p, type::pointer_to, r, TYPE_POINTER, type::u, xcalloc(), and XCNEW.
Definition at line 273 of file gengtype.c.
References type::kind, r, type::sc, TYPE_SCALAR, type::u, XCNEW, and xmemdup().
Definition at line 128 of file gengtype.c.
References create_scalar_type(), do_typedef(), and strlen().
Definition at line 102 of file gengtype.c.
References error_at_line(), pair::line, pair::name, pair::next, NULL, p, strcmp(), pair::type, and XNEW.
Definition at line 40 of file gengtype.c.
References fileloc::file, fprintf(), fputc(), hit_error, fileloc::line, va_end, va_start, and vfprintf().
Definition at line 249 of file gengtype.c.
References type::kind, memcmp, memcpy, type::next, NULL, type::param, type::param_struct, TYPE_PARAM_STRUCT, type::u, and XCNEW.
| type_p find_structure | ( | const char * | name, | |
| int | isunion | |||
| ) |
Definition at line 226 of file gengtype.c.
References type::kind, type::next, NULL, s, type::s, strcmp(), TYPE_STRUCT, TYPE_UNION, type::u, UNION_P, and XCNEW.
| static void finish_root_table | ( | struct flist * | flp, | |
| const char * | pfx, | |||
| const char * | tname, | |||
| const char * | lastname, | |||
| const char * | name | |||
| ) | [static] |
Definition at line 2501 of file gengtype.c.
References flist::f, get_base_file_bitmap(), flist::name, flist::next, NUM_BASE_FILES, oprintf(), put_mangled_filename(), and flist::started_p.
Definition at line 435 of file gengtype.c.
References i, NUM_RTX_CODE, rtx_format, rtx_next_new, SET, strlen(), and strncmp().
| unsigned get_base_file_bitmap | ( | const char * | input_file | ) |
Definition at line 1165 of file gengtype.c.
References 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().
| static const char * get_file_basename | ( | const char * | f | ) | [static] |
Definition at line 1122 of file gengtype.c.
References basename, fatal(), i, IS_DIR_SEPARATOR, l1, l2, lang_dir_names, memcmp, NUM_BASE_FILES, s1, s2, strlen(), and strrchr().
| const char* get_output_file_name | ( | const char * | input_file | ) |
Definition at line 1299 of file gengtype.c.
References get_output_file_with_visibility(), and outf::name.
| outf_p get_output_file_with_visibility | ( | const char * | input_file | ) |
Definition at line 1218 of file gengtype.c.
References basename, create_file(), get_file_basename(), i, IS_DIR_SEPARATOR, ISALNUM, lang_dir_names, len, memcmp, memcpy, outf::name, outf::next, NULL, NUM_BASE_FILES, r, s, strcmp(), strlen(), strncmp(), and xasprintf().
| int main | ( | int | ARG_UNUSEDargc, | |
| char ** | ARG_UNUSEDargv | |||
| ) |
Definition at line 3029 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(), resolve_typedef(), set_gc_used(), srcdir, strcmp(), strlen(), write_enum_defn(), write_local(), write_roots(), write_rtx_next(), and write_types().
| int main | ( | int | argc, | |
| char ** | argv | |||
| ) |
Definition at line 2389 of file confidence.c.
| type_p new_structure | ( | const char * | name, | |
| int | isunion, | |||
| struct fileloc * | pos, | |||
| pair_p | fields, | |||
| options_p | o | |||
| ) |
Definition at line 150 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 XCNEW.
Definition at line 327 of file gengtype.c.
References pair::line, n, pair::name, pair::next, pair::opt, pair::type, and XNEW.
Definition at line 818 of file gengtype.c.
References do_typedef(), error_at_line(), find_structure(), options::info, pair::line, pair::name, new_structure(), pair::next, NULL, ok(), pair::opt, p, strcmp(), and pair::type.
Definition at line 1088 of file gengtype.c.
References create_file(), i, lang_dir_names, NULL, NUM_BASE_FILES, oprintf(), and xasprintf().
Definition at line 1059 of file gengtype.c.
References outf::buf, outf::buflength, outf::bufused, free(), memcpy, s, va_end, va_start, XRESIZEVEC, and xvasprintf().
| static void output_escaped_param | ( | struct walk_type_data * | d, | |
| const char * | param, | |||
| const char * | oname | |||
| ) | [static] |
Definition at line 1481 of file gengtype.c.
References error_at_line(), walk_type_data::line, walk_type_data::of, oprintf(), p, walk_type_data::prev_val, strlen(), and walk_type_data::val.
Definition at line 1440 of file gengtype.c.
References gcc_unreachable, i, type::kind, NULL, NUM_PARAM, oprintf(), output_mangled_typename(), 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.
Definition at line 2008 of file gengtype.c.
References type::kind, NULL, oprintf(), output_mangled_typename(), type::s, TYPE_PARAM_STRUCT, type::u, and UNION_OR_STRUCT_P.
Referenced by write_func_for_structure().
| static void process_gc_options | ( | options_p | opt, | |
| enum gc_used_enum | level, | |||
| int * | maybe_undef, | |||
| int * | pass_param, | |||
| int * | length, | |||
| type_p * | nested_ptr | |||
| ) | [static] |
Definition at line 881 of file gengtype.c.
References GC_POINTED_TO, options::info, options::name, options::next, NULL, o, set_gc_used_type(), and strcmp().
Definition at line 2486 of file gengtype.c.
References get_output_file_name(), ISALNUM, and oprintf().
Definition at line 136 of file gengtype.c.
References create_scalar_type(), error_at_line(), pair::name, pair::next, NULL, p, strcmp(), and pair::type.
Definition at line 982 of file gengtype.c.
References GC_USED, pair::next, NULL, p, set_gc_used_type(), and pair::type.
| static void set_gc_used_type | ( | type_p | t, | |
| enum gc_used_enum | level, | |||
| type_p | param[NUM_PARAM] | |||
| ) | [static] |
Definition at line 901 of file gengtype.c.
References type::a, f, find_param_structure(), GC_MAYBE_POINTED_TO, GC_POINTED_TO, GC_UNUSED, GC_USED, type::gc_used, i, type::kind, length, pair::next, type::next, NULL, 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_UNION, and type::u.
| static void walk_type | ( | type_p | t, | |
| struct walk_type_data * | d | |||
| ) | [static] |
Definition at line 1527 of file gengtype.c.
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(), dot, error_at_line(), fileloc::file, find_param_structure(), walk_type_data::fn_wants_lvalue, fprintf(), free(), gcc_unreachable, if(), walk_type_data::indent, options::info, ISDIGIT, type::kind, length, fileloc::line, walk_type_data::line, pair::line, pair::name, options::name, walk_type_data::needs_cast_p, options::next, pair::next, type::next, NULL, o, walk_type_data::of, oprintf(), walk_type_data::opt, pair::opt, 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, strcmp(), strncmp(), nested_ptr_data::type, 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, 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] |
Definition at line 2731 of file gengtype.c.
References walk_type_data::bitmap, walk_type_data::cookie, fileloc::file, free(), get_base_file_bitmap(), walk_type_data::indent, walk_type_data::line, pair::line, memset, pair::name, NULL, walk_type_data::of, oprintf(), walk_type_data::opt, pair::opt, walk_type_data::param, write_types_data::param_prefix, write_types_data::prefix, walk_type_data::prev_val, walk_type_data::process_field, pair::type, walk_type_data::val, walk_type(), write_types_local_process_field(), write_types_process_field(), and xasprintf().
Definition at line 2435 of file gengtype.c.
References GC_MAYBE_POINTED_TO, GC_POINTED_TO, type::gc_used, type::next, NULL, oprintf(), output_mangled_typename(), type::s, and type::u.
| static void write_func_for_structure | ( | type_p | orig_s, | |
| type_p | s, | |||
| type_p * | param, | |||
| const struct write_types_data * | wtd | |||
| ) | [static] |
Definition at line 2033 of file gengtype.c.
References walk_type_data::bitmap, walk_type_data::cookie, error_at_line(), get_output_file_with_visibility(), i, walk_type_data::indent, options::info, type::kind, walk_type_data::line, write_types_data::marker_routine, memset, options::name, options::next, NULL, NUM_PARAM, walk_type_data::of, oprintf(), opt, walk_type_data::opt, walk_type_data::orig_s, output_escaped_param(), output_mangled_typename(), output_type_enum(), type::p, walk_type_data::param, write_types_data::param_prefix, write_types_data::prefix, walk_type_data::prev_val, walk_type_data::process_field, type::s, strcmp(), TYPE_POINTER, TYPE_UNION, type::u, UNION_OR_STRUCT_P, walk_type_data::val, walk_type(), and write_types_process_field().
Definition at line 2350 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(), walk_type_data::param, type::param_struct, type::s, ss, strcmp(), TYPE_LANG_STRUCT, TYPE_STRUCT, TYPE_UNION, type::u, and write_local_func_for_structure().
Definition at line 2304 of file gengtype.c.
References walk_type_data::bitmap, walk_type_data::fn_wants_lvalue, get_output_file_with_visibility(), i, walk_type_data::indent, type::kind, walk_type_data::line, memset, NUM_PARAM, walk_type_data::of, oprintf(), walk_type_data::opt, output_mangled_typename(), type::p, walk_type_data::param, walk_type_data::prev_val, walk_type_data::process_field, type::s, TYPE_POINTER, TYPE_UNION, type::u, UNION_OR_STRUCT_P, walk_type_data::val, walk_type(), and write_types_local_process_field().
| 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 | |||
| ) | [static] |
Definition at line 2572 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, write_root(), and xasprintf().
Definition at line 2781 of file gengtype.c.
References contains_scalar_p(), error_at_line(), flist::f, fileloc::file, find_structure(), finish_root_table(), get_output_file_with_visibility(), 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, type::p, type::param_struct, put_mangled_filename(), flist::started_p, strcmp(), strncmp(), pair::type, TYPE_PARAM_STRUCT, TYPE_POINTER, TYPE_STRUCT, type::u, write_array(), write_root(), and XNEW.
Definition at line 456 of file gengtype.c.
References f, get_output_file_with_visibility(), i, NULL, NUM_RTX_CODE, oprintf(), and rtx_next_new.
| static void write_types | ( | type_p | structures, | |
| type_p | param_structs, | |||
| const struct write_types_data * | wtd | |||
| ) | [static] |
Definition at line 2162 of file gengtype.c.
References write_types_data::comment, 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(), walk_type_data::param, type::param_struct, write_types_data::prefix, type::s, ss, strcmp(), TYPE_LANG_STRUCT, TYPE_STRUCT, TYPE_UNION, type::u, and write_func_for_structure().
| static void write_types_local_process_field | ( | type_p | f, | |
| const struct walk_type_data * | d | |||
| ) | [static] |
Definition at line 2274 of file gengtype.c.
References gcc_unreachable, walk_type_data::indent, type::kind, walk_type_data::of, oprintf(), walk_type_data::prev_val, TYPE_LANG_STRUCT, TYPE_PARAM_STRUCT, TYPE_POINTER, TYPE_SCALAR, TYPE_STRING, TYPE_STRUCT, TYPE_UNION, and walk_type_data::val.
| static void write_types_process_field | ( | type_p | f, | |
| const struct walk_type_data * | d | |||
| ) | [static] |
Definition at line 1936 of file gengtype.c.
References walk_type_data::cookie, gcc_unreachable, walk_type_data::indent, type::kind, walk_type_data::needs_cast_p, NULL, walk_type_data::of, oprintf(), walk_type_data::orig_s, output_mangled_typename(), type::p, write_types_data::param_prefix, write_types_data::prefix, walk_type_data::prev_val, walk_type_data::reorder_fn, write_types_data::reorder_note_routine, type::s, write_types_data::subfield_marker_routine, TYPE_LANG_STRUCT, TYPE_PARAM_STRUCT, TYPE_POINTER, TYPE_SCALAR, TYPE_STRING, TYPE_STRUCT, TYPE_UNION, type::u, UNION_OR_STRUCT_P, and walk_type_data::val.
| char* xasprintf | ( | const char * | format, | |
| ... | ||||
| ) |
| int xvasprintf | ( | char ** | result, | |
| const char * | format, | |||
| va_list | args | |||
| ) |
| outf_p base_files[NUM_BASE_FILES] |
Definition at line 1010 of file gengtype.c.
struct write_types_data ggc_wtd [static] |
Initial value:
Definition at line 2256 of file gengtype.c.
outf_p header_file [static] |
Definition at line 998 of file gengtype.c.
int hit_error = 0 [static] |
Definition at line 30 of file gengtype.c.
const char* const note_insn_name[NOTE_INSN_MAX+1] [static] |
Definition at line 422 of file gengtype.c.
outf_p output_files [static] |
Definition at line 994 of file gengtype.c.
type_p param_structs [static] |
Definition at line 90 of file gengtype.c.
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. "
}
Definition at line 2262 of file gengtype.c.
const char* const rtx_format[NUM_RTX_CODE] [static] |
Definition at line 402 of file gengtype.c.
const char* const rtx_name[NUM_RTX_CODE] [static] |
Definition at line 396 of file gengtype.c.
int rtx_next_new[NUM_RTX_CODE] [static] |
Definition at line 408 of file gengtype.c.
int srcdir_len = 0 [static] |
Definition at line 1007 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