summaryrefslogtreecommitdiff
path: root/gcc/genrecog.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-10 20:21:59 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-10 20:21:59 +0000
commitb638f5c89f99cde8200a4af4de2ebf32f1c4d62c (patch)
tree2e3c136c636393db4c15e2660800e0141d0d6d70 /gcc/genrecog.c
parentb3453c30d65f1279208412f31c2ee423982c56a7 (diff)
downloadgcc-b638f5c89f99cde8200a4af4de2ebf32f1c4d62c.tar.gz
gcc/
* Makefile.in (build/read-md.o): Depend on errors.h. * read-md.h (error_with_line): Declare. * read-md.c: Include errors.h. (message_with_line_1): New function, extracted from... (message_with_line): ...here. (error_with_line): New function. * genattrtab.c: If a call to message_with_line is followed by "have_error = 1;", replace both statements with a call to error_with_line. * genoutput.c: Likewise. * genpreds.c: Likewise. * genrecog.c: If a call to message_with_line is followed by "error_count++;", replace both statements with a call to error_with_line. (errorcount): Delete. (main): Don't check it. * gensupport.c: If a call to message_with_line is followed by "errors = 1;", replace both statements with a call to error_with_line. (errors): Delete. (process_define_cond_exec): Check have_error instead of errors. (init_md_reader_args_cb): Likewise. Don't set errors. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160573 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genrecog.c')
-rw-r--r--gcc/genrecog.c80
1 files changed, 29 insertions, 51 deletions
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index a8b8bdd4afd..a5e069f2dac 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -170,9 +170,6 @@ static int max_depth;
/* The line number of the start of the pattern currently being processed. */
static int pattern_lineno;
-
-/* Count of errors. */
-static int error_count;
/* Predicate handling.
@@ -289,8 +286,7 @@ compute_predicate_codes (rtx exp, char codes[NUM_RTX_CODE])
if (*next_code == '\0')
{
- message_with_line (pattern_lineno, "empty match_code expression");
- error_count++;
+ error_with_line (pattern_lineno, "empty match_code expression");
break;
}
@@ -309,9 +305,9 @@ compute_predicate_codes (rtx exp, char codes[NUM_RTX_CODE])
}
if (!found_it)
{
- message_with_line (pattern_lineno, "match_code \"%.*s\" matches nothing",
- (int) n, code);
- error_count ++;
+ error_with_line (pattern_lineno,
+ "match_code \"%.*s\" matches nothing",
+ (int) n, code);
for (i = 0; i < NUM_RTX_CODE; i++)
if (!strncasecmp (code, GET_RTX_NAME (i), n)
&& GET_RTX_NAME (i)[n] == '\0'
@@ -333,10 +329,9 @@ compute_predicate_codes (rtx exp, char codes[NUM_RTX_CODE])
struct pred_data *p = lookup_predicate (XSTR (exp, 1));
if (!p)
{
- message_with_line (pattern_lineno,
- "reference to unknown predicate '%s'",
- XSTR (exp, 1));
- error_count++;
+ error_with_line (pattern_lineno,
+ "reference to unknown predicate '%s'",
+ XSTR (exp, 1));
break;
}
for (i = 0; i < NUM_RTX_CODE; i++)
@@ -351,10 +346,9 @@ compute_predicate_codes (rtx exp, char codes[NUM_RTX_CODE])
break;
default:
- message_with_line (pattern_lineno,
- "'%s' cannot be used in a define_predicate expression",
- GET_RTX_NAME (GET_CODE (exp)));
- error_count++;
+ error_with_line (pattern_lineno,
+ "'%s' cannot be used in a define_predicate expression",
+ GET_RTX_NAME (GET_CODE (exp)));
memset (codes, I, NUM_RTX_CODE);
break;
}
@@ -634,12 +628,9 @@ validate_pattern (rtx pattern, rtx insn, rtx set, int set_code)
case MATCH_OP_DUP:
case MATCH_PAR_DUP:
if (find_operand (insn, XINT (pattern, 0), pattern) == pattern)
- {
- message_with_line (pattern_lineno,
- "operand %i duplicated before defined",
- XINT (pattern, 0));
- error_count++;
- }
+ error_with_line (pattern_lineno,
+ "operand %i duplicated before defined",
+ XINT (pattern, 0));
break;
case MATCH_OPERAND:
case MATCH_OPERATOR:
@@ -695,20 +686,14 @@ validate_pattern (rtx pattern, rtx insn, rtx set, int set_code)
&& find_matching_operand (insn, XINT (pattern, 0)))
;
else
- {
- message_with_line (pattern_lineno,
- "operand %d missing in-out reload",
- XINT (pattern, 0));
- error_count++;
- }
- }
- else if (constraints0 != '=' && constraints0 != '+')
- {
- message_with_line (pattern_lineno,
- "operand %d missing output reload",
+ error_with_line (pattern_lineno,
+ "operand %d missing in-out reload",
XINT (pattern, 0));
- error_count++;
}
+ else if (constraints0 != '=' && constraints0 != '+')
+ error_with_line (pattern_lineno,
+ "operand %d missing output reload",
+ XINT (pattern, 0));
}
}
@@ -782,12 +767,9 @@ validate_pattern (rtx pattern, rtx insn, rtx set, int set_code)
/* The operands of a SET must have the same mode unless one
is VOIDmode. */
else if (dmode != VOIDmode && smode != VOIDmode && dmode != smode)
- {
- message_with_line (pattern_lineno,
- "mode mismatch in set: %smode vs %smode",
- GET_MODE_NAME (dmode), GET_MODE_NAME (smode));
- error_count++;
- }
+ error_with_line (pattern_lineno,
+ "mode mismatch in set: %smode vs %smode",
+ GET_MODE_NAME (dmode), GET_MODE_NAME (smode));
/* If only one of the operands is VOIDmode, and PC or CC0 is
not involved, it's probably a mistake. */
@@ -828,12 +810,9 @@ validate_pattern (rtx pattern, rtx insn, rtx set, int set_code)
case LABEL_REF:
if (GET_MODE (XEXP (pattern, 0)) != VOIDmode)
- {
- message_with_line (pattern_lineno,
- "operand to label_ref %smode not VOIDmode",
- GET_MODE_NAME (GET_MODE (XEXP (pattern, 0))));
- error_count++;
- }
+ error_with_line (pattern_lineno,
+ "operand to label_ref %smode not VOIDmode",
+ GET_MODE_NAME (GET_MODE (XEXP (pattern, 0))));
break;
default:
@@ -1494,12 +1473,11 @@ merge_accept_insn (struct decision *oldd, struct decision *addd)
}
else
{
- message_with_line (add->u.insn.lineno, "`%s' matches `%s'",
- get_insn_name (add->u.insn.code_number),
- get_insn_name (old->u.insn.code_number));
+ error_with_line (add->u.insn.lineno, "`%s' matches `%s'",
+ get_insn_name (add->u.insn.code_number),
+ get_insn_name (old->u.insn.code_number));
message_with_line (old->u.insn.lineno, "previous definition of `%s'",
get_insn_name (old->u.insn.code_number));
- error_count++;
}
}
@@ -2771,7 +2749,7 @@ main (int argc, char **argv)
}
}
- if (error_count || have_error)
+ if (have_error)
return FATAL_EXIT_CODE;
puts ("\n\n");