From patchwork Fri May 26 07:36:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 70148 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6C2F8383BED5 for ; Fri, 26 May 2023 07:46:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6C2F8383BED5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685087181; bh=1il946Jt0w6vt50VGDbCvkOhAWxvro3A09XdcICKo6I=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=sRswdPBEzsmwkb0uu28b4pYDt+3GGVxjXame84nvEnuSgV1y7IAKqvG9Z5M3m1Xtu VM/K+nglRm9YOvoC/WeGtBnLwNlz0rsudZj5nc7EOJJ2mSGgJ1Qf3JDWoAmtGFlxij kMhK5nKezhhQAKM5gWY452Kx5rLYdQBxd7u1F488= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id F19AC3846449 for ; Fri, 26 May 2023 07:36:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F19AC3846449 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-309553c5417so333284f8f.2 for ; Fri, 26 May 2023 00:36:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685086593; x=1687678593; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1il946Jt0w6vt50VGDbCvkOhAWxvro3A09XdcICKo6I=; b=PfvwR9i7xXMNxW+9uBg0UYDJUz7t1QlHXi5lCqmGarpOfX59Sm0rXRZvIpDJcvsBcB oUURW9MPrHIjg7k5OrSG9LUKwLdGDS2jowX7Ry/er4FvBmtMyE3lLgifJyQfPJOVBfbH UMgdFG5TAADVitPZEuLaRV86WWioILmSuB03lDBXl+Pe84kPyoIZBq/s0tY3Nt6Yengj 72pNiPRlelBXAzCjZIek7K5cIS3qss2oIbobXXZ/PzTrdfjZEwHQ9xnw2izyn3hxZbPQ vjIsiDdWXiTEHPvjWGY+N29nCtJxThwF1hNOWmoUk4lThyGjwSytfK5TSLpL99r1xCTG 7Kww== X-Gm-Message-State: AC+VfDx5qtGduE6ZYr2bpZT+8ZP80l0iOe63ymlz/EcvMV+uysHoN+Rc f1eYdExw/80DIPJZ3FEL3G2l6kqW7sZj2JB1Xvc1hA== X-Google-Smtp-Source: ACHHUZ7Ey6VgPACtQXNbJmjEnwKtymcF40w7Owlm/t3iIimpAUWDhJfOUD0swdG8PajaP2QTkqJuLQ== X-Received: by 2002:a05:6000:11c4:b0:306:2e04:5925 with SMTP id i4-20020a05600011c400b003062e045925mr620439wrx.17.1685086592846; Fri, 26 May 2023 00:36:32 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:777b:eef4:6f79:f26f]) by smtp.gmail.com with ESMTPSA id g14-20020a5d540e000000b00307a86a4bcesm4188843wrv.35.2023.05.26.00.36.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 00:36:32 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED] ada: Remove leftover code for counting protected entries Date: Fri, 26 May 2023 09:36:31 +0200 Message-Id: <20230526073631.2069250-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" From: Piotr Trojanek We used to count protected entries by iterating over component declarations, but then switched to iterating over entities and left some code that is no longer needed. Cleanup; semantics is unaffected (maybe except fixing an assertion failure in developer builds when there is pragma among entry family declarations). gcc/ada/ * exp_ch9.adb (Build_Entry_Count_Expression): Remove loop over component declaration; consequently remove a parameter that is no longer used; adapt callers. (Make_Task_Create_Call): Refine type of a local variable. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch9.adb | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index 68f1290cab4..b0e3632b8c8 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -154,8 +154,7 @@ package body Exp_Ch9 is -- N is the enclosing construct. function Build_Entry_Count_Expression - (Concurrent_Type : Node_Id; - Component_List : List_Id; + (Concurrent_Type : Entity_Id; Loc : Source_Ptr) return Node_Id; -- Compute number of entries for concurrent object. This is a count of -- simple entries, followed by an expression that computes the length @@ -1428,14 +1427,12 @@ package body Exp_Ch9 is ---------------------------------- function Build_Entry_Count_Expression - (Concurrent_Type : Node_Id; - Component_List : List_Id; + (Concurrent_Type : Entity_Id; Loc : Source_Ptr) return Node_Id is Eindx : Nat; Ent : Entity_Id; Ecount : Node_Id; - Comp : Node_Id; Lo : Node_Id; Hi : Node_Id; Typ : Entity_Id; @@ -1459,13 +1456,8 @@ package body Exp_Ch9 is -- Loop through entry families building the addition nodes Ent := First_Entity (Concurrent_Type); - Comp := First (Component_List); while Present (Ent) loop if Ekind (Ent) = E_Entry_Family then - while Chars (Ent) /= Chars (Defining_Identifier (Comp)) loop - Next (Comp); - end loop; - Typ := Entry_Index_Type (Ent); Hi := Type_High_Bound (Typ); Lo := Type_Low_Bound (Typ); @@ -9248,7 +9240,7 @@ package body Exp_Ch9 is declare Entry_Count_Expr : constant Node_Id := Build_Entry_Count_Expression - (Prot_Typ, Cdecls, Loc); + (Prot_Typ, Loc); Num_Attach_Handler : Nat := 0; Protection_Subtype : Node_Id; Ritem : Node_Id; @@ -14232,7 +14224,7 @@ package body Exp_Ch9 is Tdec : Node_Id; Tdef : Node_Id; Tnam : Name_Id; - Ttyp : Node_Id; + Ttyp : Entity_Id; begin Ttyp := Corresponding_Concurrent_Type (Task_Rec); @@ -14453,14 +14445,7 @@ package body Exp_Ch9 is -- where a,b... are the entry family names for the task definition - Ecount := - Build_Entry_Count_Expression - (Ttyp, - Component_Items - (Component_List - (Type_Definition - (Parent (Corresponding_Record_Type (Ttyp))))), - Loc); + Ecount := Build_Entry_Count_Expression (Ttyp, Loc); Append_To (Args, Ecount); -- Master parameter. This is a reference to the _Master parameter of