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: 1053234 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="YM0WJzgr"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44Fgm64c7Sz9sBp for ; Fri, 8 Mar 2019 06:33:42 +1100 (AEDT) Received: from localhost ([127.0.0.1]:58226 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1yls-0007Qt-26 for incoming@patchwork.ozlabs.org; Thu, 07 Mar 2019 14:33:36 -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-Google-Smtp-Source: APXvYqyPKcBN1SyM+w7gMRFy1v1VufdU8R40/Oj5lk79i7UDKRypNTtEOIS1CW+0qvQ3KvTWWTdSAQ== 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+incoming=patchwork.ozlabs.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(-) 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: