From patchwork Thu May 25 08:05:33 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: 98853 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp198473vqr; Thu, 25 May 2023 01:16:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6q0O7QhCBCdpzj/PlX+54HeMwgoWNdAsaQNLN+fVAB39+UsoHl8vC0GicLn5NpJNeXjXQF X-Received: by 2002:a17:907:d8d:b0:965:6d21:48bc with SMTP id go13-20020a1709070d8d00b009656d2148bcmr671129ejc.75.1685002579383; Thu, 25 May 2023 01:16:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685002579; cv=none; d=google.com; s=arc-20160816; b=voTenYAlgC0A3wsVf/ookPT/wJIeGt/s1EDneWacm52c31ussXoRZTjXPwnfJ/mFfV lHI2wAZxmxCxQNziPR+2OoqiZ6gArEStqgOLGxnu/7/Vh1ynIFBlzKTiq35uMsSw6gu2 OuJyr6XHmMjxh8AP3/ypWyGdHRVKhHnD36Ocka6YIiWc02k05ih0J/tglbuytyWBceSj H/ICwvDUda0Pv3Mv+KQelh9BVNo1+1hsuEjtFPYHHO2lpSCSj+2Xqn2p4MIlds2dpJ0g hsXQyJuPLqYfRnsZ9j5QIQBvB8h1b0r4UwMx8RuRXgJaqcCq4mJRrvOZG6tGepaxXRJn mJJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=B5vP5i3CUgTmZbLryvrHZMkIJvBIFVzXQwFq5AXY6+o=; b=bpbjOGzwwuFy5ijyyhrhOdbVqe0cQs4Du/XkWHQBv3K9dtOvYIJPMGHn+oLbQrG7O7 ucibfntKLPUIpjPPCpKUBASvBtUE+4PsY9yHgvt012hI5RMY6znm1pPcKcJXO7CVjS97 qGZRGpPJrfnzEY4fWeMPzPgpeGrDrWmU3xaXazhni3csSTWgbZI9JTk7LdV4gwEx/G6v j2LHvVWm0O1uauiwi/pJM9AOCDFJYp2PhwE5tBOqKwg73w87MM2P2EHdO3vT5OFiQko+ FiCme+/pL3BSOU3RGxTKcWezBFj1VSxHig/G+s4PKlZUuAygRkad0SCSJPpfJ4BqO9kW i99g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=RYG9+CRB; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id h5-20020a17090634c500b0096edc39044bsi751609ejb.1037.2023.05.25.01.16.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 01:16:19 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=RYG9+CRB; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E27DE3857029 for ; Thu, 25 May 2023 08:10:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E27DE3857029 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685002259; bh=B5vP5i3CUgTmZbLryvrHZMkIJvBIFVzXQwFq5AXY6+o=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=RYG9+CRBRyWVFrybmdQ8iWGw3n+k68Z2EU3OT0lsr9MJpAkZlMMOSCKVVjrmOIWX6 XArxvhZ1zhhvQWSk9MTAwgP4DRxIs32LbrjyTKvD9UxZfmAcGTNXbNSlUWuKh5D0Ma yrpz8q6Cc4bLKUM/GZbeIptUtn6hY9lKgBacI1pU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id 2F002385772A for ; Thu, 25 May 2023 08:05:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2F002385772A Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3f6da07feb2so1684235e9.0 for ; Thu, 25 May 2023 01:05:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685001935; x=1687593935; 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=B5vP5i3CUgTmZbLryvrHZMkIJvBIFVzXQwFq5AXY6+o=; b=ACy9DqABQmMtX0BeK6wHv+2gZEtRKgZKGITqhexE5pNM1BMNUeDbb7wjw2k1k5GKb9 FCJI5mn8tAEENu4TIYiwSE3y9VYxdHlJEocCVrqzeRFYo7T37EF88EVdNU6JRehQzN3p iS6lJiHHF4y0VJKm88CF2B4svy6pgQelFnVczQN2UPVgxVvUjppCcvB4vK5MhagWBG1K vj8+6vAH07wX4vl7nhRtlEzAUbWdXEvJCLOyBEVRXDZvb2lRoIscADKIWDrf78QY64SS Jqq+PX6grIJ43oFFP0s1rVZmVKmNONIuFZhpGL/ytJf6H/3v8p+x12MFFXBBNi4RQzdl qitg== X-Gm-Message-State: AC+VfDwhCJLTjbXQW6BXT8X8908j1DGq472AscRyF9gVX0Q2Vamj612J xf+C0gZM+a9WLb7UrlYCjJgmNjOtAWTUYfFJh5gPuQ== X-Received: by 2002:a7b:c84c:0:b0:3f6:76e:604b with SMTP id c12-20020a7bc84c000000b003f6076e604bmr1764528wml.0.1685001935082; Thu, 25 May 2023 01:05:35 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id w8-20020a1cf608000000b003f18b942338sm1227392wmc.3.2023.05.25.01.05.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 01:05:34 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Bob Duff Subject: [COMMITTED] ada: Set Is_Not_Self_Hidden flag in more cases Date: Thu, 25 May 2023 10:05:33 +0200 Message-Id: <20230525080533.1955979-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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766853264575518554?= X-GMAIL-MSGID: =?utf-8?q?1766853264575518554?= From: Bob Duff More work-in-progress for changing E_Void checks to the flag. gcc/ada/ * sem_ch9.adb (Analyze_Protected_Type_Declaration): Set the flag for protected types. (Analyze_Single_Protected_Declaration): Likewise, for singleton protected objects. (Analyze_Task_Type_Declaration): Set the flag for task types. (Analyze_Single_Task_Declaration): Likewise, for singleton task objects. * sem_ch10.adb (Decorate_Type): Set the flag for types treated as incomplete. (Build_Shadow_Entity): Set the flag for shadow entities. (Decorate_State): Set the flag for an abstract state. (Build_Limited_Views): Set the flag for limited view of package. * sem_attr.adb (Check_Not_Incomplete_Type): Disable the check when this is a current instance. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_attr.adb | 2 +- gcc/ada/sem_ch10.adb | 8 ++++++-- gcc/ada/sem_ch9.adb | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 0cfc2da29dd..efea03670c3 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -2517,7 +2517,7 @@ package body Sem_Attr is or else In_Spec_Expression then return; - else + elsif not Is_Current_Instance (P) then Check_Fully_Declared (P_Type, P); end if; end Check_Not_Incomplete_Type; diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb index c9bbd773424..a6cbe466b75 100644 --- a/gcc/ada/sem_ch10.adb +++ b/gcc/ada/sem_ch10.adb @@ -3306,6 +3306,7 @@ package body Sem_Ch10 is -- incomplete type, and carries the corresponding attributes. Mutate_Ekind (Ent, E_Incomplete_Type); + Set_Is_Not_Self_Hidden (Ent); Set_Etype (Ent, Ent); Set_Full_View (Ent, Empty); Set_Is_First_Subtype (Ent); @@ -5989,7 +5990,8 @@ package body Sem_Ch10 is Mutate_Ekind (Shadow, Ekind (Ent)); end if; - Set_Is_Internal (Shadow); + Set_Is_Not_Self_Hidden (Shadow); + Set_Is_Internal (Shadow); Set_From_Limited_With (Shadow); -- Add the new shadow entity to the limited view of the package @@ -6056,6 +6058,7 @@ package body Sem_Ch10 is procedure Decorate_State (Ent : Entity_Id; Scop : Entity_Id) is begin Mutate_Ekind (Ent, E_Abstract_State); + Set_Is_Not_Self_Hidden (Ent); Set_Etype (Ent, Standard_Void_Type); Set_Scope (Ent, Scop); Set_Encapsulating_State (Ent, Empty); @@ -6416,11 +6419,12 @@ package body Sem_Ch10 is raise Program_Error; end case; - -- The withed unit may not be analyzed, but the with calause itself + -- The withed unit may not be analyzed, but the with clause itself -- must be minimally decorated. This ensures that the checks on unused -- with clauses also process limieted withs. Mutate_Ekind (Pack, E_Package); + Set_Is_Not_Self_Hidden (Pack); Set_Etype (Pack, Standard_Void_Type); if Is_Entity_Name (Nam) then diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb index 90b0ff08540..a15e37b7ce7 100644 --- a/gcc/ada/sem_ch9.adb +++ b/gcc/ada/sem_ch9.adb @@ -2067,6 +2067,7 @@ package body Sem_Ch9 is end if; Mutate_Ekind (T, E_Protected_Type); + Set_Is_Not_Self_Hidden (T); Set_Is_First_Subtype (T); Reinit_Size_Align (T); Set_Etype (T, T); @@ -2901,6 +2902,7 @@ package body Sem_Ch9 is Enter_Name (Obj_Id); Mutate_Ekind (Obj_Id, E_Variable); + Set_Is_Not_Self_Hidden (Obj_Id); Set_Etype (Obj_Id, Typ); Set_SPARK_Pragma (Obj_Id, SPARK_Mode_Pragma); Set_SPARK_Pragma_Inherited (Obj_Id); @@ -2987,6 +2989,7 @@ package body Sem_Ch9 is Enter_Name (Obj_Id); Mutate_Ekind (Obj_Id, E_Variable); + Set_Is_Not_Self_Hidden (Obj_Id); Set_Etype (Obj_Id, Typ); Set_SPARK_Pragma (Obj_Id, SPARK_Mode_Pragma); Set_SPARK_Pragma_Inherited (Obj_Id); @@ -3265,6 +3268,7 @@ package body Sem_Ch9 is end if; Mutate_Ekind (T, E_Task_Type); + Set_Is_Not_Self_Hidden (T); Set_Is_First_Subtype (T, True); Set_Has_Task (T, True); Reinit_Size_Align (T);