diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2010-06-10 20:21:44 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2010-06-10 20:21:44 +0000 |
commit | c5e88b399c526dbb7ab2bc6b4fdbc0e8100fa3d9 (patch) | |
tree | cf86a2e45130a51690d5994f074ff828e9d308ed /gcc/read-md.h | |
parent | d2a3ce4e3374de54b231d98bd78613c8dc18d9a4 (diff) | |
download | gcc-c5e88b399c526dbb7ab2bc6b4fdbc0e8100fa3d9.zip gcc-c5e88b399c526dbb7ab2bc6b4fdbc0e8100fa3d9.tar.gz gcc-c5e88b399c526dbb7ab2bc6b4fdbc0e8100fa3d9.tar.bz2 |
read-md.h (read_md_file): Declare.
gcc/
* read-md.h (read_md_file): Declare.
(read_char, unread_char): New functions.
(fatal_with_file_and_line, fatal_expected_char, read_skip_spaces)
(read_quoted_string, read_string): Remove FILE * argument.
* read-md.c (read_md_file): New variable.
(read_md_filename, read_md_lineno): Update comments and remove
unnecessary initialization.
(fatal_with_file_and_line, fatal_expected_char, read_skip_spaces)
(read_escape, read_quoted_string, read_braced_string, read_string):
Remove FILE * argument. Update calls accordingly, using read_char
and unread_char instead of getc and ungetc.
* rtl.h (read_rtx): Remove FILE * argument.
* read-rtl.c (iterator_group): Remove FILE * argument from
"find_builtin".
(iterator_traverse_data): Remove "infile" field.
(find_mode, find_code, apply_mode_maps, apply_iterator_to_rtx)
(add_mapping, read_name, read_constants, read_conditions)
(validate_const_int, find_iterator, read_mapping, check_code_iterator)
(read_rtx, read_rtx_1, read_rtx_variadic): Remove FILE * argument.
Remove file arguments from all calls, using read_char and unread_char
instead of getc and ungetc.
* gensupport.c (process_include): Preserve read_md_file around
the include. Set read_md_file to the handle of the included file.
Update call to read_rtx.
(init_md_reader_args_cb): Set read_md_file to the handle of the file
and remove local FILE *. Update calls to read_rtx.
From-SVN: r160572
Diffstat (limited to 'gcc/read-md.h')
-rw-r--r-- | gcc/read-md.h | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/gcc/read-md.h b/gcc/read-md.h index dd492be..a11d911 100644 --- a/gcc/read-md.h +++ b/gcc/read-md.h @@ -21,21 +21,38 @@ along with GCC; see the file COPYING3. If not see #include "obstack.h" +extern FILE *read_md_file; extern int read_md_lineno; extern const char *read_md_filename; extern struct obstack string_obstack; +/* Read the next character from the MD file. */ + +static inline int +read_char (void) +{ + return getc (read_md_file); +} + +/* Put back CH, which was the last character read from the MD file. */ + +static inline void +unread_char (int ch) +{ + ungetc (ch, read_md_file); +} + extern void copy_md_ptr_loc (const void *, const void *); extern void print_md_ptr_loc (const void *); extern const char *join_c_conditions (const char *, const char *); extern void print_c_condition (const char *); extern void message_with_line (int, const char *, ...) ATTRIBUTE_PRINTF_2; -extern void fatal_with_file_and_line (FILE *, const char *, ...) - ATTRIBUTE_PRINTF_2 ATTRIBUTE_NORETURN; -extern void fatal_expected_char (FILE *, int, int) ATTRIBUTE_NORETURN; -extern int read_skip_spaces (FILE *); -extern char *read_quoted_string (FILE *); -extern char *read_string (FILE *, int); +extern void fatal_with_file_and_line (const char *, ...) + ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; +extern void fatal_expected_char (int, int) ATTRIBUTE_NORETURN; +extern int read_skip_spaces (void); +extern char *read_quoted_string (void); +extern char *read_string (int); extern int n_comma_elts (const char *); extern const char *scan_comma_elt (const char **); extern void init_md_reader (void); |