From patchwork Mon Sep 5 07:25:59 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: 966 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp56905wrt; Mon, 5 Sep 2022 00:29:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR496qnqMl++KhPhLYhOB3ePbueM04lYz+p4c/CuXR+3YmbCwn9LOCjMfOfU/VCoS7zE12Sx X-Received: by 2002:a17:907:7204:b0:749:7839:4dd2 with SMTP id dr4-20020a170907720400b0074978394dd2mr11879937ejc.714.1662362985003; Mon, 05 Sep 2022 00:29:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662362985; cv=none; d=google.com; s=arc-20160816; b=XBsAx89K0NIvDu9UZ/HV+pHYLxd8z38qSq89D+dVJW6lEO0UbRwWjnv/8ZV1tcUAL2 lBv3IgR3kFhDcucnpd84eKbKo2D+rISTlPZZufgbJQ2jsC+mG836xK+4Ugz5BWkre30c s/B6hVFQCjmrTfV78wOlUZgLL47Fe5FiMiKRAcecR3JeNB5V09eqd9qGnJHmTU3WNzJp /xSsiPfMQSiXaSS5pN6pk13Gea8McPz/uCpKZyLvegRZ5s1HEpA05oQyq+LNBLRUXCAQ Np66b6ltVrPNVl0ahhRETvTEbu1g1AhjPn+EyIHwKmWJX0lkcsFEpO5JYa4o4TPIgek1 cfgA== 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-disposition:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=0o10rmmMb28MoM/XfzhDXIPWnrSLlwhDGBYA64zPwpk=; b=nVGQKl+ImGcRLVvI1vdLGfOV1JAFRUoHI40kMEwJRgXxFLi8LQUKm0rSulPMV7GTMa ZGDt2rl1ddIZZh/R0TXaZjYc2Mdzxj5YlUc4F6Vw3hWxwNq77neBPG0HWRYNL6C9DjHw BxMe3MJeFUgTTBDy3fI3n8pibBXT36dblWJFSyYaOhaUPZNoV1lwuegHZKmkJgwrn/V6 r20fnKRM30E6qn7ANZliBo8sVgH7SKzxkcbiQHmTH7P8zQxx2nE4zNGsilISbacxqlQT s2XywkrPHeQotvawfetYaTyV6Pe6D2iO4kUHpQlZ6dGzYWMDDqd9gNwbMtaBH5GNgZ9T dgEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=JvJ5BL7f; 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 (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id o21-20020a170906975500b0073d6e0416f9si7692003ejy.671.2022.09.05.00.29.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 00:29:44 -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=JvJ5BL7f; 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 E44BC3835DE8 for ; Mon, 5 Sep 2022 07:27:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E44BC3835DE8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662362866; bh=0o10rmmMb28MoM/XfzhDXIPWnrSLlwhDGBYA64zPwpk=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=JvJ5BL7fdImVNhpENt1oF5g4MTeF0uoqXBrYzAKV6Ydcx4NbP65NY4R3FPMsXlLB8 P+MKybh6vuMcBRo58mgbWkUBkQ56GymPD1OQdHFVMnSqT6jxjDhBvIEHvQQG8TEWVG dBiXrBVkUc7krgMf0bRIGcTltECl6VBapclTnWRE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id 1238F3856959 for ; Mon, 5 Sep 2022 07:26:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1238F3856959 Received: by mail-wr1-x432.google.com with SMTP id t14so2793826wrx.8 for ; Mon, 05 Sep 2022 00:26:02 -0700 (PDT) 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=0o10rmmMb28MoM/XfzhDXIPWnrSLlwhDGBYA64zPwpk=; b=wduq6OpVQvoZ6hNgV9eaQYZJ6N4uTmomdNlYrDh7niuu+kVlzpU4NdjIss2BuMcnn3 XPWuynTXkDss/YkJipquA/2+DRPdOkWgLe7RZ45BIAOgoFdc/DZQ2MA4LxOZL2X6z5l9 PLS4y1t5I2m0U+tnzjRLNzs84VouUUuQPwalwzkJV5i4EOteSxTWBQjfl0celgsUwd1a Ci6jx83UpvJtgpvgHsIf0/oFJQtLTefRArI8aHRUy4b3f8yURymCCwFBuaR93SBwxbux pQvJl8LjB9A/mY5S+jKzBLUGA798m0YFH6ceIdr6+0yy+rKtAP2gPmnIsRIBzQZQYHbS Gr8g== X-Gm-Message-State: ACgBeo0iHSylr/4AyTHC4vd5edO+WocO6sXbgw1ENAGKhf/XzuwizgQU 9KMLw68LY6i6QOk2yLQ8blepJbBHMr9xFg== X-Received: by 2002:a5d:6dad:0:b0:228:46ed:856 with SMTP id u13-20020a5d6dad000000b0022846ed0856mr7144866wrs.225.1662362760869; Mon, 05 Sep 2022 00:26:00 -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 x13-20020a1c7c0d000000b003a5ca627333sm15731137wmc.8.2022.09.05.00.26.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 00:26:00 -0700 (PDT) Date: Mon, 5 Sep 2022 09:25:59 +0200 To: gcc-patches@gcc.gnu.org Subject: [Ada] Cleanup analysis of iterator specifications Message-ID: <20220905072559.GA1174623@poulhies-Precision-5550> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-12.4 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: Marc =?iso-8859-1?q?Poulhi=E8s?= 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?1743113929391556221?= X-GMAIL-MSGID: =?utf-8?q?1743113929391556221?= Code cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch5.adb (Check_Subtype_Definition): Remove redundant call to Present; style cleanup. diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -2211,7 +2211,7 @@ package body Sem_Ch5 is procedure Check_Subtype_Definition (Comp_Type : Entity_Id) is begin - if not Present (Subt) then + if No (Subt) then return; end if; @@ -2231,9 +2231,8 @@ package body Sem_Ch5 is Subt, Comp_Type); end if; - elsif Present (Subt) - and then (not Covers (Base_Type (Bas), Comp_Type) - or else not Subtypes_Statically_Match (Bas, Comp_Type)) + elsif not Covers (Base_Type (Bas), Comp_Type) + or else not Subtypes_Statically_Match (Bas, Comp_Type) then if Is_Array_Type (Typ) then Error_Msg_NE @@ -2330,7 +2329,7 @@ package body Sem_Ch5 is Decl := Make_Full_Type_Declaration (Loc, Defining_Identifier => S, - Type_Definition => + Type_Definition => New_Copy_Tree (Access_To_Subprogram_Definition (Subt))); end if;