OSDN Git Service

libcpp/:
[pf3gnuchains/gcc-fork.git] / gcc / genconditions.c
index ae9a67e..65f64c0 100644 (file)
@@ -1,11 +1,12 @@
 /* Process machine description and calculate constant conditions.
-   Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007
+   Free Software Foundation, Inc.
 
    This file is part of GCC.
 
    GCC is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    GCC is distributed in the hope that it will be useful,
@@ -14,9 +15,8 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with GCC; see the file COPYING.  If not, write to
-   the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
 
 /* In a machine description, all of the insn patterns - define_insn,
    define_expand, define_split, define_peephole, define_peephole2 -
@@ -87,7 +87,8 @@ write_header (void)
 #include \"hard-reg-set.h\"\n\
 #include \"resource.h\"\n\
 #include \"toplev.h\"\n\
-#include \"reload.h\"\n");
+#include \"reload.h\"\n\
+#include \"tm-constrs.h\"\n");
 
   if (saw_eh_return)
     puts ("#define HAVE_eh_return 1");
@@ -160,12 +161,12 @@ struct c_test\n\
    vary at run time.  It works in 3.0.1 and later; 3.0 only when not\n\
    optimizing.  */\n\
 \n\
-static const struct c_test insn_conditions[] = {\n\
-#if GCC_VERSION >= 3001\n");
+#if GCC_VERSION >= 3001\n\
+static const struct c_test insn_conditions[] = {\n");
 
   traverse_c_tests (write_one_condition, 0);
 
-  puts ("\n#endif /* gcc >= 3.0.1 */\n};\n");
+  puts ("\n};\n#endif /* gcc >= 3.0.1 */\n");
 }
 
 /* Emit code which will convert the C-format table to a
@@ -181,6 +182,7 @@ write_writer (void)
        "  unsigned int i;\n"
         "  const char *p;\n"
         "  puts (\"(define_conditions [\");\n"
+       "#if GCC_VERSION >= 3001\n"
        "  for (i = 0; i < ARRAY_SIZE (insn_conditions); i++)\n"
        "    {\n"
        "      printf (\"  (%d \\\"\", insn_conditions[i].value);\n"
@@ -196,6 +198,7 @@ write_writer (void)
        "        }\n"
         "      puts (\"\\\")\");\n"
         "    }\n"
+       "#endif /* gcc >= 3.0.1 */\n"
        "  puts (\"])\");\n"
         "  fflush (stdout);\n"
         "return ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE;\n"