From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id 2E2723856DC8 for ; Mon, 5 Sep 2022 07:25:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2E2723856DC8 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wm1-x32b.google.com with SMTP id j26so4791244wms.0 for ; Mon, 05 Sep 2022 00:25:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date; bh=8q4EcVTCZ3E/Py7hUP2Y8w42+iI9YCEZjMugxNc7XRE=; b=PoYrrTBq9AiGLEsGEOj0+sAyF0xkVQ0bkBeYlrt2cYnP5oBen2CyM8/J6TX8XWQzRd /gnAf95T9tFNwzf8rUqDe98h8qMSJiqJMtNncKMOBuhWnbffeWDEvYm9oEGOGI9M+Lkd lm8Psg5gARiXCyAygon2I83pQNVVTMEpf72SQb0XUjxXA1U9iErQKq8y9xqNs5qWpu+o IrHek8aqiM1L18XJZIJSs8qsRP8hCc/gEk5fAbjXmmMM+9GFFnEFMpSqTC1zYxVbPhKE Yo3B8HpepPN03u9sXbkfGrH9FXoc0kTE6YZ4wBcYEKL0t8T2p+hEFmieOy6WEOt5HzD4 wW7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date; bh=8q4EcVTCZ3E/Py7hUP2Y8w42+iI9YCEZjMugxNc7XRE=; b=HREm/NoA6pXae2IV3S8oQ7/qVTuwqFOQIcr4rQWJr9gQdTooHF06V8qBv1jogWyxy2 VUagpID351d2WzxDXv7VewkeMTBzhBKpByDMLCnVVr1liSwQgnWagZnnIAM26EC7cMSV 4SuY99i5KSfll8NImA1esuCqD6BstGRautMv8f7mT/sPNVuf/x6si5VaaWD/CwyK2o8b 3BO5sD2KeIND4FU0gx98NCF1YTcf073WfgMenuq1O802X36E6wmiclczS6Ua1NyzEfoQ XdrZLkb1y3tLlvwEIab9sAVfM8G7NhHKdzItAbPZEz1Nt5ukCVwoWhgPfjQSQACOSB3P lDWA== X-Gm-Message-State: ACgBeo3Z+SxKQs3g1W0z4hQP8OesJd3uy7Y4SUZcmK4fBLkQQijxFSe8 QtlYYHRimwmsMZM9D2nmQKKDq9knYwoOcA== X-Google-Smtp-Source: AA6agR5redDneHctv1M1c7NPb/WddBWCjZxrCLTpt+1QzyEnyxV1Yrnc1R7hDMAjPWitlTFrBjCNlQ== X-Received: by 2002:a05:600c:4fcd:b0:3a6:2694:e3ba with SMTP id o13-20020a05600c4fcd00b003a62694e3bamr10279801wmq.160.1662362758832; Mon, 05 Sep 2022 00:25:58 -0700 (PDT) Received: from poulhies-Precision-5550 (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id m5-20020adff385000000b00228c792aaaasm210671wro.100.2022.09.05.00.25.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 00:25:58 -0700 (PDT) Date: Mon, 5 Sep 2022 09:25:57 +0200 From: Marc =?iso-8859-1?Q?Poulhi=E8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [Ada] Cleanup resolution of iterated component association Message-ID: <20220905072557.GA1174593@poulhies-Precision-5550> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="+HP7ph2BbKc20aGI" Content-Disposition: inline X-Spam-Status: No, score=-12.2 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 List-Id: --+HP7ph2BbKc20aGI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Tune names of local entities. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_aggr.adb (Resolve_Iterated_Component_Association): Change generic name Ent to a more intuitive Scop; rename Remove_Ref to Remove_Reference, so it can be instantiated as a traversal routine with plural name. --+HP7ph2BbKc20aGI Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch.diff" diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -1748,11 +1748,11 @@ package body Sem_Aggr is -- Remove_References -- ----------------------- - function Remove_Ref (N : Node_Id) return Traverse_Result; - -- Remove references to the entity Id after analysis, so it can be + function Remove_Reference (N : Node_Id) return Traverse_Result; + -- Remove reference to the entity Id after analysis, so it can be -- properly reanalyzed after construct is expanded into a loop. - function Remove_Ref (N : Node_Id) return Traverse_Result is + function Remove_Reference (N : Node_Id) return Traverse_Result is begin if Nkind (N) = N_Identifier and then Present (Entity (N)) @@ -1763,15 +1763,15 @@ package body Sem_Aggr is end if; Set_Analyzed (N, False); return OK; - end Remove_Ref; + end Remove_Reference; - procedure Remove_References is new Traverse_Proc (Remove_Ref); + procedure Remove_References is new Traverse_Proc (Remove_Reference); -- Local variables Choice : Node_Id; Dummy : Boolean; - Ent : Entity_Id; + Scop : Entity_Id; Expr : Node_Id; -- Start of processing for Resolve_Iterated_Component_Association @@ -1841,10 +1841,10 @@ package body Sem_Aggr is -- visible in the expression for the component, and needed for its -- analysis. - Ent := New_Internal_Entity (E_Loop, Current_Scope, Loc, 'L'); - Set_Etype (Ent, Standard_Void_Type); - Set_Parent (Ent, Parent (N)); - Push_Scope (Ent); + Scop := New_Internal_Entity (E_Loop, Current_Scope, Loc, 'L'); + Set_Etype (Scop, Standard_Void_Type); + Set_Parent (Scop, Parent (N)); + Push_Scope (Scop); -- Insert and decorate the index variable in the current scope. -- The expression has to be analyzed once the index variable is @@ -1853,7 +1853,7 @@ package body Sem_Aggr is Enter_Name (Id); Set_Etype (Id, Id_Typ); Mutate_Ekind (Id, E_Variable); - Set_Scope (Id, Ent); + Set_Scope (Id, Scop); -- Analyze expression without expansion, to verify legality. -- When generating code, we then remove references to the index --+HP7ph2BbKc20aGI--