]> sourceware.org Git - cgen.git/commitdiff
2001-03-20 Ben Elliston <bje@redhat.com>
authorBen Elliston <bje@air.not.au>
Tue, 20 Mar 2001 19:30:13 +0000 (19:30 +0000)
committerBen Elliston <bje@air.not.au>
Tue, 20 Mar 2001 19:30:13 +0000 (19:30 +0000)
* 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.

ChangeLog
opc-itab.scm

index 55164098850ae739e0f717ee96b638b2f49ca46f..afa7ccc6f5f1c8d24a9e0245ca9f2ac2e23d2940 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-03-20  Ben Elliston  <bje@redhat.com>
+
+       * 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  <nickc@redhat.com>
 
        * utils.scm (copyright-fsf): Add 2001.  Remove (C).
index 8f4f632c5c1218fefb3f3eecf265cab5c5b85c14..ca55b2a5ed3ec788ca53be6b9eab93fb040e261a 100644 (file)
 
 (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.
This page took 0.036364 seconds and 5 git commands to generate.