From patchwork Thu Feb 28 05:40:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 159317 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp240029jad; Wed, 27 Feb 2019 21:41:28 -0800 (PST) X-Google-Smtp-Source: AHgI3IY5//is2YmvFhmXdKorDMrQhrHdeG7rrfmRivfvpPlJEXtaZQ9b9SQHrYZuOHsNXGjKD2EL X-Received: by 2002:a81:6604:: with SMTP id a4mr4310442ywc.510.1551332488640; Wed, 27 Feb 2019 21:41:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551332488; cv=none; d=google.com; s=arc-20160816; b=ooC0AwIQ/9TOs4/RkF2Rx7PPh35AUkSWBBSIR6a7yIaLz/mjqnHl172ZtY61QsHZa4 kD3uTyiQZinTQXXOPxmrg+rGyhCGiM3ZIrevlXbKOL4lJfqnkoJ6T7m0yAEToc0ZzDKU lk8ZFFhflHYY9CQMCcw5mAtL9zNv/YqOHAk5YWDmzETBwLpdUo+fxt+TxSlW9YhyYEbO UEQoas2+3CtAJMYWFkSDf1e0pd3dMIkXKOxAd/SSw8GdqcGqJ8e+Nb0hAacit81/ZZE0 csXWafuKLCSqa6DkBDbj5acEteIKvqOa6J7/dQB3rlA3lx1g2CBVuBTXVI1bwzosMtT4 yS/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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=MdXTm4UWGBbEsgbr9yj2lFEwhlkWHo6z5Hh6lERaMMo=; b=F2EkfZuvosvR+t8w2hj58herX8Bfe81sVG7rRn+Tny8VHrADc9eMC7FyOPRLcs4UOQ kknDhaD4DamYouOMDy30jfKamLT6NpSr0sOodEDrdt97bh/0VU9GUBJSJ8n7Kc3d0yCT cUy+SPD1MzmHRCAH2pErclV/NGJy/k9LffGAyYBvagdshC1LhwioTm6ICrfxLBqpVMRe WezjnCbq+FAt28KD3hD4Cv9c6S3wgrgDAcC28PUqw4KZSNztU8uONqGzxIrGW1G+Ey5L npzjTL1y/SNMF17XWbBQ+XjpVwLoDEy0wKRNgZhwPfCNSFRh7r6KONWu4jxQ+9aLXIoB 9EEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=pkeHvQvN; 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 i12si9629580ybp.85.2019.02.27.21.41.28 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 27 Feb 2019 21:41:28 -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=pkeHvQvN; 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]:60767 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzERk-0004Tx-8G for patch@linaro.org; Thu, 28 Feb 2019 00:41:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34060) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzEQY-00046y-4R for qemu-devel@nongnu.org; Thu, 28 Feb 2019 00:40:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzEQX-0003rq-EY for qemu-devel@nongnu.org; Thu, 28 Feb 2019 00:40:14 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:43192) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gzEQX-0003oT-63 for qemu-devel@nongnu.org; Thu, 28 Feb 2019 00:40:13 -0500 Received: by mail-pl1-x62a.google.com with SMTP id m10so9157948plt.10 for ; Wed, 27 Feb 2019 21:40:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MdXTm4UWGBbEsgbr9yj2lFEwhlkWHo6z5Hh6lERaMMo=; b=pkeHvQvNC9SdlVpVSj8poG35FSI55qNsLTj+MGBUltx+9l2WVgk3CwMTQMSd9ZCade x0DvVuAz6PE2WZRELl3H8sDdgGqB4y4bP5oKV2kX61voY4vv29X7Opx1pja+e964GbS7 0FrYetdElJy0WSLUWSR0giNi6tsT1HY2nlLIokgDzCkR+KhQJdJQUY0jA5vOoxal8Rx+ ocg1m0qjejkh/afRlRKKOMo7pbBXz/y3FA12Euy9h1pqRNN6cUwDL9Cf+RIoL8ShnyoC uHn6DOe3cz/K9TFwOsuxkOSfTJsCmxuBmheH2WpFdr1l7HDztVUg4JXvJJX3X9KrZu6T DGmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MdXTm4UWGBbEsgbr9yj2lFEwhlkWHo6z5Hh6lERaMMo=; b=udm6EA3ENRJA3xKa1nckCAwT/2IHBj16UFqR75x8JgIJXabzSntf9ySycnnIZwrpo1 DZLygh1uoLhYVFLbfjeYGCYXPnjAa/EYyqsbUVb0WCU6MfOJ8GL2tSU+YGiO8cp2AJNh cJYDJOZ0uQlWuSAsF5YL2M7OZBKC0isiz8BePD/6PO3dn2cF7ONFIW/qp8EmwJMEYpd3 0FIkHIryLY1FWHGFs9ePlfBxpQUEILo7LxPeTdCFMfLNtCSw9ANwrMqEZdxY72oNuKuX D4NewEmYmgyhvkYPMuw6F7cy4u6br1SYt2t1ux+sv6TqDTseuUP9lSMNoroAMv/4DYSQ h6xQ== X-Gm-Message-State: AHQUAuZmvshRHtyLqlze4rZwuIGQNHcsGF36gG6SKY960WLs2F9phD3Z ns5An0I/2pLQFKxiJl2eRjoeT0jxGu4= X-Received: by 2002:a17:902:7202:: with SMTP id ba2mr6037258plb.147.1551332409929; Wed, 27 Feb 2019 21:40:09 -0800 (PST) Received: from cloudburst.dc.rr.com ([2605:e000:100e:478c:cfa2:eb27:db4f:e85]) by smtp.gmail.com with ESMTPSA id k27sm13833477pgb.70.2019.02.27.21.40.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Feb 2019 21:40:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 27 Feb 2019 21:40:07 -0800 Message-Id: <20190228054007.779-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190228052432.32571-1-richard.henderson@linaro.org> References: <20190228052432.32571-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::62a Subject: [Qemu-devel] [PATCH 9/8] 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: , Cc: f4bug@amsat.org 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 --- One more small fix that should have gone with the v2 patchset. --- 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 68979b73a0..1785769eec 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -1050,15 +1050,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: