From 2ce2dc034fe07f9d62d0e0a1cd3d92f78696c552 Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Thu, 7 Dec 2000 12:27:00 +0000 Subject: [PATCH] 2000-12-07 Ben Elliston * sim-decode.scm (-gen-extract-case): Do not emit a definition for "insn" when there are zero ifields to extract. --- ChangeLog | 5 +++++ sim-decode.scm | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6964456..7028df7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-12-07 Ben Elliston + + * sim-decode.scm (-gen-extract-case): Do not emit a definition for + "insn" when there are zero ifields to extract. + 2000-12-04 Frank Ch. Eigler * utils-sim.scm (gen-define-argbuf-macro): Handle sfmt=#f case, to be diff --git a/sim-decode.scm b/sim-decode.scm index 78629a9..f6dcaab 100644 --- a/sim-decode.scm +++ b/sim-decode.scm @@ -433,10 +433,13 @@ void " extract_" (gen-sym sfmt) ":\n" " {\n" " const IDESC *idesc = &" IDESC-TABLE-VAR "[itype];\n" - " CGEN_INSN_INT insn = " - (if (adata-integral-insn? CURRENT-ARCH) - "entire_insn;\n" - "base_insn;\n") + (if (< (length (sfmt-iflds sfmt)) 0) + (string-append + " CGEN_INSN_INT insn = " + (if (adata-integral-insn? CURRENT-ARCH) + "entire_insn;\n" + "base_insn;\n")) + "") (gen-define-field-macro sfmt) (gen-define-ifields (sfmt-iflds sfmt) (sfmt-length sfmt) " " #f) "\n" -- 2.43.5