aboutsummaryrefslogtreecommitdiff
path: root/gcc/gensupport.c
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@redhat.com>2004-08-27 10:12:51 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2004-08-27 10:12:51 +0000
commit57406c63cd1ce307b1f4df4d24468a1df7fc59d7 (patch)
tree19986beafca6533f327d3eb48031c4616e3a888d /gcc/gensupport.c
parent6a6bfc8e70897234a262527a07d80b6036282b8e (diff)
downloadgcc-57406c63cd1ce307b1f4df4d24468a1df7fc59d7.zip
gcc-57406c63cd1ce307b1f4df4d24468a1df7fc59d7.tar.gz
gcc-57406c63cd1ce307b1f4df4d24468a1df7fc59d7.tar.bz2
rtl.h (read_rtx): Change prototype.
* rtl.h (read_rtx): Change prototype. * read-rtl.c (read_rtx): Provide the caller with both an rtx and a line number. Return true on success. * gensupport.c (process_include, init_md_reader_args_cb): Adjust callers accordingly. From-SVN: r86657
Diffstat (limited to 'gcc/gensupport.c')
-rw-r--r--gcc/gensupport.c34
1 files changed, 6 insertions, 28 deletions
diff --git a/gcc/gensupport.c b/gcc/gensupport.c
index 618e1a2..8767068 100644
--- a/gcc/gensupport.c
+++ b/gcc/gensupport.c
@@ -246,20 +246,8 @@ process_include (rtx desc, int lineno)
read_rtx_lineno = 1;
/* Read the entire file. */
- while (1)
- {
- rtx desc;
- int c;
-
- c = read_skip_spaces (input_file);
- if (c == EOF)
- break;
-
- ungetc (c, input_file);
- lineno = read_rtx_lineno;
- desc = read_rtx (input_file);
- process_rtx (desc, lineno);
- }
+ while (read_rtx (input_file, &desc, &lineno))
+ process_rtx (desc, lineno);
/* Do not free pathname. It is attached to the various rtx queue
elements. */
@@ -911,9 +899,10 @@ int
init_md_reader_args_cb (int argc, char **argv, bool (*parse_opt)(const char *))
{
FILE *input_file;
- int i;
+ int i, lineno;
size_t ix;
char *lastsl;
+ rtx desc;
for (i = 1; i < argc; i++)
{
@@ -991,19 +980,8 @@ init_md_reader_args_cb (int argc, char **argv, bool (*parse_opt)(const char *))
sequence_num = 0;
/* Read the entire file. */
- while (1)
- {
- rtx desc;
- int lineno;
- int c = read_skip_spaces (input_file);
- if (c == EOF)
- break;
-
- ungetc (c, input_file);
- lineno = read_rtx_lineno;
- desc = read_rtx (input_file);
- process_rtx (desc, lineno);
- }
+ while (read_rtx (input_file, &desc, &lineno))
+ process_rtx (desc, lineno);
fclose (input_file);
/* Process define_cond_exec patterns. */