From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rock.gnat.com (rock.gnat.com [205.232.38.15]) by sourceware.org (Postfix) with ESMTP id 8D97738708B7 for ; Wed, 16 Dec 2020 13:15:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8D97738708B7 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=derodat@adacore.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 36ADD56201; Wed, 16 Dec 2020 08:15:37 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id g6jILU3xMTeW; Wed, 16 Dec 2020 08:15:37 -0500 (EST) Received: from tron.gnat.com (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) by rock.gnat.com (Postfix) with ESMTP id 3F02756204; Wed, 16 Dec 2020 08:15:35 -0500 (EST) Received: by tron.gnat.com (Postfix, from userid 4862) id 3E168A6; Wed, 16 Dec 2020 08:15:35 -0500 (EST) Date: Wed, 16 Dec 2020 08:15:35 -0500 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [Ada] Simplify membership tests with N_Delay_Statement subtype Message-ID: <20201216131535.GA69945@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="DocE+STaALJfprDB" Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2020 13:15:40 -0000 --DocE+STaALJfprDB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Simplify membership test on N_Delay_Relative_Statement and N_Delay_Until_Statement using the collective N_Delay_Statement subtype. Cleanup only; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch9.adb, sem_warn.adb: Simplify membership test. --DocE+STaALJfprDB Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch.diff" diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -7161,8 +7161,7 @@ package body Exp_Ch9 is if Ada_Version >= Ada_2005 and then (No (Original_Node (Ecall)) - or else Nkind (Original_Node (Ecall)) not in - N_Delay_Relative_Statement | N_Delay_Until_Statement) + or else Nkind (Original_Node (Ecall)) not in N_Delay_Statement) then Extract_Dispatching_Call (Ecall, Call_Ent, Obj, Actuals, Formals); diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb --- a/gcc/ada/sem_warn.adb +++ b/gcc/ada/sem_warn.adb @@ -750,9 +750,7 @@ package body Sem_Warn is Fstm : constant Node_Id := Original_Node (First (Statements (Loop_Statement))); begin - if Nkind (Fstm) = N_Delay_Relative_Statement - or else Nkind (Fstm) = N_Delay_Until_Statement - then + if Nkind (Fstm) in N_Delay_Statement then return; end if; end; --DocE+STaALJfprDB--