diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2015-07-16 13:41:41 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2015-07-16 13:41:41 +0000 |
commit | cc4726077d61d3c73edf2e909a397d78ec447540 (patch) | |
tree | a86b33cb3517b785698d786a2d59d9caef97b308 /gcc/read-md.h | |
parent | 1e2e5efadd0147f249be5bd4e32f91c9e571824b (diff) | |
download | gcc-cc4726077d61d3c73edf2e909a397d78ec447540.zip gcc-cc4726077d61d3c73edf2e909a397d78ec447540.tar.gz gcc-cc4726077d61d3c73edf2e909a397d78ec447540.tar.bz2 |
read-md.h (file_location): New structure.
gcc/
* read-md.h (file_location): New structure.
(directive_handler_t): Take a file_location rather than a line number.
(message_at, error_at): Declare.
(read_skip_construct): Delete.
* read-md.c (message_with_line_1): Replace with...
(message_at_1): ...this new function.
(message_at, error_at): New functions.
(message_with_line, error_with_line): Update to use message_at_1.
(handle_enum): Take a file_location rather than a line number
and use error_at for error reporting.
(handle_include): Likewise.
(read_skip_construct): Likewise. Make static.
(handle_file): Update after above changes. Pass a file_location
rather than a line number to handle_directive.
* gensupport.c (queue_elem): Replace separate filename and lineno
with a file_location.
(queue_pattern): Replace filename and lineno arguments with a
file_location. Update after change to queue_elem.
(process_define_predicate): Replace lineno argument with a
file_location and use error_at for error reporting. Update
after above changes.
(process_rtx): Likewise.
(subst_pattern_match): Likewise.
(get_alternatives_number): Likewise.
(alter_predicate_for_insn): Likewise.
(rtx_handle_directive): Likewise.
(is_predicable): Update after above changes, using error_at rather
than error_with_line.
(has_subst_attribute): Likewise.
(identify_predicable_attribute): Likewise.
(alter_attrs_for_subst_insn): Likewise.
(process_one_cond_exec): Likewise.
(process_substs_on_one_elem): Likewise.
(process_define_subst): Likewise.
(check_define_attr_duplicates): Likewise.
(read_md_rtx): Update after change to queue_elem.
From-SVN: r225879
Diffstat (limited to 'gcc/read-md.h')
-rw-r--r-- | gcc/read-md.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/gcc/read-md.h b/gcc/read-md.h index 97d08dc..54d0abe 100644 --- a/gcc/read-md.h +++ b/gcc/read-md.h @@ -22,6 +22,18 @@ along with GCC; see the file COPYING3. If not see #include "obstack.h" +/* Records a position in the file. */ +struct file_location { + file_location () {} + file_location (const char *, int); + + const char *filename; + int lineno; +}; + +inline file_location::file_location (const char *filename_in, int lineno_in) + : filename (filename_in), lineno (lineno_in) {} + /* Holds one symbol or number in the .md file. */ struct md_name { /* The name as it appeared in the .md file. Names are syntactically @@ -79,10 +91,10 @@ struct enum_type { }; /* 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 + including the closing ')'. It takes two arguments: the file position + at which the directive started, and the name of the directive. The next unread character is the optional space after the directive name. */ -typedef void (*directive_handler_t) (int, const char *); +typedef void (*directive_handler_t) (file_location, const char *); extern const char *in_fname; extern FILE *read_md_file; @@ -122,6 +134,8 @@ extern void fprint_md_ptr_loc (FILE *, const void *); extern const char *join_c_conditions (const char *, const char *); extern void print_c_condition (const char *); extern void fprint_c_condition (FILE *, const char *); +extern void message_at (file_location, const char *, ...) ATTRIBUTE_PRINTF_2; +extern void error_at (file_location, const char *, ...) ATTRIBUTE_PRINTF_2; extern void message_with_line (int, const char *, ...) ATTRIBUTE_PRINTF_2; extern void error_with_line (int, const char *, ...) ATTRIBUTE_PRINTF_2; extern void fatal_with_file_and_line (const char *, ...) @@ -131,7 +145,6 @@ extern int read_skip_spaces (void); extern void read_name (struct md_name *); extern char *read_quoted_string (void); extern char *read_string (int); -extern void read_skip_construct (int, int); extern int n_comma_elts (const char *); extern const char *scan_comma_elt (const char **); extern void upcase_string (char *); |