diff options
author | David Malcolm <dmalcolm@redhat.com> | 2016-05-10 18:28:10 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2016-05-10 18:28:10 +0000 |
commit | 601070fce9761f7665d5916c786fe065f3165c00 (patch) | |
tree | 4536dc681253ddda5e2965d30e5b73bfb1e4008a /gcc/read-md.h | |
parent | 3126957087d5ce8dc7e7c5f38118769732c335bc (diff) | |
download | gcc-601070fce9761f7665d5916c786fe065f3165c00.zip gcc-601070fce9761f7665d5916c786fe065f3165c00.tar.gz gcc-601070fce9761f7665d5916c786fe065f3165c00.tar.bz2 |
Simplify read-md.c and read-rtl.c using require_char_ws
read-md.c and read-rtl.c repeatedly use this pattern:
c = read_skip_spaces ();
if (c != ')')
fatal_expected_char (')', c);
Simplify them by introduce a helper function to do this.
gcc/ChangeLog:
* read-md.c (require_char_ws): New function.
(read_string): Simplify using require_char_ws.
(handle_constants): Likewise.
(handle_enum): Likewise.
(handle_file): Likewise.
* read-md.h (require_char_ws): New declaration.
* read-rtl.c (read_conditions): Simplify using require_char_ws.
(read_mapping): Likewise.
(read_rtx_code): Likewise.
(read_nested_rtx): Likewise.
From-SVN: r236101
Diffstat (limited to 'gcc/read-md.h')
-rw-r--r-- | gcc/read-md.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/read-md.h b/gcc/read-md.h index fc3b077..fa25951 100644 --- a/gcc/read-md.h +++ b/gcc/read-md.h @@ -141,6 +141,7 @@ 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 void require_char_ws (char expected); extern void read_name (struct md_name *); extern char *read_quoted_string (void); extern char *read_string (int); |