diff options
author | kan <kan@FreeBSD.org> | 2003-07-11 03:40:53 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2003-07-11 03:40:53 +0000 |
commit | b2a8872fbe1ec1c49094559ac7b78e6ea4ab7180 (patch) | |
tree | f6b0610f4a17fd26aa234354f050080f789861a4 /contrib/gcc/gencodes.c | |
parent | 52e69d78eee5612ac195e0701a5cebe40d1ab0e1 (diff) | |
download | FreeBSD-src-b2a8872fbe1ec1c49094559ac7b78e6ea4ab7180.zip FreeBSD-src-b2a8872fbe1ec1c49094559ac7b78e6ea4ab7180.tar.gz |
Gcc 3.3.1-pre as of 2003-07-11.
Diffstat (limited to 'contrib/gcc/gencodes.c')
-rw-r--r-- | contrib/gcc/gencodes.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/contrib/gcc/gencodes.c b/contrib/gcc/gencodes.c index 0611eec..5a29282 100644 --- a/contrib/gcc/gencodes.c +++ b/contrib/gcc/gencodes.c @@ -28,18 +28,26 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "errors.h" #include "gensupport.h" -static void gen_insn PARAMS ((const char *, int)); +static void gen_insn PARAMS ((rtx, int)); static void -gen_insn (name, code) - const char *name; +gen_insn (insn, code) + rtx insn; int code; { + const char *name = XSTR (insn, 0); + int truth = maybe_eval_c_test (XSTR (insn, 2)); + /* Don't mention instructions whose names are the null string or begin with '*'. They are in the machine description just to be recognized. */ if (name[0] != 0 && name[0] != '*') - printf (" CODE_FOR_%s = %d,\n", name, code); + { + if (truth == 0) + printf ("#define CODE_FOR_%s CODE_FOR_nothing\n", name); + else + printf (" CODE_FOR_%s = %d,\n", name, code); + } } extern int main PARAMS ((int, char **)); @@ -53,6 +61,10 @@ main (argc, argv) progname = "gencodes"; + /* We need to see all the possibilities. Elided insns may have + direct references to CODE_FOR_xxx in C code. */ + insn_elision = 0; + if (argc <= 1) fatal ("no input file name"); @@ -80,10 +92,10 @@ enum insn_code {"); break; if (GET_CODE (desc) == DEFINE_INSN || GET_CODE (desc) == DEFINE_EXPAND) - gen_insn (XSTR (desc, 0), insn_code_number); + gen_insn (desc, insn_code_number); } - puts ("CODE_FOR_nothing\n\ + puts (" CODE_FOR_nothing\n\ };\n\ \n\ #endif /* GCC_INSN_CODES_H */"); |