summaryrefslogtreecommitdiff
path: root/gcc/genpreds.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-12 12:51:10 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-12 12:51:10 +0000
commit5d592141b494630b3d0cf28fff1f800df6d860da (patch)
treec16e8997e9a9118ec5c396648da48b7cba99bbb0 /gcc/genpreds.c
parente5bf7a7aaee7d5505d88aa352621c57fb8ba67c9 (diff)
downloadgcc-5d592141b494630b3d0cf28fff1f800df6d860da.tar.gz
gcc/
* genpreds.c (process_define_predicate): Move most processing to gensupport.c. Continue to validate the expression. * genrecog.c (did_you_mean_codes, compute_predicate_codes) (process_define_predicate): Move processing to gensupport.c. (main): Remove DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE cases. * gensupport.c (did_you_mean_codes): Moved from genrecog.c. (compute_predicate_codes): Moved from genrecog.c. Add lineno argument. (valid_predicate_name_p): New function, split out from old genpreds.c:process_define_predicate. (process_define_predicate): New function, combining code from old genpreds.c and genrecog.c functions. (process_rtx): Call it for DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172315 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genpreds.c')
-rw-r--r--gcc/genpreds.c29
1 files changed, 1 insertions, 28 deletions
diff --git a/gcc/genpreds.c b/gcc/genpreds.c
index fba43727fac..de913491469 100644
--- a/gcc/genpreds.c
+++ b/gcc/genpreds.c
@@ -93,34 +93,7 @@ validate_exp (rtx exp, const char *name, int lineno)
static void
process_define_predicate (rtx defn, int lineno)
{
- struct pred_data *pred;
- const char *p;
-
- if (!ISALPHA (XSTR (defn, 0)[0]) && XSTR (defn, 0)[0] != '_')
- goto bad_name;
- for (p = XSTR (defn, 0) + 1; *p; p++)
- if (!ISALNUM (*p) && *p != '_')
- goto bad_name;
-
- if (validate_exp (XEXP (defn, 1), XSTR (defn, 0), lineno))
- return;
-
- pred = XCNEW (struct pred_data);
- pred->name = XSTR (defn, 0);
- pred->exp = XEXP (defn, 1);
- pred->c_block = XSTR (defn, 2);
-
- if (GET_CODE (defn) == DEFINE_SPECIAL_PREDICATE)
- pred->special = true;
-
- add_predicate (pred);
- return;
-
- bad_name:
- error_with_line (lineno,
- "%s: predicate name must be a valid C function name",
- XSTR (defn, 0));
- return;
+ validate_exp (XEXP (defn, 1), XSTR (defn, 0), lineno);
}
/* Given a predicate, if it has an embedded C block, write the block