GCC Middle and Back End API Reference
read-md.h File Reference

Go to the source code of this file.

Data Structures

struct  md_name
struct  md_constant
struct  enum_value
struct  enum_type

Typedefs

typedef void(* directive_handler_t )(int, const char *)

Functions

static int read_char ()
static void unread_char ()
hashval_t leading_string_hash (const void *)
int leading_string_eq_p (const void *, const void *)
void copy_md_ptr_loc (const void *, const void *)
void print_md_ptr_loc (const void *)
void fprint_md_ptr_loc (FILE *, const void *)
const char * join_c_conditions (const char *, const char *)
void print_c_condition (const char *)
void fprint_c_condition (FILE *, const char *)
void message_with_line (int, const char *,...) ATTRIBUTE_PRINTF_2
void error_with_line (int, const char *,...) ATTRIBUTE_PRINTF_2
void fatal_with_file_and_line (const char *,...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN
void fatal_expected_char (int, int) ATTRIBUTE_NORETURN
int read_skip_spaces (void)
void read_name (struct md_name *)
char * read_quoted_string (void)
char * read_string (int)
void read_skip_construct (int, int)
int n_comma_elts (const char *)
const char * scan_comma_elt (const char **)
void upcase_string (char *)
void traverse_md_constants (htab_trav, void *)
void traverse_enum_types (htab_trav, void *)
struct enum_typelookup_enum_type (const char *)
bool read_md_files (int, char **, bool(*)(const char *), directive_handler_t)

Variables

const char * in_fname
FILE * read_md_file
int read_md_lineno
const char * read_md_filename
struct obstack string_obstack
void(* include_callback )(const char *)

Typedef Documentation

typedef void(* directive_handler_t)(int, const char *)
A callback that handles a single .md-file directive, up to but not
   including the closing ')'.  It takes two arguments: the line number on
   which the directive started, and the name of the directive.  The next
   unread character is the optional space after the directive name.   

Function Documentation

void copy_md_ptr_loc ( const void *  ,
const void *   
)
void error_with_line ( int  ,
const char *  ,
  ... 
)
void fatal_expected_char ( int  ,
int   
)
void fatal_with_file_and_line ( const char *  ,
  ... 
)
void fprint_c_condition ( FILE *  ,
const char *   
)
void fprint_md_ptr_loc ( FILE *  ,
const void *   
)
const char* join_c_conditions ( const char *  ,
const char *   
)
int leading_string_eq_p ( const void *  ,
const void *   
)
hashval_t leading_string_hash ( const void *  )
struct enum_type* lookup_enum_type ( const char *  )
read
void message_with_line ( int  ,
const char *  ,
  ... 
)
int n_comma_elts ( const char *  )
void print_c_condition ( const char *  )
void print_md_ptr_loc ( const void *  )
static int read_char ( )
inlinestatic
Read the next character from the MD file.   

References read_md_file, and read_md_lineno.

Referenced by fatal_with_file_and_line(), read_braced_string(), read_escape(), read_name(), read_quoted_string(), and read_skip_spaces().

bool read_md_files ( int  argc,
char **  argv,
bool(*)(const char *)  parse_opt,
directive_handler_t  handle_directive 
)
The main routine for reading .md files.  Try to process all the .md
   files specified on the command line and return true if no error occurred.

   ARGC and ARGV are the arguments to main.

   PARSE_OPT, if nonnull, is passed all unknown command-line arguments.
   It should return true if it recognizes the argument or false if a
   generic error should be reported.

   If HANDLE_DIRECTIVE is nonnull, the parser calls it for each
   unknown directive, otherwise it just skips such directives.
   See the comment above the directive_handler_t definition for
   details about the callback's interface.   

References enum_types, fatal(), handle_toplevel_file(), have_error, joined_conditions, joined_conditions_obstack, leading_ptr_eq_p(), leading_ptr_hash(), leading_string_eq_p(), leading_string_hash(), md_constants, parse_include(), ptr_loc_obstack, ptr_locs, read_md_file, read_md_filename, and string_obstack.

Referenced by init_rtx_reader_args_cb(), and main().

void read_name ( struct md_name )
char* read_quoted_string ( void  )
Read a double-quoted string onto the obstack.  Caller has scanned
   the leading quote.   

References read_char(), read_escape(), and string_obstack.

Referenced by read_conditions(), and read_string().

void read_skip_construct ( int  ,
int   
)
int read_skip_spaces ( void  )
Read chars from the MD file until a non-whitespace char and return that.
   Comments, both Lisp style and C style, are treated as whitespace.   

References fatal_with_file_and_line(), read_char(), and unread_char().

Referenced by handle_constants(), handle_enum(), handle_file(), read_conditions(), read_mapping(), read_name(), read_nested_rtx(), read_rtx_code(), read_rtx_variadic(), read_skip_construct(), and read_string().

char* read_string ( int  )
const char* scan_comma_elt ( const char **  )
void traverse_enum_types ( htab_trav  ,
void *   
)
void traverse_md_constants ( htab_trav  ,
void *   
)
static void unread_char ( )
inlinestatic
Put back CH, which was the last character read from the MD file.   

References read_md_file, and read_md_lineno.

Referenced by fatal_with_file_and_line(), handle_enum(), read_mapping(), read_name(), read_rtx_code(), read_rtx_variadic(), read_skip_construct(), and read_skip_spaces().

void upcase_string ( char *  )

Variable Documentation

const char* in_fname
The name of the toplevel file that indirectly included READ_MD_FILE.   

Referenced by handle_toplevel_file(), write_insn_preds_c(), write_tm_constrs_h(), and write_tm_preds_h().

void(* include_callback)(const char *)
This callback will be invoked whenever an md include directive is
   processed.  To be used for creation of the dependency file.   

Referenced by handle_include(), and main().

FILE* read_md_file
The file we are reading.   

Referenced by handle_file(), handle_include(), read_char(), read_md_files(), and unread_char().

int read_md_lineno