1 /* Generate attribute information shared between driver and core
2 compilers (insn-attr-common.h) from machine description. Split out
4 Copyright (C) 1991, 1994, 1996, 1998, 1999, 2000, 2003, 2004, 2007, 2008,
5 2010, 2011 Free Software Foundation, Inc.
7 This file is part of GCC.
9 GCC is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 3, or (at your option) any later
14 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING3. If not see
21 <http://www.gnu.org/licenses/>. */
26 #include "coretypes.h"
31 #include "gensupport.h"
34 main (int argc, char **argv)
37 bool have_delay = false;
38 bool have_sched = false;
40 progname = "genattr-common";
42 if (!init_rtx_reader_args (argc, argv))
43 return (FATAL_EXIT_CODE);
45 puts ("/* Generated automatically by the program `genattr-common'");
46 puts (" from the machine description file `md'. */\n");
47 puts ("#ifndef GCC_INSN_ATTR_COMMON_H");
48 puts ("#define GCC_INSN_ATTR_COMMON_H\n");
50 /* Read the machine description. */
54 int line_no, insn_code_number;
56 desc = read_md_rtx (&line_no, &insn_code_number);
60 if (GET_CODE (desc) == DEFINE_DELAY)
64 printf ("#define DELAY_SLOTS\n");
68 else if (GET_CODE (desc) == DEFINE_INSN_RESERVATION)
72 printf ("#define INSN_SCHEDULING\n");
77 puts ("\n#endif /* GCC_INSN_ATTR_COMMON_H */");
79 if (ferror (stdout) || fflush (stdout) || fclose (stdout))
80 return FATAL_EXIT_CODE;
82 return SUCCESS_EXIT_CODE;