From: bje Date: Tue, 20 Mar 2001 19:30:13 +0000 (+0000) Subject: 2001-03-20 Ben Elliston X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=406e131329b1100ad840270bcca34bd97e1520e4;p=pf3gnuchains%2Fpf3gnuchains3x.git 2001-03-20 Ben Elliston * opc-itab.scm (-gen-insn-enum): Do not append a dummy `max' instruction onto the instruction list. Define MAX_INSNS to be the value of the last instruction enum plus one. --- diff --git a/cgen/ChangeLog b/cgen/ChangeLog index 5516409885..afa7ccc6f5 100644 --- a/cgen/ChangeLog +++ b/cgen/ChangeLog @@ -1,3 +1,9 @@ +2001-03-20 Ben Elliston + + * opc-itab.scm (-gen-insn-enum): Do not append a dummy `max' + instruction onto the instruction list. Define MAX_INSNS to be the + value of the last instruction enum plus one. + 2001-03-14 Nick Clifton * utils.scm (copyright-fsf): Add 2001. Remove (C). diff --git a/cgen/opc-itab.scm b/cgen/opc-itab.scm index 8f4f632c5c..ca55b2a5ed 100644 --- a/cgen/opc-itab.scm +++ b/cgen/opc-itab.scm @@ -292,17 +292,18 @@ (define (-gen-insn-enum) (logit 2 "Generating instruction enum ...\n") - (string-list - (gen-enum-decl 'cgen_insn_type "@arch@ instruction types" - "@ARCH@_INSN_" - (cons '(invalid) - (append (gen-obj-list-enums (non-multi-insns (current-insn-list))) - '((max))))) - "/* Index of `invalid' insn place holder. */\n" - "#define CGEN_INSN_INVALID @ARCH@_INSN_INVALID\n\n" - "/* Total number of insns in table. */\n" - "#define MAX_INSNS ((int) @ARCH@_INSN_MAX)\n\n" + (let ((insns (gen-obj-list-enums (non-multi-insns (current-insn-list))))) + (string-list + (gen-enum-decl 'cgen_insn_type "@arch@ instruction types" + "@ARCH@_INSN_" + (cons '(invalid) insns)) + "/* Index of `invalid' insn place holder. */\n" + "#define CGEN_INSN_INVALID @ARCH@_INSN_INVALID\n\n" + "/* Total number of insns in table. */\n" + "#define MAX_INSNS ((int) @ARCH@_INSN_" + (string-upcase (gen-c-symbol (caar (list-take -1 insns)))) " + 1)\n\n" ) + ) ) ; Return a reference to the format table entry of INSN.