GCC Middle and Back End API Reference
read-rtl-function.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "target.h"
#include "tree.h"
#include "diagnostic.h"
#include "read-md.h"
#include "rtl.h"
#include "cfghooks.h"
#include "stringpool.h"
#include "function.h"
#include "tree-cfg.h"
#include "cfg.h"
#include "basic-block.h"
#include "cfgrtl.h"
#include "memmodel.h"
#include "emit-rtl.h"
#include "cgraph.h"
#include "tree-pass.h"
#include "toplev.h"
#include "varasm.h"
#include "read-rtl-function.h"
#include "selftest.h"
#include "selftest-rtl.h"
#include "regs.h"
#include "function-abi.h"
#include "cfg-flags.def"
Include dependency graph for read-rtl-function.cc:

Data Structures

class  deferred_edge
 
class  function_reader
 
struct  function_reader::uid_hash
 
class  fixup
 
class  operand_fixup
 
class  fixup_insn_uid
 
class  fixup_note_insn_basic_block
 
class  fixup_expr
 

Macros

#define DEF_EDGE_FLAG(NAME, IDX)
 

Functions

static const char * get_operand_name (rtx insn, int operand_idx)
 
static void strip_trailing_whitespace (char *desc)
 
static int parse_note_insn_name (const char *string)
 
static int lookup_reg_by_dump_name (const char *name)
 
static tree find_param_by_name (tree fndecl, const char *name)
 
static int parse_edge_flag_token (const char *tok)
 
static int parse_edge_flags (char *str)
 
static rtx lookup_global_register (int regno)
 
static void ensure_regno (int regno)
 
static rtx consolidate_reg (rtx x)
 
bool read_rtl_function_body (const char *path)
 
bool read_rtl_function_body_from_file_range (location_t start_loc, location_t end_loc)
 

Macro Definition Documentation

◆ DEF_EDGE_FLAG

#define DEF_EDGE_FLAG ( NAME,
IDX )
Value:
do { \
if (strcmp (tok, #NAME) == 0) \
return EDGE_##NAME; \
} while (0);
@ NAME
Definition tree-ssa-pre.cc:242

Function Documentation

◆ consolidate_reg()

static rtx consolidate_reg ( rtx x)
static
Helper function for consolidate_singletons, for handling REG instances.
Given REG instance X of some regno, return the singleton rtx for that
regno, if it exists, or X.   

References ensure_regno(), gcc_assert, GET_CODE, GET_MODE, lookup_global_register(), NULL, REGNO, and regno_reg_rtx.

Referenced by function_reader::consolidate_singletons().

◆ ensure_regno()

static void ensure_regno ( int regno)
static
Ensure that the backend can cope with a REG with regno REGNO.
Normally REG instances are created by gen_reg_rtx which updates
regno_reg_rtx, growing it as necessary.
The REG instances created from the dumpfile weren't created this
way, so we need to manually update regno_reg_rtx.   

References crtl, emit(), gcc_assert, and reg_rtx_no.

Referenced by consolidate_reg().

◆ find_param_by_name()

static tree find_param_by_name ( tree fndecl,
const char * name )
static
Look within the params of FNDECL for a param named NAME.
Return NULL_TREE if one isn't found.   

References DECL_ARGUMENTS, DECL_NAME, id_equal(), NULL_TREE, and TREE_CHAIN.

Referenced by function_reader::parse_mem_expr(), and function_reader::parse_param().

◆ get_operand_name()

static const char * get_operand_name ( rtx insn,
int operand_idx )
static
Return a textual description of the operand of INSN with
index OPERAND_IDX.   

References gcc_assert, is_a(), and NULL.

Referenced by fixup_insn_uid::apply().

◆ lookup_global_register()

◆ lookup_reg_by_dump_name()

static int lookup_reg_by_dump_name ( const char * name)
static

◆ parse_edge_flag_token()

static int parse_edge_flag_token ( const char * tok)
static
Subroutine of parse_edge_flags.
Parse TOK, a token such as "FALLTHRU", converting to the flag value.
Issue an error if the token is unrecognized.   

References error().

Referenced by parse_edge_flags().

◆ parse_edge_flags()

static int parse_edge_flags ( char * str)
static
Subroutine of function_reader::parse_edge.
Parse STR and convert to a flag value (or issue an error).
The parser uses strtok and hence modifiers STR in-place.   

References NULL, and parse_edge_flag_token().

Referenced by function_reader::parse_edge().

◆ parse_note_insn_name()

static int parse_note_insn_name ( const char * string)
static
Return the numeric value n for GET_NOTE_INSN_NAME (n) for STRING,
or fail if STRING isn't recognized.   

References fatal_with_file_and_line(), GET_NOTE_INSN_NAME, i, and NOTE_INSN_MAX.

Referenced by function_reader::read_rtx_operand_i_or_n().

◆ read_rtl_function_body()

bool read_rtl_function_body ( const char * path)
Run the RTL dump parser, parsing a dump located at PATH.
Return true iff the file was successfully parsed.   

References crtl, default_function_abi, init_emit(), init_varasm_status(), initialize_rtl(), and md_reader::read_file().

◆ read_rtl_function_body_from_file_range()

bool read_rtl_function_body_from_file_range ( location_t start_loc,
location_t end_loc )
Run the RTL dump parser on the range of lines between START_LOC and
END_LOC (including those lines).   

References function_abi::base_abi(), cfun, crtl, error_at(), expand_location(), fndecl_abi(), init_emit(), init_varasm_status(), initialize_rtl(), and md_reader::read_file_fragment().

◆ strip_trailing_whitespace()

static void strip_trailing_whitespace ( char * desc)
static
Strip trailing whitespace from DESC.   

Referenced by function_reader::read_rtx_operand_r().