From 3604118da2f0e62a75ebd6d206a8cd3ef2573b01 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Tue, 10 May 2016 18:28:10 +0000 Subject: 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236101 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/read-md.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/read-md.h') diff --git a/gcc/read-md.h b/gcc/read-md.h index fc3b077325b..fa259517a26 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); -- cgit v1.2.1