GCC Middle and Back End API Reference
function_reader Class Reference
Inheritance diagram for function_reader:
Collaboration diagram for function_reader:

Data Structures

struct  uid_hash
 

Public Member Functions

 function_reader ()
 
 ~function_reader ()
 
void handle_unknown_directive (file_location, const char *) final override
 
rtx read_rtx_operand (rtx x, int idx) final override
 
void handle_any_trailing_information (rtx x) final override
 
rtx postprocess (rtx) final override
 
const charfinalize_string (char *stringbuf) final override
 
rtx_insn ** get_insn_by_uid (int uid)
 
tree parse_mem_expr (const char *desc)
 
bool read_rtx (const char *rtx_name, vec< rtx > *rtxen)
 
rtx rtx_alloc_for_name (const char *)
 
rtx read_rtx_code (const char *code_name)
 
rtx read_nested_rtx ()
 
rtx read_rtx_variadic (rtx form)
 
charread_until (const char *terminator_chars, bool consume_terminator)
 
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 ()
 
charread_quoted_string ()
 
charread_braced_string ()
 
charread_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_locget_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_typelookup_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 charjoin_c_conditions (const char *cond1, const char *cond2)
 
void fprint_c_condition (FILE *outf, const char *cond)
 
void print_c_condition (const char *cond)
 
const charapply_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 mappingread_mapping (struct iterator_group *group, htab_t table)
 
overloaded_namehandle_overloaded_name (rtx, vec< mapping * > *)
 
const charget_top_level_filename () const
 
const charget_filename () const
 
int get_lineno () const
 
int get_colno () const
 
struct obstackget_string_obstack ()
 
htab_t get_md_constants ()
 
overloaded_nameget_overloads () const
 

Protected Attributes

bool m_in_call_function_usage
 
auto_vec< rtxm_reuse_rtx_by_id
 

Private Member Functions

void parse_function ()
 
void create_function ()
 
void parse_param ()
 
void parse_insn_chain ()
 
void parse_block ()
 
int parse_bb_idx ()
 
void parse_edge (basic_block block, bool from)
 
rtx_insnparse_insn (file_location loc, const char *name)
 
void parse_cfg (file_location loc)
 
void parse_crtl (file_location loc)
 
void create_edges ()
 
int parse_enum_value (int num_values, const char *const *strings)
 
void read_rtx_operand_u (rtx x, int idx)
 
void read_rtx_operand_i_or_n (rtx x, int idx, char format_char)
 
rtx read_rtx_operand_r (rtx x)
 
rtx extra_parsing_for_operand_code_0 (rtx x, int idx)
 
void add_fixup_insn_uid (file_location loc, rtx insn, int operand_idx, int insn_uid)
 
void add_fixup_note_insn_basic_block (file_location loc, rtx insn, int operand_idx, int bb_idx)
 
void add_fixup_source_location (file_location loc, rtx_insn *insn, const char *filename, int lineno, int colno)
 
void add_fixup_expr (file_location loc, rtx x, const char *desc)
 
rtx consolidate_singletons (rtx x)
 
rtx parse_rtx ()
 
void maybe_read_location (rtx_insn *insn)
 
void handle_insn_uids ()
 
void apply_fixups ()
 
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

hash_map< uid_hash, rtx_insn * > m_insns_by_uid
 
auto_vec< fixup * > m_fixups
 
rtx_insnm_first_insn
 
auto_vec< treem_fake_scope
 
charm_name
 
bool m_have_crtl_directive
 
basic_block m_bb_to_insert_after
 
auto_vec< deferred_edgem_deferred_edges
 
int m_highest_bb_idx
 
bool m_compact
 
const charm_toplevel_fname
 
charm_base_dir
 
FILEm_read_md_file
 
const charm_read_md_filename
 
int m_read_md_lineno
 
int m_read_md_colno
 
int m_last_line_colno
 
file_name_listm_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_namem_first_overload
 
overloaded_name ** m_next_overload_ptr
 
htab_t m_overloads_htab
 

Detailed Description

Subclass of rtx_reader for reading function dumps.   

Constructor & Destructor Documentation

◆ function_reader()

function_reader::function_reader ( )
class function_reader : public rtx_reader  
function_reader's constructor.   

◆ ~function_reader()

function_reader::~function_reader ( )
function_reader's destructor.   

References FOR_EACH_VEC_ELT, free(), i, m_fixups, and m_name.

Member Function Documentation

◆ add_fixup_expr()

void function_reader::add_fixup_expr ( file_location loc,
rtx insn,
const char * desc )
private
Record that at LOC we saw textual description DESC of the MEM_EXPR or REG_EXPR
of INSN, so that the fields can be fixed up in later post-processing.   

References gcc_assert, ggc_alloc(), and m_fixups.

Referenced by handle_any_trailing_information(), and read_rtx_operand_r().

◆ add_fixup_insn_uid()

void function_reader::add_fixup_insn_uid ( file_location loc,
rtx insn,
int operand_idx,
int insn_uid )
private
Record that at LOC we saw an insn uid INSN_UID for the operand with index
OPERAND_IDX within INSN, so that the pointer value can be fixed up in
later post-processing.   

References ggc_alloc(), and m_fixups.

Referenced by read_rtx_operand_u().

◆ add_fixup_note_insn_basic_block()

void function_reader::add_fixup_note_insn_basic_block ( file_location loc,
rtx insn,
int operand_idx,
int bb_idx )
private
Record that at LOC we saw an basic block index BB_IDX for the operand with index
OPERAND_IDX within INSN, so that the pointer value can be fixed up in
later post-processing.   

References ggc_alloc(), and m_fixups.

Referenced by extra_parsing_for_operand_code_0().

◆ add_fixup_source_location()

void function_reader::add_fixup_source_location ( file_location loc,
rtx_insn * insn,
const char * filename,
int lineno,
int colno )
private
Placeholder hook for recording source location information seen in a dump.
This is empty for now.   

Referenced by maybe_read_location().

◆ add_include_path()

void md_reader::add_include_path ( const char * arg)
privateinherited
Parse a -I option with argument ARG.   

References ggc_alloc(), and md_reader::m_last_dir_md_include_ptr.

◆ apply_fixups()

void function_reader::apply_fixups ( )
private
Apply all of the recorded fixups.   

References fixup::apply(), FOR_EACH_VEC_ELT, i, and m_fixups.

Referenced by parse_function().

◆ apply_iterator_to_string()

const char * md_reader::apply_iterator_to_string ( const char * string)
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(), ggc_alloc(), 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().

◆ consolidate_singletons()

rtx function_reader::consolidate_singletons ( rtx x)
private
When reading RTL function dumps, we must consolidate some
rtx so that we use singletons where singletons are expected
(e.g. we don't want multiple "(const_int 0 [0])" rtx, since
these are tested via pointer equality against const0_rtx.

Return the equivalent singleton rtx for X, if any, otherwise X.   

References consolidate_reg(), gen_rtx_CONST_INT(), gen_rtx_CONST_VECTOR(), GET_CODE, GET_MODE, ggc_alloc(), INTVAL, pc_rtx, ret_rtx, simple_return_rtx, and XVEC.

Referenced by handle_any_trailing_information(), parse_rtx(), postprocess(), and read_rtx_operand_r().

◆ copy_md_ptr_loc()

void md_reader::copy_md_ptr_loc ( const void * new_ptr,
const void * old_ptr )
inherited

◆ copy_rtx_for_iterators()

rtx md_reader::copy_rtx_for_iterators ( rtx original)
inherited
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, ggc_alloc(), i, rtvec_alloc(), rtx_alloc(), RTX_CODE_SIZE, XEXP, XSTR, XTMPL, XVEC, XVECEXP, and XVECLEN.

Referenced by md_reader::copy_rtx_for_iterators().

◆ create_edges()

void function_reader::create_edges ( )
private
Postprocessing subroutine for parse_insn_chain: all the basic blocks
should have been created by now; create the edges that were seen.   

References BASIC_BLOCK_FOR_FN, cfun, fatal_at(), FOR_EACH_VEC_ELT, ggc_alloc(), i, m_deferred_edges, and unchecked_make_edge().

Referenced by parse_insn_chain().

◆ create_function()

void function_reader::create_function ( )
private
Set up state for the function *before* fixups are applied.

Create "cfun" and a decl for the function.
By default, every function decl is hardcoded as
   int test_1 (int i, int j, int k);
Set up various other state:
- the cfg and basic blocks (edges are created later, *after* fixups
are applied).
- add the function to the callgraph.   

References allocate_struct_function(), build_decl(), build_function_type_array(), cfun, current_function_decl, DECL_ARTIFICIAL, DECL_EXTERNAL, DECL_IGNORED_P, DECL_INITIAL, DECL_PRESERVE_P, DECL_RESULT, ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK_PTR_FOR_FN, cgraph_node::finalize_function(), gcc_assert, get_identifier(), ggc_alloc(), init_empty_tree_cfg_for_function(), init_rtl_bb_info(), integer_type_node, m_bb_to_insert_after, m_name, make_node(), NULL_TREE, PROP_cfg, PROP_rtl, rtl_register_cfg_hooks(), and UNKNOWN_LOCATION.

Referenced by parse_function().

◆ extra_parsing_for_operand_code_0()

rtx function_reader::extra_parsing_for_operand_code_0 ( rtx x,
int idx )
private
Additional parsing for format code '0' in dumps, handling a variety
of special-cases in print_rtx, when parsing operand IDX of X.
Return X, or possibly a reallocated copy of X.   

References add_fixup_note_insn_basic_block(), error_at(), GET_CODE, ggc_alloc(), ggc_internal_alloc(), NULL, md_reader::read_char(), md_reader::read_name(), read_skip_spaces(), md_reader::require_char(), md_reader::require_char_ws(), RTX_CODE, RTX_CODE_SIZE, RTX_HDR_SIZE, md_name::string, SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET, SYMBOL_REF_FLAGS, SYMBOL_REF_HAS_BLOCK_INFO_P, and md_reader::unread_char().

Referenced by read_rtx_operand().

◆ finalize_string()

const char * function_reader::finalize_string ( char * stringbuf)
finaloverridevirtual
Implementation of rtx_reader::finalize_string for reading function dumps.
Make a GC-managed copy of STRINGBUF.   

Reimplemented from rtx_reader.

References ggc_alloc(), and ggc_strdup.

◆ fprint_c_condition()

void md_reader::fprint_c_condition ( FILE * outf,
const char * cond )
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(), ggc_alloc(), 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().

◆ fprint_md_ptr_loc()

void md_reader::fprint_md_ptr_loc ( FILE * outf,
const void * ptr )
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(), ggc_alloc(), file_location::lineno, and md_reader::ptr_loc::loc.

Referenced by md_reader::fprint_c_condition(), and md_reader::print_md_ptr_loc().

◆ get_colno()

int md_reader::get_colno ( ) const
inlineinherited

◆ get_current_location()

◆ get_filename()

const char * md_reader::get_filename ( ) const
inlineinherited

◆ get_insn_by_uid()

rtx_insn ** function_reader::get_insn_by_uid ( int uid)
Given a UID value, try to locate a pointer to the corresponding
rtx_insn *, or NULL if it can't be found.   

References m_insns_by_uid.

◆ get_lineno()

int md_reader::get_lineno ( ) const
inlineinherited

◆ get_md_constants()

htab_t md_reader::get_md_constants ( )
inlineinherited

◆ get_md_ptr_loc()

const md_reader::ptr_loc * md_reader::get_md_ptr_loc ( const void * ptr)
inherited
Return the position associated with pointer PTR.  Return null if no
position was set.   

References ggc_alloc(), and 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().

◆ get_overloads()

overloaded_name * md_reader::get_overloads ( ) const
inlineinherited

References md_reader::m_first_overload.

Referenced by main().

◆ get_string_obstack()

◆ get_top_level_filename()

const char * md_reader::get_top_level_filename ( ) const
inlineinherited

◆ handle_any_trailing_information()

void function_reader::handle_any_trailing_information ( rtx x)
finaloverridevirtual

◆ handle_constants()

void md_reader::handle_constants ( )
inherited
Process a define_constants directive, starting with the optional space
after the "define_constants".   

References add_constant(), defs, fatal_expected_char(), ggc_alloc(), 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().

◆ handle_enum()

void md_reader::handle_enum ( file_location loc,
bool md_p )
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(), error_at(), md_reader::get_md_constants(), ggc_alloc(), md_reader::m_enum_types, md_decimal_string(), 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().

◆ handle_file()

◆ handle_include()

void md_reader::handle_include ( file_location loc)
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(), fopen, free(), ggc_alloc(), 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, NULL, and md_reader::read_string().

Referenced by md_reader::handle_file().

◆ handle_insn_uids()

void function_reader::handle_insn_uids ( )
private
Postprocessing subroutine of function_reader::parse_function.
Populate m_insns_by_uid.   

References crtl, error(), get_insns(), INSN_UID(), m_insns_by_uid, max_uid, and NEXT_INSN().

Referenced by parse_function().

◆ handle_overloaded_name()

overloaded_name * md_reader::handle_overloaded_name ( rtx ,
vec< mapping * > *  )
inherited

◆ handle_toplevel_file()

void md_reader::handle_toplevel_file ( )
privateinherited
Like handle_file, but for top-level files.  Set up m_toplevel_fname
and m_base_dir accordingly.   

References ggc_alloc(), 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().

◆ handle_unknown_directive()

void function_reader::handle_unknown_directive ( file_location start_loc,
const char * name )
finaloverridevirtual
Implementation of rtx_reader::handle_unknown_directive,
for parsing the remainder of a directive with name NAME
seen at START_LOC.

Require a top-level "function" directive, as emitted by
print_rtx_function, and parse it.   

Implements md_reader.

References error(), fatal_at(), ggc_alloc(), and parse_function().

◆ is_compact()

bool md_reader::is_compact ( ) const
inlineinherited

◆ join_c_conditions()

const char * md_reader::join_c_conditions ( const char * cond1,
const char * cond2 )
inherited
Return a condition that satisfies both COND1 and COND2.  Either string
may be null or empty.   

References ggc_alloc(), 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().

◆ lookup_enum_type()

struct enum_type * md_reader::lookup_enum_type ( const char * name)
inherited
Try to find the definition of the given enum.  Return null on failure.   

References ggc_alloc(), and md_reader::m_enum_types.

Referenced by gen_attr().

◆ maybe_read_location()

void function_reader::maybe_read_location ( rtx_insn * insn)
private
Attempt to parse optional location information for insn INSN, as
potentially written out by rtx_writer::print_rtx_operand_code_i.
We look for a quoted string followed by a colon.   

References add_fixup_source_location(), md_reader::get_current_location(), ggc_alloc(), md_reader::read_char(), md_reader::read_name(), md_reader::read_quoted_string(), read_skip_spaces(), md_reader::require_char(), md_name::string, and md_reader::unread_char().

Referenced by read_rtx_operand_i_or_n().

◆ parse_bb_idx()

int function_reader::parse_bb_idx ( )
private
Subroutine of function_reader::parse_edge.
Parse a basic block index, handling "entry" and "exit".   

References ENTRY_BLOCK, EXIT_BLOCK, ggc_alloc(), md_reader::read_name(), and md_name::string.

Referenced by parse_edge().

◆ parse_block()

◆ parse_cfg()

void function_reader::parse_cfg ( file_location loc)
private

◆ parse_crtl()

void function_reader::parse_crtl ( file_location loc)
private
Parse a "crtl" directive, having already parsed the "(crtl" heading
at location LOC.
Consume the final ")".   

References crtl, error_at(), m_have_crtl_directive, parse_rtx(), md_reader::require_char_ws(), and md_reader::require_word_ws().

Referenced by parse_function().

◆ parse_edge()

void function_reader::parse_edge ( basic_block block,
bool from )
private
Parse an "edge-from" or "edge-to" directive within the "block"
directive for BLOCK, having already parsed the "(edge" heading.
Consume the final ")".  Record the edge within m_deferred_edges.
FROM is true for an "edge-from" directive, false for an "edge-to"
directive.   

References EXIT_BLOCK, gcc_assert, md_reader::get_current_location(), ggc_alloc(), basic_block_def::index, m_deferred_edges, parse_bb_idx(), parse_edge_flags(), md_reader::read_quoted_string(), read_skip_spaces(), md_reader::require_char_ws(), md_reader::require_word_ws(), and md_reader::unread_char().

Referenced by parse_block().

◆ parse_enum_value()

int function_reader::parse_enum_value ( int num_values,
const char *const * strings )
private
Read a name, looking for a match against a string found in array
STRINGS of size NUM_VALUES.
Return the index of the matched string, or emit an error.   

References error(), ggc_alloc(), i, md_reader::read_name(), and md_name::string.

Referenced by read_rtx_operand_i_or_n().

◆ parse_function()

void function_reader::parse_function ( )
private
Parse the output of print_rtx_function (or hand-written data in the
same format), having already parsed the "(function" heading, and
finishing immediately before the final ")".

The "param" and "crtl" clauses are optional.   

References apply_fixups(), create_function(), crtl, fatal_with_file_and_line(), md_reader::get_current_location(), get_insns(), ggc_alloc(), handle_insn_uids(), m_name, parse_crtl(), parse_insn_chain(), parse_param(), md_reader::read_name(), read_skip_spaces(), md_reader::read_string(), rebuild_jump_labels(), md_reader::require_char(), and md_reader::unread_char().

Referenced by handle_unknown_directive().

◆ parse_insn()

rtx_insn * function_reader::parse_insn ( file_location start_loc,
const char * name )
private
Parse an rtx instruction, having parsed the opening and parenthesis, and
name NAME, seen at START_LOC, by calling read_rtx_code, calling
set_first_insn and set_last_insn as appropriate, and
adding the insn to the insn chain.
Consume the trailing ')'.   

References fatal_at(), gcc_assert, get_last_insn(), ggc_alloc(), m_first_insn, maybe_set_max_label_num(), NEXT_INSN(), NULL, rtx_reader::read_rtx_code(), md_reader::require_char_ws(), set_first_insn(), set_last_insn(), SET_NEXT_INSN(), and SET_PREV_INSN().

Referenced by parse_block(), and parse_insn_chain().

◆ parse_insn_chain()

void function_reader::parse_insn_chain ( )
private
Parse zero or more child insn elements within an
"insn-chain" element.  Consume the trailing ')'.   

References create_edges(), fatal_at(), md_reader::get_current_location(), ggc_alloc(), parse_block(), parse_insn(), md_reader::read_name(), and read_skip_spaces().

Referenced by parse_function().

◆ parse_mem_expr()

tree function_reader::parse_mem_expr ( const char * desc)
Parse a tree dump for a MEM_EXPR in DESC and turn it back into a tree.
We handle "<retval>" and param names within cfun, but for anything else
we "cheat" by building a global VAR_DECL of type "int" with that name
(returning the same global for a name if we see the same name more
than once).   

References build_decl(), cfun, DECL_NAME, DECL_RESULT, find_param_by_name(), FOR_EACH_VEC_ELT, get_identifier(), ggc_alloc(), i, id_equal(), integer_type_node, m_fake_scope, and UNKNOWN_LOCATION.

◆ parse_param()

void function_reader::parse_param ( )
private
Parse the content of a "param" directive, having already parsed the
"(param".  Consume the trailing ')'.   

References cfun, DECL_INCOMING_RTL, DECL_WRTL_CHECK, fatal_at(), find_param_by_name(), md_reader::get_current_location(), ggc_alloc(), parse_rtx(), md_reader::read_quoted_string(), md_reader::require_char_ws(), and md_reader::require_word_ws().

Referenced by parse_function().

◆ parse_rtx()

rtx function_reader::parse_rtx ( )
private
Parse an rtx directive, including both the opening/closing parentheses,
and the name.   

References consolidate_singletons(), md_reader::read_name(), rtx_reader::read_rtx_code(), and md_reader::require_char_ws().

Referenced by parse_crtl(), and parse_param().

◆ peek_char()

int md_reader::peek_char ( void )
inherited
Peek at the next character from the file without consuming it.   

References md_reader::read_char(), and md_reader::unread_char().

Referenced by handle_any_trailing_information(), and rtx_reader::read_nested_rtx().

◆ postprocess()

rtx function_reader::postprocess ( rtx x)
finaloverridevirtual
Implementation of rtx_reader::postprocess for reading function dumps.
Return the equivalent singleton rtx for X, if any, otherwise X.   

Reimplemented from rtx_reader.

References consolidate_singletons().

◆ print_c_condition()

void md_reader::print_c_condition ( const char * cond)
inherited
Special fprint_c_condition for writing to STDOUT.   

References md_reader::fprint_c_condition(), and ggc_alloc().

Referenced by def_target_insn(), print_test(), write_init_reg_class_start_regs(), write_one_condition(), and write_predicate_expr().

◆ print_md_ptr_loc()

void md_reader::print_md_ptr_loc ( const void * ptr,
FILE * file = stdout )
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().

◆ read_braced_string()

char * md_reader::read_braced_string ( )
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(), ggc_alloc(), md_reader::m_string_obstack, md_reader::read_char(), and md_reader::read_escape().

Referenced by md_reader::read_string().

◆ read_char()

◆ read_conditions()

void md_reader::read_conditions ( )
inherited

◆ read_escape()

void md_reader::read_escape ( )
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(), ggc_alloc(), md_reader::m_string_obstack, and md_reader::read_char().

Referenced by md_reader::read_braced_string(), and md_reader::read_quoted_string().

◆ read_file()

bool md_reader::read_file ( const char * filename)
inherited

◆ read_file_fragment()

bool md_reader::read_file_fragment ( const char * filename,
int first_line,
int last_line )
inherited

◆ read_mapping()

struct mapping * md_reader::read_mapping ( struct iterator_group * group,
htab_t table )
inherited

◆ read_md_files()

bool md_reader::read_md_files ( int ,
const char ** ,
bool(*)(const char *)  )
inherited

◆ read_name()

◆ read_name_1()

bool md_reader::read_name_1 ( struct md_name * name,
file_location * out_loc )
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(), ggc_alloc(), i, md_reader::m_md_constants, 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().

◆ read_name_or_nil()

◆ read_nested_rtx()

rtx rtx_reader::read_nested_rtx ( )
inherited

◆ read_quoted_string()

char * md_reader::read_quoted_string ( )
inherited
Read a double-quoted string onto the obstack.  Caller has scanned
the leading quote.   

References ggc_alloc(), md_reader::m_string_obstack, md_reader::read_char(), and md_reader::read_escape().

Referenced by maybe_read_location(), parse_edge(), parse_param(), and md_reader::read_string().

◆ read_rtx()

bool rtx_reader::read_rtx ( const char * rtx_name,
vec< rtx > * rtxen )
inherited

◆ read_rtx_code()

◆ read_rtx_operand()

rtx function_reader::read_rtx_operand ( rtx x,
int idx )
finaloverridevirtual
Parse operand IDX of X, returning X, or an equivalent rtx
expression (for consolidating singletons).
This is an overridden implementation of rtx_reader::read_rtx_operand for
function_reader, handling various extra data printed by print_rtx,
and sometimes calling the base class implementation.   

Reimplemented from rtx_reader.

References CALL_P, extra_parsing_for_operand_code_0(), gcc_assert, GET_CODE, GET_RTX_FORMAT, ggc_alloc(), md_reader::is_compact(), rtx_reader::m_in_call_function_usage, md_reader::read_name(), rtx_reader::read_rtx_operand(), read_rtx_operand_i_or_n(), read_rtx_operand_r(), read_rtx_operand_u(), md_reader::require_char_ws(), and RTX_CODE.

◆ read_rtx_operand_i_or_n()

void function_reader::read_rtx_operand_i_or_n ( rtx x,
int idx,
char format_char )
private
Parse operand IDX of X, of code 'i' or 'n' (as specified by FORMAT_CHAR).
Special-cased handling of these, for reading function dumps.   

References GET_CODE, ggc_alloc(), INSN_CODE, INSN_P, md_reader::is_compact(), maybe_read_location(), NOTE_P, parse_enum_value(), parse_note_insn_name(), md_reader::read_name(), md_name::string, and XINT.

Referenced by read_rtx_operand().

◆ read_rtx_operand_r()

rtx function_reader::read_rtx_operand_r ( rtx x)
private
Parse the 'r' operand of X, returning X, or an equivalent rtx
expression (for consolidating singletons).
Special-cased handling of code 'r' for reading function dumps.   

References add_fixup_expr(), consolidate_singletons(), fatal_at(), free(), md_reader::get_current_location(), ggc_alloc(), lookup_reg_by_dump_name(), ORIGINAL_REGNO, md_reader::read_name(), read_skip_spaces(), rtx_reader::read_until(), md_reader::require_char_ws(), set_regno_raw(), startswith(), md_name::string, strip_trailing_whitespace(), and md_reader::unread_char().

Referenced by read_rtx_operand().

◆ read_rtx_operand_u()

void function_reader::read_rtx_operand_u ( rtx x,
int idx )
private
Parse operand IDX of X, of code 'u', when reading function dumps.

The RTL file recorded the ID of an insn (or 0 for NULL); we
must store this as a pointer, but the insn might not have
been loaded yet.  Store the ID away for now, via a fixup.   

References add_fixup_insn_uid(), GET_CODE, ggc_alloc(), md_reader::is_compact(), md_reader::read_name(), and md_name::string.

Referenced by read_rtx_operand().

◆ read_rtx_variadic()

rtx rtx_reader::read_rtx_variadic ( rtx form)
inherited
Mutually recursive subroutine of read_rtx which reads
(thing x1 x2 x3 ...) and produces RTL as if
(thing x1 (thing x2 (thing x3 ...)))  had been written.
When called, FORM is (thing x1 x2), and the file position
is just past the leading parenthesis of x3.  Only works
for THINGs which are dyadic expressions, e.g. AND, IOR.   

References GET_CODE, GET_MODE, PUT_MODE(), rtx_reader::read_nested_rtx(), read_skip_spaces(), rtx_alloc(), md_reader::unread_char(), and XEXP.

Referenced by rtx_reader::read_rtx_code().

◆ read_skip_construct()

void md_reader::read_skip_construct ( int depth,
file_location loc )
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(), ggc_alloc(), md_reader::read_name(), read_skip_spaces(), md_reader::read_string(), and md_reader::unread_char().

Referenced by noop_reader::handle_unknown_directive(), and md_reader::read_name_or_nil().

◆ read_string()

char * md_reader::read_string ( int star_if_braced)
inherited

◆ read_until()

char * rtx_reader::read_until ( const char * terminator_chars,
bool consume_terminator )
inherited
Consume characters until encountering a character in TERMINATOR_CHARS,
consuming the terminator character if CONSUME_TERMINATOR is true.
Return all characters before the terminator as an allocated buffer.   

References ggc_alloc(), md_reader::read_char(), read_skip_spaces(), and md_reader::unread_char().

Referenced by handle_any_trailing_information(), and read_rtx_operand_r().

◆ record_potential_iterator_use()

void md_reader::record_potential_iterator_use ( struct iterator_group * group,
file_location loc,
rtx x,
unsigned int index,
const char * name )
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, ggc_alloc(), 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().

◆ require_char()

void md_reader::require_char ( char expected)
inherited
Consume the next character, issuing a fatal error if it is not
EXPECTED.   

References fatal_expected_char(), ggc_alloc(), and md_reader::read_char().

Referenced by extra_parsing_for_operand_code_0(), handle_any_trailing_information(), maybe_read_location(), parse_function(), and md_reader::read_string().

◆ require_char_ws()

◆ require_word_ws()

void md_reader::require_word_ws ( const char * expected)
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(), ggc_alloc(), md_reader::read_name(), and md_name::string.

Referenced by parse_crtl(), parse_edge(), and parse_param().

◆ rtx_alloc_for_name()

rtx rtx_reader::rtx_alloc_for_name ( const char * name)
inherited
Allocate an rtx for code NAME.  If NAME is a code iterator or code
attribute, record its use for later and use one of its possible
values as an interim rtx code.   

References fatal_with_file_and_line(), md_reader::get_current_location(), md_reader::get_string_obstack(), ggc_alloc(), map_value::number, obstack, record_attribute_use(), record_iterator_use(), rtx_alloc(), and mapping::values.

Referenced by rtx_reader::read_rtx_code().

◆ set_md_ptr_loc()

void md_reader::set_md_ptr_loc ( const void * ptr,
file_location file_loc )
inherited

◆ traverse_enum_types()

void md_reader::traverse_enum_types ( htab_trav callback,
void * info )
inherited
For every enum definition, call CALLBACK with two arguments:
a pointer to the constant definition and INFO.  Stop when CALLBACK
returns zero.   

References ggc_alloc(), and md_reader::m_enum_types.

◆ traverse_md_constants()

void md_reader::traverse_md_constants ( htab_trav callback,
void * info )
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(), and ggc_alloc().

◆ unread_char()

Field Documentation

◆ m_base_dir

char* md_reader::m_base_dir
privateinherited

◆ m_bb_to_insert_after

basic_block function_reader::m_bb_to_insert_after
private

Referenced by create_function(), and parse_block().

◆ m_compact

bool md_reader::m_compact
privateinherited

Referenced by md_reader::is_compact().

◆ m_deferred_edges

auto_vec<deferred_edge> function_reader::m_deferred_edges
private

Referenced by create_edges(), and parse_edge().

◆ m_enum_types

◆ m_fake_scope

auto_vec<tree> function_reader::m_fake_scope
private

Referenced by parse_mem_expr().

◆ m_first_dir_md_include

file_name_list* md_reader::m_first_dir_md_include
privateinherited

◆ m_first_insn

rtx_insn* function_reader::m_first_insn
private

Referenced by parse_insn().

◆ m_first_line

int md_reader::m_first_line
privateinherited

◆ m_first_overload

overloaded_name* md_reader::m_first_overload
privateinherited

◆ m_fixups

◆ m_have_crtl_directive

bool function_reader::m_have_crtl_directive
private

Referenced by parse_crtl().

◆ m_highest_bb_idx

int function_reader::m_highest_bb_idx
private

Referenced by parse_block().

◆ m_in_call_function_usage

bool rtx_reader::m_in_call_function_usage
protectedinherited

◆ m_insns_by_uid

hash_map<uid_hash, rtx_insn *> function_reader::m_insns_by_uid
private

◆ m_joined_conditions

htab_t md_reader::m_joined_conditions
privateinherited

◆ m_joined_conditions_obstack

struct obstack md_reader::m_joined_conditions_obstack
privateinherited

◆ m_last_dir_md_include_ptr

file_name_list** md_reader::m_last_dir_md_include_ptr
privateinherited

◆ m_last_line

int md_reader::m_last_line
privateinherited

◆ m_last_line_colno

int md_reader::m_last_line_colno
privateinherited

◆ m_md_constants

◆ m_name

char* function_reader::m_name
private

◆ m_next_overload_ptr

overloaded_name** md_reader::m_next_overload_ptr
privateinherited

◆ m_overloads_htab

htab_t md_reader::m_overloads_htab
privateinherited

◆ m_ptr_loc_obstack

struct obstack md_reader::m_ptr_loc_obstack
privateinherited

◆ m_ptr_locs

◆ m_read_md_colno

◆ m_read_md_file

◆ m_read_md_filename

◆ m_read_md_lineno

◆ m_reuse_rtx_by_id

auto_vec<rtx> rtx_reader::m_reuse_rtx_by_id
protectedinherited

◆ m_string_obstack

◆ m_toplevel_fname

const char* md_reader::m_toplevel_fname
privateinherited

The documentation for this class was generated from the following file: