Mercurial > hg > CbC > CbC_gcc
diff gcc/genpreds.c @ 67:f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 17:18:12 +0900 |
parents | b7f97abdc517 |
children | 04ced10e8804 |
line wrap: on
line diff
--- a/gcc/genpreds.c Tue May 25 18:58:51 2010 +0900 +++ b/gcc/genpreds.c Tue Mar 22 17:18:12 2011 +0900 @@ -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. @@ -28,6 +28,7 @@ #include "rtl.h" #include "errors.h" #include "obstack.h" +#include "read-md.h" #include "gensupport.h" /* Given a predicate expression EXP, from form NAME at line LINENO, @@ -66,9 +67,8 @@ { if (!ISDIGIT (*p) && !ISLOWER (*p)) { - message_with_line (lineno, "%s: invalid character in path " - "string '%s'", name, XSTR (exp, 1)); - have_error = 1; + error_with_line (lineno, "%s: invalid character in path " + "string '%s'", name, XSTR (exp, 1)); return true; } } @@ -81,10 +81,9 @@ return false; default: - message_with_line (lineno, - "%s: cannot use '%s' in a predicate expression", - name, GET_RTX_NAME (GET_CODE (exp))); - have_error = 1; + error_with_line (lineno, + "%s: cannot use '%s' in a predicate expression", + name, GET_RTX_NAME (GET_CODE (exp))); return true; } } @@ -118,10 +117,9 @@ return; bad_name: - message_with_line (lineno, - "%s: predicate name must be a valid C function name", - XSTR (defn, 0)); - have_error = 1; + error_with_line (lineno, + "%s: predicate name must be a valid C function name", + XSTR (defn, 0)); return; } @@ -183,7 +181,7 @@ printf ("static inline int\n" "%s_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)\n", p->name); - print_rtx_ptr_loc (p->c_block); + print_md_ptr_loc (p->c_block); if (p->c_block[0] == '{') fputs (p->c_block, stdout); else @@ -764,12 +762,11 @@ if (!ISALPHA (name[0]) && name[0] != '_') { if (name[1] == '\0') - message_with_line (lineno, "constraint name '%s' is not " - "a letter or underscore", name); + error_with_line (lineno, "constraint name '%s' is not " + "a letter or underscore", name); else - message_with_line (lineno, "constraint name '%s' does not begin " - "with a letter or underscore", name); - have_error = 1; + error_with_line (lineno, "constraint name '%s' does not begin " + "with a letter or underscore", name); return; } for (p = name; *p; p++) @@ -779,11 +776,10 @@ need_mangled_name = true; else { - message_with_line (lineno, - "constraint name '%s' must be composed of " - "letters, digits, underscores, and " - "angle brackets", name); - have_error = 1; + error_with_line (lineno, + "constraint name '%s' must be composed of " + "letters, digits, underscores, and " + "angle brackets", name); return; } } @@ -791,13 +787,12 @@ if (strchr (generic_constraint_letters, name[0])) { if (name[1] == '\0') - message_with_line (lineno, "constraint letter '%s' cannot be " - "redefined by the machine description", name); + error_with_line (lineno, "constraint letter '%s' cannot be " + "redefined by the machine description", name); else - message_with_line (lineno, "constraint name '%s' cannot be defined by " - "the machine description, as it begins with '%c'", - name, name[0]); - have_error = 1; + error_with_line (lineno, "constraint name '%s' cannot be defined by " + "the machine description, as it begins with '%c'", + name, name[0]); return; } @@ -816,25 +811,22 @@ if (!strcmp ((*iter)->name, name)) { - message_with_line (lineno, "redefinition of constraint '%s'", name); + error_with_line (lineno, "redefinition of constraint '%s'", name); message_with_line ((*iter)->lineno, "previous definition is here"); - have_error = 1; return; } else if (!strncmp ((*iter)->name, name, (*iter)->namelen)) { - message_with_line (lineno, "defining constraint '%s' here", name); + error_with_line (lineno, "defining constraint '%s' here", name); message_with_line ((*iter)->lineno, "renders constraint '%s' " "(defined here) a prefix", (*iter)->name); - have_error = 1; return; } else if (!strncmp ((*iter)->name, name, namelen)) { - message_with_line (lineno, "constraint '%s' is a prefix", name); + error_with_line (lineno, "constraint '%s' is a prefix", name); message_with_line ((*iter)->lineno, "of constraint '%s' " "(defined here)", (*iter)->name); - have_error = 1; return; } } @@ -855,43 +847,36 @@ GET_RTX_NAME (appropriate_code))) { if (name[1] == '\0') - message_with_line (lineno, "constraint letter '%c' is reserved " - "for %s constraints", - name[0], GET_RTX_NAME (appropriate_code)); + error_with_line (lineno, "constraint letter '%c' is reserved " + "for %s constraints", + name[0], GET_RTX_NAME (appropriate_code)); else - message_with_line (lineno, "constraint names beginning with '%c' " - "(%s) are reserved for %s constraints", - name[0], name, - GET_RTX_NAME (appropriate_code)); - - have_error = 1; + error_with_line (lineno, "constraint names beginning with '%c' " + "(%s) are reserved for %s constraints", + name[0], name, GET_RTX_NAME (appropriate_code)); return; } if (is_memory) { if (name[1] == '\0') - message_with_line (lineno, "constraint letter '%c' cannot be a " - "memory constraint", name[0]); + error_with_line (lineno, "constraint letter '%c' cannot be a " + "memory constraint", name[0]); else - message_with_line (lineno, "constraint name '%s' begins with '%c', " - "and therefore cannot be a memory constraint", - name, name[0]); - - have_error = 1; + error_with_line (lineno, "constraint name '%s' begins with '%c', " + "and therefore cannot be a memory constraint", + name, name[0]); return; } else if (is_address) { if (name[1] == '\0') - message_with_line (lineno, "constraint letter '%c' cannot be a " - "memory constraint", name[0]); + error_with_line (lineno, "constraint letter '%c' cannot be a " + "memory constraint", name[0]); else - message_with_line (lineno, "constraint name '%s' begins with '%c', " - "and therefore cannot be a memory constraint", - name, name[0]); - - have_error = 1; + error_with_line (lineno, "constraint name '%s' begins with '%c', " + "and therefore cannot be a memory constraint", + name, name[0]); return; } } @@ -1352,7 +1337,7 @@ #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"); @@ -1408,7 +1393,7 @@ 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)