Deleted Added
full compact
1/* Generate from machine description:
2 - some macros CODE_FOR_... giving the insn_code_number value
3 for each of the defined standard insn names.
4 Copyright (C) 1987, 1991, 1995, 1998,
5 1999, 2000, 2001 Free Software Foundation, Inc.
6
7This file is part of GCC.
8

--- 14 unchanged lines hidden (view full) ---

23
24
25#include "hconfig.h"
26#include "system.h"
27#include "rtl.h"
28#include "errors.h"
29#include "gensupport.h"
30
31static void gen_insn PARAMS ((const char *, int));
32
33static void
34gen_insn (name, code)
35 const char *name;
36 int code;
37{
38 /* Don't mention instructions whose names are the null string
39 or begin with '*'. They are in the machine description just
40 to be recognized. */
41 if (name[0] != 0 && name[0] != '*')
42 printf (" CODE_FOR_%s = %d,\n", name, code);
43}
44
45extern int main PARAMS ((int, char **));
46
47int
48main (argc, argv)
49 int argc;
50 char **argv;
51{
52 rtx desc;
53
54 progname = "gencodes";
55
56 if (argc <= 1)
57 fatal ("no input file name");
58
59 if (init_md_reader_args (argc, argv) != SUCCESS_EXIT_CODE)
60 return (FATAL_EXIT_CODE);
61
62 puts ("\
63/* Generated automatically by the program `gencodes'\n\

--- 11 unchanged lines hidden (view full) ---

75 int line_no;
76 int insn_code_number;
77
78 desc = read_md_rtx (&line_no, &insn_code_number);
79 if (desc == NULL)
80 break;
81
82 if (GET_CODE (desc) == DEFINE_INSN || GET_CODE (desc) == DEFINE_EXPAND)
83 gen_insn (XSTR (desc, 0), insn_code_number);
84 }
85
86 puts ("CODE_FOR_nothing\n\
87};\n\
88\n\
89#endif /* GCC_INSN_CODES_H */");
90
91 if (ferror (stdout) || fflush (stdout) || fclose (stdout))
92 return FATAL_EXIT_CODE;
93
94 return SUCCESS_EXIT_CODE;
95}
96
97/* Define this so we can link with print-rtl.o to get debug_rtx function. */
98
99const char *
100get_insn_name (code)
101 int code ATTRIBUTE_UNUSED;
102{
103 return NULL;
104}