From patchwork Fri Nov 4 13:58:15 2022 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: 15546 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp421153wru; Fri, 4 Nov 2022 07:03:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4ZXuQx14XHyTsURw6deYkfh9T4gp57/x5XC1tWeIylAYNG0UQsup3466+DSPThNWk49YZb X-Received: by 2002:a05:6402:3645:b0:45f:e918:9f35 with SMTP id em5-20020a056402364500b0045fe9189f35mr34820752edb.118.1667570600981; Fri, 04 Nov 2022 07:03:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667570600; cv=none; d=google.com; s=arc-20160816; b=hhN41/SfQeWeutI68Rn5zYa2ulsKVxaidUJQF7L3WQdYY79FLa2l5z0otForAIERdU zdycVV5aaqonvbP14622ghpEJSB2NAfK4wBGodTo8q4y2Loq2fkDT+zWqUIjy7/pbG7n GEeXqYfZl2Ctzcpxd/nAA5hIpjL5wYkpBXJFqqgvJ/L2LZvp8JXAUrkxx54WZIfqh6HP hdhuq7nTzuyws1U5Qqhm+Foov1RzFoTyn0cjtXFqLkERLherQ+EByaypUqVxqm6+/cIH y0J4ulTT1vAPBN30TfNMDYQp9DDNZbmih1SJqrFa8JKhYpp4f177tpp2s4KyQ599Wr0t m4lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=mhK4olquGCNDNDrBRzz+G5WWrEFs7DKqFAEfSDy1XIo=; b=j/FdJYpiOkSl169kGrQQZ4u5J7zoMD7CUeKjDpSweXyWODlep4GvPi/q7hmdunwUME NcJ/MrFu8Ywyv1zimcPdm3R55s4fDsiHpfEax8iDTPWUr5tIaRLvlnPoBMrhHRzzqQ1X wsW/Zbiewa4FmVjcbOJnhKThitX1OzyOS3IJWX1/rLuwxMxR3gTRyDKD3taF9BTthMbC qcHK2OAFzSwpyU24R708XiNdFpe6X4G/fKatauWWvUlunAEVrbtxcyWrW4ppMB7TWphF Re0uosVOMasWL+TY0YlZ9hPQaAPGYGVXtCs8jEFfSWQpxkgBA2mZPhvgrH6NRsSBmKg4 5hrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=rEizubLe; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id o3-20020a170906288300b007413b206b16si3467271ejd.843.2022.11.04.07.03.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 07:03:20 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=rEizubLe; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 9ADE138845A9 for ; Fri, 4 Nov 2022 13:59:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9ADE138845A9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667570379; bh=mhK4olquGCNDNDrBRzz+G5WWrEFs7DKqFAEfSDy1XIo=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=rEizubLey0rOLrlzomhRvsibOpPXk0nQt3D36iUei/qtSN388WaMZuXcpquTiMZCE afCfMeB4aBRMSQ7rCTjqRZ+VIWVJ6014LLn4+u516s/QJsEDYN1ss3dROozhBsna3M ZSHegHpSKwKEz0E5l2KoxNbFJS/xrnb49YGILDw4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 16E06385829A for ; Fri, 4 Nov 2022 13:58:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 16E06385829A Received: by mail-wr1-x433.google.com with SMTP id l14so7198865wrw.2 for ; Fri, 04 Nov 2022 06:58:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=mhK4olquGCNDNDrBRzz+G5WWrEFs7DKqFAEfSDy1XIo=; b=gJYjZAMuuACeNvX+ZPfACocuqB/7K3zxyGFsvvyMx9JZjOHO4uUDUkbbthpRqT2Ora 5r6zGlgZ3HlKIAEQ6yqWyPCXSvY9WXPUruoiDwlQCg1dOEpbOFFWdPjSgNsPkC8arExX hTdW7Hi6wAKTCrsp1mgxjTT1/2vq+GhRbYGqix87Ivet1KWk5JiEiAlg7EU9dslLYAy7 mXTXgsJZYidXzZpKgsPILu1nTpwIAPyqh5luJvUK7nkXLj3+95rhFeIZB5u7/bp5D5Sa CZM4rj1+9DI48+wRJIeW1ODnNSvnm8vo2i5w1LX7x/NJR+mndUG8Hm6MCUwJm4yJ1wM4 pNmA== X-Gm-Message-State: ACrzQf0lvEYsdbN8XkfdFiD291MhluoyM9zBuAipxBAvE+eL0Kr8taDK e1HZYrYAurPtH2GSB6DOAoeR4kH6EnwS6A== X-Received: by 2002:a5d:5233:0:b0:236:b893:9d81 with SMTP id i19-20020a5d5233000000b00236b8939d81mr20650351wra.503.1667570299897; Fri, 04 Nov 2022 06:58:19 -0700 (PDT) Received: from localhost.localdomain (static-176-191-105-132.ftth.abo.bbox.fr. [176.191.105.132]) by smtp.gmail.com with ESMTPSA id l4-20020a05600c1d0400b003c6c3fb3cf6sm3413692wms.18.2022.11.04.06.58.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 06:58:19 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [COMMITTED] ada: Remove redundant calls in handling of aspect specifications Date: Fri, 4 Nov 2022 14:58:15 +0100 Message-Id: <20221104135815.86869-1-poulhies@adacore.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-13.3 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 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?= Cc: Piotr Trojanek 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?1748574510485672025?= X-GMAIL-MSGID: =?utf-8?q?1748574510485672025?= From: Piotr Trojanek Routine Set_Aspect_Specifications sets the Has_Aspect flag, so there is no need to set this flag again afterwards. Code cleanup; semantics is unaffected. gcc/ada/ * aspects.adb (Relocate_Aspect): Remove call to Set_Has_Aspects. * sem_ch12.adb (Analyze_Formal_Package_Declaration): Likewise. * sem_util.adb (Copy_Ghost_Aspect, Copy_SPARK_Mode_Aspect): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/aspects.adb | 1 - gcc/ada/sem_ch12.adb | 1 - gcc/ada/sem_util.adb | 2 -- 3 files changed, 4 deletions(-) diff --git a/gcc/ada/aspects.adb b/gcc/ada/aspects.adb index 3471a81f176..81c9c284048 100644 --- a/gcc/ada/aspects.adb +++ b/gcc/ada/aspects.adb @@ -373,7 +373,6 @@ package body Aspects is else Asps := New_List; Set_Aspect_Specifications (To, Asps); - Set_Has_Aspects (To); end if; -- Remove the aspect from its original owner and relocate it to node diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 6781e5ee5b6..0b7b7c904d3 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -3121,7 +3121,6 @@ package body Sem_Ch12 is if Present (Aspect_Specifications (Gen_Decl)) then if No (Aspect_Specifications (N)) then Set_Aspect_Specifications (N, New_List); - Set_Has_Aspects (N); end if; declare diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 536d5fadefb..80d07eb0023 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -7049,7 +7049,6 @@ package body Sem_Util is if Present (Asp) then Set_Aspect_Specifications (To, New_List (New_Copy_Tree (Asp))); - Set_Has_Aspects (To, True); end if; end if; end Copy_Ghost_Aspect; @@ -7101,7 +7100,6 @@ package body Sem_Util is if Present (Asp) then Set_Aspect_Specifications (To, New_List (New_Copy_Tree (Asp))); - Set_Has_Aspects (To, True); end if; end if; end Copy_SPARK_Mode_Aspect;