GCC Middle and Back End API Reference
read-md.h File Reference
#include "obstack.h"
#include "hashtab.h"
Include dependency graph for read-md.h:
This graph shows which files directly or indirectly include this file:

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.

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.

 Initialize global data.   
 Unlock the stdio streams.   
 First we loop over all the options.   
       An argument consisting of exactly one dash is a request to
       read stdin.  This will be handled in the second loop.   
       An argument consisting of just two dashes causes option
       parsing to cease.   
       The program may have provided a callback so it can
       accept its own options.   
 Now loop over all input files.   
             Read stdin.   
             No further arguments are to be treated as options.   
     If we get here we are looking at a non-option argument, i.e.
     a file to be processed.   
 If we get to this point without having seen any files to process,
 read the standard input now.   

Referenced by gen_mnemonic_attr(), 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.

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.

Referenced by handle_constants().

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.

Referenced by error_with_line(), fatal_expected_char(), read_rtx_code(), and traverse_md_constants().

void upcase_string ( char *  )

Variable Documentation

const char* in_fname

The name of the toplevel file that indirectly included READ_MD_FILE.

Referenced by write_insn_constraint_len().

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 main().

FILE* read_md_file

The file we are reading.

const char* read_md_filename

The filename of READ_MD_FILE.

Referenced by fprint_c_condition(), and main().

int read_md_lineno

The current line number in READ_MD_FILE.

struct obstack string_obstack

Obstack used for allocating MD strings.

Referenced by gen_mnemonic_setattr(), handle_file(), and process_define_subst().