diff options
author | Zack Weinberg <zackw@panix.com> | 2001-08-13 15:56:51 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2001-08-13 15:56:51 +0000 |
commit | e78d8e5137ccd2a55617befdc052d1860e7f09f1 (patch) | |
tree | 0bf63396b6452b6ba1bd93f734ade1e7f708db6a /gcc/gencodes.c | |
parent | 050e4ca284c3028c7df662ba953be93f5b8fb47b (diff) | |
download | gcc-e78d8e5137ccd2a55617befdc052d1860e7f09f1.tar.gz |
expr.h: Split out optab- and libfunc-related code to...
* expr.h: Split out optab- and libfunc-related code to...
* optabs.h, libfuncs.h: ... these new headers.
* Makefile.in (CONFIG_H, EXPR_H): Take out insn-codes.h.
(OPTABS_H): New.
(various .o rules): Add $(OPTABS_H) and/or libfuncs.h to
dependencies.
* mkconfig.sh: Don't include insn-codes.h from config.h.
* reload.h: Use #ifdef GCC_INSN_CODES_H to decide whether
enum insn_code is available. Move reload_in_optab and
reload_out_optab array declarations to optabs.h.
* regmove.c (gen_add3_insn): Move to optabs.c, export from
there, prototype in expr.h.
* gencodes.c: Cleanup: zap global variables, don't use
printf where puts will do, don't bother defining MAX_INSN_CODE
which nothing uses, let CODE_FOR_nothing get its value implicitly.
* genemit.c, genopinit.c: Include optabs.h in generated file.
* genoutput.c: Include insn-codes.h in generated file.
* builtins.c, caller-save.c, combine.c, doloop.c, explow.c,
expmed.c, expr.c, function.c, ifcvt.c, loop.c, optabs.c, profile.c,
reload1.c, simplify-rtx.c, stmt.c, unroll.c, config/alpha/alpha.c,
config/arm/arm.c, config/c4x/c4x.c, config/clipper/clipper.c,
config/i386/i386.c, config/ia64/ia64.c, config/mn10300/mn10300.c,
config/pj/pj.c, config/sh/sh.c, config/sparc/sparc.c:
Include optabs.h.
* builtins.c, calls.c, dwarf2out.c, except.c, expr.c, function.c,
optabs.c, stmt.c, config/c4x/c4x.c, config/clipper/clipper.c,
config/m88k/m88k.c, config/sparc/sparc.c:
Include libfuncs.h.
* reload.c: Include expr.h and optabs.h before reload.h.
* config/alpha/alpha.c: Include tree.h before reload.h.
* config/pa/pa.c: Include expr.h, optabs.h, libfuncs.h,
and reload.h in that order.
* config/sparc/sparc.c: Include debug.h.
* recog.c: Include insn-codes.h.
cp:
* Make-lang.in (cp/except.o): Add libfuncs.h to dependencies.
* except.c: Include libfuncs.h.
java:
* Make-lang.in (java/decl.o): Update dependencies.
* decl.c: Include libfuncs.h, don't include toplev.h.
From-SVN: r44858
Diffstat (limited to 'gcc/gencodes.c')
-rw-r--r-- | gcc/gencodes.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/gcc/gencodes.c b/gcc/gencodes.c index 2610a12325f..ffcd1876215 100644 --- a/gcc/gencodes.c +++ b/gcc/gencodes.c @@ -28,20 +28,18 @@ Boston, MA 02111-1307, USA. */ #include "errors.h" #include "gensupport.h" -static int insn_code_number; - -static void gen_insn PARAMS ((rtx)); +static void gen_insn PARAMS ((const char *, int)); static void -gen_insn (insn) - rtx insn; +gen_insn (name, code) + const char *name; + int code; { /* Don't mention instructions whose names are the null string or begin with '*'. They are in the machine description just to be recognized. */ - if (XSTR (insn, 0)[0] != 0 && XSTR (insn, 0)[0] != '*') - printf (" CODE_FOR_%s = %d,\n", XSTR (insn, 0), - insn_code_number); + if (name[0] != 0 && name[0] != '*') + printf (" CODE_FOR_%s = %d,\n", name, code); } extern int main PARAMS ((int, char **)); @@ -61,33 +59,34 @@ main (argc, argv) if (init_md_reader (argv[1]) != SUCCESS_EXIT_CODE) return (FATAL_EXIT_CODE); - puts ("/* Generated automatically by the program `gencodes'"); - puts (" from the machine description file `md'. */\n"); - puts ("#ifndef GCC_INSN_CODES_H"); - puts ("#define GCC_INSN_CODES_H\n"); + puts ("\ +/* Generated automatically by the program `gencodes'\n\ + from the machine description file `md'. */\n\ +\n\ +#ifndef GCC_INSN_CODES_H\n\ +#define GCC_INSN_CODES_H\n\ +\n\ +enum insn_code {"); /* Read the machine description. */ - insn_code_number = 0; - printf ("enum insn_code {\n"); - while (1) { int line_no; + int insn_code_number; desc = read_md_rtx (&line_no, &insn_code_number); if (desc == NULL) break; if (GET_CODE (desc) == DEFINE_INSN || GET_CODE (desc) == DEFINE_EXPAND) - gen_insn (desc); + gen_insn (XSTR (desc, 0), insn_code_number); } - printf (" CODE_FOR_nothing = %d };\n", insn_code_number + 1); - - printf ("\n#define MAX_INSN_CODE ((int) CODE_FOR_nothing)\n\n"); - - puts("\n#endif /* GCC_INSN_CODES_H */"); + puts ("CODE_FOR_nothing\n\ +};\n\ +\n\ +#endif /* GCC_INSN_CODES_H */"); if (ferror (stdout) || fflush (stdout) || fclose (stdout)) return FATAL_EXIT_CODE; |