GCC Middle and Back End API Reference
|
#include <read-md.h>
Public Member Functions | |
noop_reader () | |
void | handle_unknown_directive (file_location, const char *) override |
bool | read_md_files (int, const char **, bool(*)(const char *)) |
bool | read_file (const char *filename) |
bool | read_file_fragment (const char *filename, int first_line, int last_line) |
file_location | get_current_location () const |
bool | is_compact () const |
int | read_char (void) |
void | unread_char (int ch) |
file_location | read_name (struct md_name *name) |
file_location | read_name_or_nil (struct md_name *) |
void | read_escape () |
char * | read_quoted_string () |
char * | read_braced_string () |
char * | read_string (int star_if_braced) |
void | read_skip_construct (int depth, file_location loc) |
void | require_char (char expected) |
void | require_char_ws (char expected) |
void | require_word_ws (const char *expected) |
int | peek_char (void) |
void | set_md_ptr_loc (const void *ptr, file_location) |
const struct ptr_loc * | get_md_ptr_loc (const void *ptr) |
void | copy_md_ptr_loc (const void *new_ptr, const void *old_ptr) |
void | fprint_md_ptr_loc (FILE *outf, const void *ptr) |
void | print_md_ptr_loc (const void *ptr, FILE *=stdout) |
struct enum_type * | lookup_enum_type (const char *name) |
void | traverse_enum_types (htab_trav callback, void *info) |
void | handle_constants () |
void | traverse_md_constants (htab_trav callback, void *info) |
void | handle_enum (file_location loc, bool md_p) |
const char * | join_c_conditions (const char *cond1, const char *cond2) |
void | fprint_c_condition (FILE *outf, const char *cond) |
void | print_c_condition (FILE *outf, const char *cond) |
const char * | apply_iterator_to_string (const char *string) |
rtx | copy_rtx_for_iterators (rtx original) |
void | read_conditions () |
void | record_potential_iterator_use (struct iterator_group *group, file_location loc, rtx x, unsigned int index, const char *name) |
struct mapping * | read_mapping (struct iterator_group *group, htab_t table) |
overloaded_name * | handle_overloaded_name (rtx, vec< mapping * > *) |
const char * | get_top_level_filename () const |
const char * | get_filename () const |
int | get_lineno () const |
int | get_colno () const |
struct obstack * | get_string_obstack () |
htab_t | get_md_constants () |
overloaded_name * | get_overloads () const |
Private Member Functions | |
void | handle_file () |
void | handle_toplevel_file () |
void | handle_include (file_location loc) |
void | add_include_path (const char *arg) |
bool | read_name_1 (struct md_name *name, file_location *out_loc) |
Private Attributes | |
bool | m_compact |
const char * | m_toplevel_fname |
char * | m_base_dir |
FILE * | m_read_md_file |
const char * | m_read_md_filename |
int | m_read_md_lineno |
int | m_read_md_colno |
int | m_last_line_colno |
file_name_list * | m_first_dir_md_include |
file_name_list ** | m_last_dir_md_include_ptr |
struct obstack | m_string_obstack |
htab_t | m_ptr_locs |
struct obstack | m_ptr_loc_obstack |
htab_t | m_joined_conditions |
struct obstack | m_joined_conditions_obstack |
htab_t | m_md_constants |
htab_t | m_enum_types |
int | m_first_line |
int | m_last_line |
overloaded_name * | m_first_overload |
overloaded_name ** | m_next_overload_ptr |
htab_t | m_overloads_htab |
An md_reader subclass which skips unknown directives, for the gen* tools that purely use read-md.o.
|
inline |
|
privateinherited |
Parse a -I option with argument ARG.
References md_reader::file_name_list::fname, md_reader::m_last_dir_md_include_ptr, and md_reader::file_name_list::next.
|
inherited |
Apply the current iterator values to STRING. Return the new string if any changes were needed, otherwise return STRING itself.
References md_reader::copy_md_ptr_loc(), end(), md_reader::get_md_ptr_loc(), md_reader::ptr_loc::loc, md_reader::m_string_obstack, map_attr_string(), and map_value::string.
Referenced by md_reader::copy_rtx_for_iterators().
|
inherited |
Associate NEW_PTR with the same file position as OLD_PTR.
References md_reader::get_md_ptr_loc(), md_reader::ptr_loc::loc, and md_reader::set_md_ptr_loc().
Referenced by md_reader::apply_iterator_to_string(), attr_string(), process_rtx(), and rtx_reader::read_rtx_operand().
Return a deep copy of X, substituting the current iterator values into any strings.
References md_reader::apply_iterator_to_string(), md_reader::copy_rtx_for_iterators(), GET_CODE, GET_RTX_FORMAT, i, rtvec_alloc(), rtx_alloc(), RTX_CODE_SIZE, XEXP, XSTR, XTMPL, XVEC, XVECEXP, and XVECLEN.
Referenced by md_reader::copy_rtx_for_iterators().
|
inherited |
Print condition COND to OUTF, wrapped in brackets. If COND was created by join_c_conditions, recursively invoke this function for the original conditions and join the result with "&&". Otherwise print a #line directive for COND if its original file position is known.
References md_reader::fprint_c_condition(), md_reader::fprint_md_ptr_loc(), fputc(), and md_reader::m_joined_conditions.
Referenced by md_reader::fprint_c_condition(), md_reader::print_c_condition(), write_attr_value(), and write_test_expr().
|
inherited |
If PTR is associated with a known file position, print a #line directive for it to OUTF.
References file_location::filename, md_reader::get_md_ptr_loc(), file_location::lineno, and md_reader::ptr_loc::loc.
Referenced by md_reader::fprint_c_condition(), and md_reader::print_md_ptr_loc().
|
inlineinherited |
References md_reader::m_read_md_colno.
Referenced by fatal_with_file_and_line().
|
inherited |
References md_reader::m_read_md_colno, md_reader::m_read_md_filename, and md_reader::m_read_md_lineno.
Referenced by function_reader::handle_any_trailing_information(), md_reader::handle_file(), function_reader::maybe_read_location(), function_reader::parse_block(), function_reader::parse_edge(), function_reader::parse_function(), function_reader::parse_insn_chain(), function_reader::parse_param(), md_reader::read_name_1(), md_reader::read_name_or_nil(), function_reader::read_rtx_operand_r(), md_reader::read_string(), and rtx_reader::rtx_alloc_for_name().
|
inlineinherited |
References md_reader::m_read_md_filename.
Referenced by fatal_with_file_and_line(), md_reader::read_escape(), and rtx_reader::read_rtx_operand().
|
inlineinherited |
References md_reader::m_read_md_lineno.
Referenced by fatal_with_file_and_line(), md_reader::read_braced_string(), md_reader::read_escape(), and rtx_reader::read_rtx_operand().
|
inlineinherited |
References md_reader::m_md_constants.
Referenced by find_int(), md_reader::handle_enum(), and md_reader::traverse_md_constants().
|
inherited |
Return the position associated with pointer PTR. Return null if no position was set.
References md_reader::m_ptr_locs.
Referenced by md_reader::apply_iterator_to_string(), md_reader::copy_md_ptr_loc(), and md_reader::fprint_md_ptr_loc().
|
inlineinherited |
References md_reader::m_first_overload.
Referenced by main().
|
inlineinherited |
References md_reader::m_string_obstack.
Referenced by gen_mnemonic_attr(), gen_mnemonic_setattr(), mnemonic_htab_callback(), rtx_reader::read_rtx_operand(), and rtx_reader::rtx_alloc_for_name().
|
inlineinherited |
References md_reader::m_toplevel_fname.
Referenced by write_insn_preds_c(), write_tm_constrs_h(), and write_tm_preds_h().
|
inherited |
Process a define_constants directive, starting with the optional space after the "define_constants".
References add_constant(), defs, fatal_expected_char(), md_reader::m_md_constants, md_reader::read_name(), read_skip_spaces(), md_reader::require_char_ws(), and md_name::string.
Referenced by md_reader::handle_file().
|
inherited |
Process a define_enum or define_c_enum directive, starting with the optional space after the "define_enum". LINENO is the line number on which the directive started and MD_P is true if the directive is a define_enum rather than a define_c_enum.
References add_constant(), enum_value::def, error_at(), md_reader::get_md_constants(), md_reader::m_enum_types, md_decimal_string(), enum_value::name, enum_value::next, NULL, md_reader::read_name(), read_skip_spaces(), md_reader::read_string(), md_reader::require_char_ws(), md_name::string, md_reader::unread_char(), and upcase_string().
Referenced by md_reader::handle_file().
|
privateinherited |
Process the current file, assuming that read_md_file and read_md_filename are valid. Use HANDLE_DIRECTIVE to handle unknown directives.
References fatal_expected_char(), md_reader::get_current_location(), md_reader::handle_constants(), md_reader::handle_enum(), md_reader::handle_include(), md_reader::handle_unknown_directive(), md_reader::m_read_md_colno, md_reader::m_read_md_file, md_reader::m_read_md_lineno, md_reader::read_name(), read_skip_spaces(), and md_reader::require_char_ws().
Referenced by md_reader::handle_include(), and md_reader::handle_toplevel_file().
|
privateinherited |
Process an "include" directive, starting with the optional space after the "include". Read in the file and use HANDLE_DIRECTIVE to process each unknown directive. LINENO is the line number on which the "include" occurred.
References DIR_SEPARATOR, error_at(), md_reader::file_name_list::fname, fopen, free(), md_reader::handle_file(), include_callback, md_reader::m_base_dir, md_reader::m_first_dir_md_include, md_reader::m_read_md_colno, md_reader::m_read_md_file, md_reader::m_read_md_filename, md_reader::m_read_md_lineno, md_reader::file_name_list::next, NULL, and md_reader::read_string().
Referenced by md_reader::handle_file().
|
inherited |
|
privateinherited |
Like handle_file, but for top-level files. Set up m_toplevel_fname and m_base_dir accordingly.
References md_reader::handle_file(), md_reader::m_base_dir, md_reader::m_read_md_filename, md_reader::m_toplevel_fname, and NULL.
Referenced by md_reader::read_file(), and md_reader::read_file_fragment().
|
overridevirtual |
class noop_reader : public md_reader
A dummy implementation which skips unknown directives.
Implements md_reader.
References md_reader::read_skip_construct().
|
inlineinherited |
References md_reader::m_compact.
Referenced by function_reader::read_rtx_operand(), function_reader::read_rtx_operand_inL(), and function_reader::read_rtx_operand_u().
|
inherited |
Return a condition that satisfies both COND1 and COND2. Either string may be null or empty.
References md_reader::m_joined_conditions, md_reader::m_joined_conditions_obstack, and NULL.
Referenced by alter_test_for_insn(), process_rtx(), and process_substs_on_one_elem().
|
inherited |
Try to find the definition of the given enum. Return null on failure.
References md_reader::m_enum_types.
Referenced by gen_attr().
|
inherited |
Peek at the next character from the file without consuming it.
References md_reader::read_char(), and md_reader::unread_char().
Referenced by function_reader::handle_any_trailing_information(), and rtx_reader::read_nested_rtx().
|
inherited |
Special fprint_c_condition for writing to STDOUT.
References md_reader::fprint_c_condition().
Referenced by def_target_insn(), print_test(), write_init_reg_class_start_regs(), write_one_condition(), and write_predicate_expr().
|
inherited |
Special fprint_md_ptr_loc for writing to STDOUT.
References md_reader::fprint_md_ptr_loc().
Referenced by emit_c_code(), process_template(), write_one_condition(), and write_predicate_subfunction().
|
inherited |
Read a braced string (a la Tcl) onto the string obstack. Caller has scanned the leading brace. Note that unlike quoted strings, the outermost braces _are_ included in the string constant.
References fatal_with_file_and_line(), md_reader::get_lineno(), md_reader::m_string_obstack, md_reader::read_char(), and md_reader::read_escape().
Referenced by md_reader::read_string().
|
inherited |
Read the next character from the file.
References md_reader::m_first_line, md_reader::m_last_line, md_reader::m_last_line_colno, md_reader::m_read_md_colno, md_reader::m_read_md_file, and md_reader::m_read_md_lineno.
Referenced by function_reader::extra_parsing_for_operand_code_0(), function_reader::handle_any_trailing_information(), function_reader::maybe_read_location(), md_reader::peek_char(), md_reader::read_braced_string(), read_char(), md_reader::read_escape(), md_reader::read_name_1(), md_reader::read_name_or_nil(), md_reader::read_quoted_string(), rtx_reader::read_rtx_code(), rtx_reader::read_until(), and md_reader::require_char().
|
inherited |
|
inherited |
Subroutine of the string readers. Handles backslash escapes. Caller has read the backslash, but not placed it into the obstack.
References md_reader::get_filename(), md_reader::get_lineno(), md_reader::m_string_obstack, and md_reader::read_char().
Referenced by md_reader::read_braced_string(), and md_reader::read_quoted_string().
|
inherited |
Read FILENAME.
References fopen, md_reader::handle_toplevel_file(), have_error, md_reader::m_read_md_file, and md_reader::m_read_md_filename.
Referenced by read_rtl_function_body().
|
inherited |
Read FILENAME, filtering to just the given lines.
References fopen, md_reader::handle_toplevel_file(), have_error, md_reader::m_first_line, md_reader::m_last_line, md_reader::m_read_md_file, and md_reader::m_read_md_filename.
Referenced by read_rtl_function_body_from_file_range().
|
inherited |
Referenced by init_rtx_reader_args_cb(), and main().
|
inherited |
Read an rtx code name into NAME. It is terminated by any of the punctuation chars of rtx printed syntax.
References fatal_with_file_and_line(), and md_reader::read_name_1().
Referenced by function_reader::extra_parsing_for_operand_code_0(), function_reader::handle_any_trailing_information(), md_reader::handle_constants(), md_reader::handle_enum(), md_reader::handle_file(), function_reader::maybe_read_location(), function_reader::parse_bb_idx(), function_reader::parse_block(), function_reader::parse_enum_value(), function_reader::parse_function(), function_reader::parse_insn_chain(), function_reader::parse_rtx(), rtx_reader::read_nested_rtx(), rtx_reader::read_rtx_code(), function_reader::read_rtx_operand(), rtx_reader::read_rtx_operand(), function_reader::read_rtx_operand_inL(), function_reader::read_rtx_operand_r(), function_reader::read_rtx_operand_u(), md_reader::read_skip_construct(), and md_reader::require_word_ws().
|
privateinherited |
Read an rtx code name into NAME. It is terminated by any of the punctuation chars of rtx printed syntax.
References md_name::buffer, fatal_with_file_and_line(), md_reader::get_current_location(), i, md_reader::m_md_constants, md_constant::name, md_reader::read_char(), read_skip_spaces(), md_name::string, and md_reader::unread_char().
Referenced by md_reader::read_name(), and md_reader::read_name_or_nil().
|
inherited |
|
inherited |
Read a double-quoted string onto the obstack. Caller has scanned the leading quote.
References md_reader::m_string_obstack, md_reader::read_char(), and md_reader::read_escape().
Referenced by function_reader::maybe_read_location(), function_reader::parse_edge(), function_reader::parse_param(), and md_reader::read_string().
|
inherited |
Skip the rest of a construct that started at line LINENO and that is currently nested by DEPTH levels of parentheses.
References error_at(), md_reader::read_name(), read_skip_spaces(), md_reader::read_string(), and md_reader::unread_char().
Referenced by handle_unknown_directive(), and md_reader::read_name_or_nil().
|
inherited |
Read some kind of string constant. This is the high-level routine used by read_rtx. It handles surrounding parentheses, leading star, and dispatch to the appropriate string constant reader.
References fatal_with_file_and_line(), md_reader::get_current_location(), md_reader::m_string_obstack, NULL, md_reader::read_braced_string(), md_reader::read_quoted_string(), read_skip_spaces(), md_reader::require_char(), md_reader::require_char_ws(), and md_reader::set_md_ptr_loc().
Referenced by md_reader::handle_enum(), md_reader::handle_include(), function_reader::parse_function(), rtx_reader::read_rtx_operand(), and md_reader::read_skip_construct().
|
inherited |
Interpret NAME as either a built-in value, iterator or attribute for group GROUP. X and INDEX are the values to pass to GROUP's apply_iterator callback. LOC is the location of the use.
References iterator_group::apply_iterator, iterator_group::find_builtin, iterator_group::iterators, md_reader::m_string_obstack, record_attribute_use(), and record_iterator_use().
Referenced by rtx_reader::read_rtx_code(), and rtx_reader::read_rtx_operand().
|
inherited |
Consume the next character, issuing a fatal error if it is not EXPECTED.
References fatal_expected_char(), and md_reader::read_char().
Referenced by function_reader::extra_parsing_for_operand_code_0(), function_reader::handle_any_trailing_information(), function_reader::maybe_read_location(), function_reader::parse_function(), and md_reader::read_string().
|
inherited |
Consume any whitespace, then consume the next non-whitespace character, issuing a fatal error if it is not EXPECTED.
References fatal_expected_char(), and read_skip_spaces().
Referenced by function_reader::extra_parsing_for_operand_code_0(), function_reader::handle_any_trailing_information(), md_reader::handle_constants(), md_reader::handle_enum(), md_reader::handle_file(), function_reader::parse_crtl(), function_reader::parse_edge(), function_reader::parse_insn(), function_reader::parse_param(), function_reader::parse_rtx(), rtx_reader::read_nested_rtx(), function_reader::read_rtx_operand(), rtx_reader::read_rtx_operand(), function_reader::read_rtx_operand_r(), and md_reader::read_string().
|
inherited |
Consume any whitespace, then consume the next word (as per read_name), issuing a fatal error if it is not EXPECTED.
References fatal_with_file_and_line(), md_reader::read_name(), and md_name::string.
Referenced by function_reader::parse_crtl(), function_reader::parse_edge(), and function_reader::parse_param().
|
inherited |
Associate PTR with the file position given by FILE_LOC.
References md_reader::ptr_loc::loc, md_reader::m_ptr_loc_obstack, md_reader::m_ptr_locs, and md_reader::ptr_loc::ptr.
Referenced by md_reader::copy_md_ptr_loc(), and md_reader::read_string().
|
inherited |
For every enum definition, call CALLBACK with two arguments: a pointer to the constant definition and INFO. Stop when CALLBACK returns zero.
References md_reader::m_enum_types.
Referenced by main().
|
inherited |
For every constant definition, call CALLBACK with two arguments: a pointer a pointer to the constant definition and INFO. Stop when CALLBACK returns zero.
References md_reader::get_md_constants().
Referenced by main().
|
inherited |
Put back CH, which was the last character read from the file.
References md_reader::m_last_line_colno, md_reader::m_read_md_colno, md_reader::m_read_md_file, and md_reader::m_read_md_lineno.
Referenced by function_reader::extra_parsing_for_operand_code_0(), function_reader::handle_any_trailing_information(), md_reader::handle_enum(), function_reader::maybe_read_location(), function_reader::parse_edge(), function_reader::parse_function(), md_reader::peek_char(), md_reader::read_name_1(), rtx_reader::read_rtx_code(), rtx_reader::read_rtx_operand(), function_reader::read_rtx_operand_r(), rtx_reader::read_rtx_variadic(), md_reader::read_skip_construct(), rtx_reader::read_until(), and unread_char().
|
privateinherited |
Referenced by md_reader::handle_include(), md_reader::handle_toplevel_file(), and md_reader::~md_reader().
|
privateinherited |
Referenced by md_reader::is_compact().
|
privateinherited |
|
privateinherited |
Referenced by md_reader::handle_include().
|
privateinherited |
Referenced by md_reader::read_char(), and md_reader::read_file_fragment().
|
privateinherited |
Referenced by md_reader::get_overloads().
|
privateinherited |
|
privateinherited |
Referenced by md_reader::join_c_conditions(), md_reader::md_reader(), and md_reader::~md_reader().
|
privateinherited |
Referenced by md_reader::add_include_path().
|
privateinherited |
Referenced by md_reader::read_char(), and md_reader::read_file_fragment().
|
privateinherited |
Referenced by md_reader::read_char(), and md_reader::unread_char().
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
privateinherited |
Referenced by md_reader::md_reader(), md_reader::set_md_ptr_loc(), and md_reader::~md_reader().
|
privateinherited |
Referenced by md_reader::get_md_ptr_loc(), md_reader::md_reader(), md_reader::set_md_ptr_loc(), and md_reader::~md_reader().
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
privateinherited |
Referenced by md_reader::apply_iterator_to_string(), md_reader::get_string_obstack(), md_reader::md_reader(), md_reader::read_braced_string(), md_reader::read_escape(), md_reader::read_quoted_string(), md_reader::read_string(), md_reader::record_potential_iterator_use(), and md_reader::~md_reader().
|
privateinherited |
Referenced by md_reader::get_top_level_filename(), and md_reader::handle_toplevel_file().