OSDN Git Service

Backported from mainline
[pf3gnuchains/gcc-fork.git] / gcc / genpreds.c
index cd53845..de91349 100644 (file)
@@ -2,7 +2,7 @@
    - prototype declarations for operand predicates (tm-preds.h)
    - function definitions of operand predicates, if defined new-style
      (insn-preds.c)
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -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
@@ -1337,7 +1310,7 @@ write_insn_preds_c (void)
 #include \"flags.h\"\n\
 #include \"hard-reg-set.h\"\n\
 #include \"resource.h\"\n\
-#include \"toplev.h\"\n\
+#include \"diagnostic-core.h\"\n\
 #include \"reload.h\"\n\
 #include \"regs.h\"\n\
 #include \"tm-constrs.h\"\n");
@@ -1393,7 +1366,7 @@ main (int argc, char **argv)
   progname = argv[0];
   if (argc <= 1)
     fatal ("no input file name");
-  if (init_md_reader_args_cb (argc, argv, parse_option) != SUCCESS_EXIT_CODE)
+  if (!init_rtx_reader_args_cb (argc, argv, parse_option))
     return FATAL_EXIT_CODE;
 
   while ((defn = read_md_rtx (&pattern_lineno, &next_insn_code)) != 0)