From patchwork Thu Mar 7 18:56:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 159925 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp7819944jad; Thu, 7 Mar 2019 11:35:01 -0800 (PST) X-Google-Smtp-Source: APXvYqwU7oRmjqiH1G9u+p7yrku+aq9Ej4lM8bI9ZP/1iugnBhVnkqxEf+ajFkY0VvWVHxf6rknb X-Received: by 2002:a25:ce81:: with SMTP id x123mr7337827ybe.355.1551987301706; Thu, 07 Mar 2019 11:35:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551987301; cv=none; d=google.com; s=arc-20160816; b=mIZSQjNEVFXhg+s86IuS7un63Mucf6K9872sfO6LBZfkwVeLyW1jrzXFOXFJWhvoAf VMMYoFZ3uPWMze6j9LhsM5DhCLjk1iJG3XEs1e7FUbcClTFA6AbbwZLhPQEoaOT1aWuL reDDUjFEh0PQdQFpcbVaF7jdYwACFVDQ+JrqwPZc3kxNoZIoyE8Kl8MK69M+thuMtR7X X/8Expzzv9IvQHRHR5YYkhtUTHNIH8jIczgvOTbJU6EPo/B0wJPbQVFlPncU9b9XjTl2 RJIyeFKXx2JXWBZhMC/G4Xn8srVl+EJlBTA8e+y15FWVEDM3TyQAeRrDFydoeTo2IXjV Mr6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=nb3CidBChl134y1TBDXVYHO3HOjy8S8/AsRiehSmyXs=; b=CfH8BfHQOMsO3CoVIfpb8S0YgWI7txIZSpZ/ewmBJhCSsLOL6JqG5rSU9jCPFY1+nl dwLd2GZdN8fsQHTU7vur3YxBvYTeuUJcbNSZnECzedlyW9IRZaJt0AFqbptsf49P9wMU FYDzKxmD5dPqp1k6oduWsSdu2CO342HcJDUeoVBau2MDg2dr9/WkKhcHhPsqxgLWGjJM ioto++UVtah/Vm1Aa+x2pKKzc6CiaZqRISRiceeBFzNi/5wydZhtjk9ClsmTusf8fz5b 3UbXvUmNVZTFSjVTGS/mrhb3qlDkgq4/uDFqKITSaTgoU0K6QWLBng62tB+msmojy0MI rCDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YM0WJzgr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o84si3405979ywd.343.2019.03.07.11.35.01 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 07 Mar 2019 11:35:01 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YM0WJzgr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:58232 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1ynF-00084z-85 for patch@linaro.org; Thu, 07 Mar 2019 14:35:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1yC5-0001MO-Of for qemu-devel@nongnu.org; Thu, 07 Mar 2019 13:56:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1yC4-0002V8-VK for qemu-devel@nongnu.org; Thu, 07 Mar 2019 13:56:37 -0500 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:44143) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1yC4-0002UX-Nt for qemu-devel@nongnu.org; Thu, 07 Mar 2019 13:56:36 -0500 Received: by mail-pf1-x42d.google.com with SMTP id a3so12127032pff.11 for ; Thu, 07 Mar 2019 10:56:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=nb3CidBChl134y1TBDXVYHO3HOjy8S8/AsRiehSmyXs=; b=YM0WJzgrVmluEe37gjXMmk53xEqeC4szBEt+xRDyV7jqXQ5r++fvxU11hoJwc3fA37 nz9eDzw6NuhYSdSmYtLEQtf10MKjTwKsTP0kI1n16XgopAOIDNAIT6NTg9FuK2EvM/VY cw0egwDe/w7f76b6IyKnEOISENivjx4vYj+uoT9PpdCa2/qPp5PtxZEKmVx8qo2DNN9n ZVUhNs1X3LIFQm2H5UB2qJxeaRW5HYiLK6cCgR98TPiNCtFKFvagyqM/pG/9tYQtm8KV SRl6SWqrwLySZYNY8b3bHMIGfjPqS+fY/spiqdCXQg7r5Ey5Ew12EJ2qrN5gaNRVxde/ +H2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=nb3CidBChl134y1TBDXVYHO3HOjy8S8/AsRiehSmyXs=; b=UDvoT4KXIjaEkt1FkhyJA7jEvs9eyf+J+QTK1vPSVgi50UjjCvIowyo3iP/M0O4Rpo p+Sy+Ew6XIR+bDLEPZ/ZCuGivNfrnecElURTctfIyXjozxU5gmVWwE4gaK7eSG6qBEFX C3GUwQNasDQnOlZ3hW6mntrLfFwo5aApMe+govAvtPgCQHbTb98nUDB2iAuhUQcH/Ve5 xsHld/oe1tAPsmlqhk3rRzGE3P4XSCqnU7eDG+0nngeDNQhWnzy6cxobcNt8ly54XSOR pNOqCg+5LUibnm9b6tvi8mDM1Z9MRvbEFTOSityILNiFF0wb+0tXxaWhvKqF6LAzn/H9 WbXQ== X-Gm-Message-State: APjAAAUat+QI2hdwuSRyf20GFce82G2/jhCJYrwrqMzDHIyoBv030JYI AxFRz56wfRFeNs2JAsSG9/wcIGT/5rA= X-Received: by 2002:a17:902:27a8:: with SMTP id d37mr14304230plb.164.1551984995341; Thu, 07 Mar 2019 10:56:35 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id g12sm8801973pgr.76.2019.03.07.10.56.34 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Mar 2019 10:56:34 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 7 Mar 2019 10:56:19 -0800 Message-Id: <20190307185622.29026-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190307185622.29026-1-richard.henderson@linaro.org> References: <20190307185622.29026-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42d Subject: [Qemu-devel] [PATCH v3 09/12] decodetree: Produce clean output for an empty input file X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is interesting for bisection, where an output file is plumbed, but does not yet have patterns. Signed-off-by: Richard Henderson --- scripts/decodetree.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- 2.17.2 diff --git a/scripts/decodetree.py b/scripts/decodetree.py index d6f94d902f..57d4c9297e 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -1046,15 +1046,16 @@ def main(): '(DisasContext *ctx, ', insntype, ' insn)\n{\n') i4 = str_indent(4) - output(i4, 'union {\n') - for n in sorted(arguments.keys()): - f = arguments[n] - output(i4, i4, f.struct_name(), ' f_', f.name, ';\n') - output(i4, '} u;\n\n') - t.output_code(4, False, 0, 0) + if len(allpatterns) != 0: + output(i4, 'union {\n') + for n in sorted(arguments.keys()): + f = arguments[n] + output(i4, i4, f.struct_name(), ' f_', f.name, ';\n') + output(i4, '} u;\n\n') + t.output_code(4, False, 0, 0) + output(i4, 'return false;\n') - output('}\n') if output_file: