From patchwork Tue Mar 12 17:03:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 160166 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp13391377jad; Tue, 12 Mar 2019 10:55:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNpff3yU0aYNB3boOQDMo3MiZWS2JC9HH/p/1r8olfyX8WY9UQIf4geCy+wGRrNyicGjFZ X-Received: by 2002:a81:6f8a:: with SMTP id k132mr30892760ywc.469.1552413359530; Tue, 12 Mar 2019 10:55:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552413359; cv=none; d=google.com; s=arc-20160816; b=QOgxIgE9GkclzvThJ1BsTRir94TVhY8w4r6Lc/qNFKvx9e8E4LTqOWtSeMb9uCt4To cRFYoXCi1Kq2az80TmnrXMPXBrOVjhLlqPqf1f48Z/PM9JPbX5Sh2woh8ZZX1uPfJ60d Pu0CeYc43YgmCIJeZSWFcMD+uwtnC1l10wVaacaEWdKTWWWuqUSjcno+EVhTAZovDk5d jpLmsFjIltR0OeUTZa9khfjjUaAuYRxCOg64EItLePUlLiFRAKJ9McVOg1g+2g/xmLMB 2PQvbP6oHgAA9uryQBp0H66pPBKJ28gU7by5d4e6jPpLenjeArrhZLJUcn7wi1TmNJ1o D3bg== 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=oPNQCKMG+eFcSWSqQcxVkSY17qb8SVF1eeKGaPzpR/U=; b=LGFNqm/VMZOMRm8qVsPntXbOKv7g48LDfnT7OKMj14ow3XAcgjq3u7QNwcFit1adz4 kU5opav+Ccg/FQuOe+6XErum8Xyt8FzqMcrqEBJvvimu9PzjxULHwES7cfWi/0rwr1Ht 4eiqcnfZkztKEuskCZvVCgGctpAyC6KjRpTavX3u5dzdyq3tQDskrZ14nevwTEqYVuJM 73P3eUrxDa/RTk08xZLRCNBLin6mySC6LyoIFY22HpS/Zg6BoIkb2weJQAASMDm/UWg9 WDm+iAjy9z6hvDKjr+4lDQbths+cDmuQlP0G1h19/0ivdX77o0ildCBIeeR9THsMsPqc rlQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nsZLFTRD; 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 r126si5515454ybr.448.2019.03.12.10.55.59 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 12 Mar 2019 10:55:59 -0700 (PDT) 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=nsZLFTRD; 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]:56781 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3ld8-00041I-UU for patch@linaro.org; Tue, 12 Mar 2019 13:55:59 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3l3K-0006LV-Lo for qemu-devel@nongnu.org; Tue, 12 Mar 2019 13:19:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3koy-0001S1-Nq for qemu-devel@nongnu.org; Tue, 12 Mar 2019 13:04:09 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:46304) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3kow-0001FK-Ma for qemu-devel@nongnu.org; Tue, 12 Mar 2019 13:04:08 -0400 Received: by mail-pf1-x431.google.com with SMTP id s23so2238520pfe.13 for ; Tue, 12 Mar 2019 10:03:50 -0700 (PDT) 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=oPNQCKMG+eFcSWSqQcxVkSY17qb8SVF1eeKGaPzpR/U=; b=nsZLFTRDGrnfnZfZYu0KdUmP9/etuvvm6PwTYDdtlWaZ9oVEBeu6oM0Vl4eFZb/E7a FSulfKmOgcmTwz9hovaahyAbEVhE5jOIQYlmiuDHVRgovltJmvWe9GNPpeGlJONa83M2 JqxArSUdSLBbM9gDf0S1j8Vl869+x4xkGTEop3J7w4jkA3/ZRDrlrghese6uSqPcnTDj Ov3phFGSHiRIOvSaV+gslAZJdMlB6eFCRyO3hJsVveml2Wz28heJr5VDPXas6YLZ+aBF WUo57C3fvYETx1/i3R7CIZyHYxcdiSpOCexFwyKkwNF8R9U8oPaR4ZfFus2WYzletiRF M+bg== 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=oPNQCKMG+eFcSWSqQcxVkSY17qb8SVF1eeKGaPzpR/U=; b=FoaquuMG8daWjgfhnCRZN0CQtj/tOU6EYnw1n7qWUPma9cQT0CKoevvbhwUq34P4/l BjGi5Q9dYdFVnNxIhvlCV4TT9kHF7MTUnSqGYH7YqUwprgtXpfWFesaw5qcvdXdseHG2 +UZoprs9p4cD/RxZcMvc+zvZP1oZ5hOwptLm5S9Yrv6I6ASQXq6jHO/c87I5lRKBHBwD hUOd1JOYSh4Oaizbb0ZYb4+rPxTTtttQEBz9h7dvrHgT/w06+WlHVQwxC7TqYRQUQCWK rGg+i/Rh1q3RGmiaoqjij+p9a+dxNuX1mYNdL1cNzs56YJzrY8KaOf3Y5dEzuR2ZgVHN PB1w== X-Gm-Message-State: APjAAAVrofcwPnx/Bki2ZJITcnyGN9mOe7+78eEu46OeI4tTYcM/wYfz vKNmMqlJ2yr9xpMYF5MyYJRLt539H2U= X-Received: by 2002:a17:902:2ac8:: with SMTP id j66mr41674808plb.335.1552410228893; Tue, 12 Mar 2019 10:03:48 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id v22sm17514265pfa.49.2019.03.12.10.03.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Mar 2019 10:03:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 12 Mar 2019 10:03:31 -0700 Message-Id: <20190312170334.14005-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190312170334.14005-1-richard.henderson@linaro.org> References: <20190312170334.14005-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::431 Subject: [Qemu-devel] [PULL 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: , Cc: peter.maydell@linaro.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 --- 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 6067e940ab..6e7ba278be 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -1049,15 +1049,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: