From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id 9C9C53858410 for ; Mon, 22 May 2023 08:50:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9C9C53858410 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-wr1-x429.google.com with SMTP id ffacd0b85a97d-30796c0cbcaso5755599f8f.1 for ; Mon, 22 May 2023 01:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1684745457; x=1687337457; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mJVvYseTlmEHUK+L16rwJ1b+gFkx44ylAgtyWJEYp9M=; b=MNpI6PzPGZkgEtGVFxC5cgVB7y8551KpOR/b5KiN53mlZgilXQXwgRFVfJ+GMSGYj5 3WF2oacpqvHcjzwMMwp5JViplYMm7+ybi7q3MxAla8g/6SrY2nEBHD1hT4ujO8uu462/ vuaTzvG1dqxQe88oNguXxEFaqmCCUtckL1DbEJxx0dbsJiWLKtMjyX56roXeR3qI7jRP FyhSyTk5QtpI3uuMIaxHWtybzb3z9yZFBqnJLq8n6g1tUTgLBhDSqTYj0ysvhkRd+uTN bfokc120gK1jTe9t6F+FuYr+8nFMyADzk44O/3ErAo4ZCV6q5iRWQhtkXB8vEo9o8bhd /Img== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684745457; x=1687337457; 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=mJVvYseTlmEHUK+L16rwJ1b+gFkx44ylAgtyWJEYp9M=; b=OZc1/bEcE3nIbxLnbFgZ1kRtVtVf75ShbMxajlAB1R9CQ+zlbTslFDYvYihGoqF7U/ 1+9RVPRSaGtxXTiIAasIMwHiQ/ICbdm2yHYi4ODMZWzlEZjjq8g+ePoVgce33SlsozrC sFqkmM1c76Srab3MDfQ9gEanzDC0hsKh6yk+Jlg1tIYSevfoZkS/tqeq4falr33d0W5S mlsxvOrDeVdcJ5kUESr3hThgAH06jOqQEdgjW4+KJMhFRhNwRpDvh+GpCPXwSNfjxMLV oYLyoAmwW3MBphe6I9HV3CrKNd9/4eHOrTxvSqR/RSDbxn0etv+A7W3yy22ZTLu26RVJ m7tA== X-Gm-Message-State: AC+VfDwPFET8HcvBtTmNsgjfO3HGl5iLCYaNez6VQQDj+H/Wxr78eAjs cVGgpxab0TzqBfDcStZIt9Q+ftoKNtR608vQuf7oMA== X-Google-Smtp-Source: ACHHUZ697b1aBXtP/8bltL1DveC68mKshaANDH/8f+MxLgcrnGFjHHIXnmTc/rTYVRkgoLKCo7tbGQ== X-Received: by 2002:a5d:4a12:0:b0:307:9d02:ed9b with SMTP id m18-20020a5d4a12000000b003079d02ed9bmr7016375wrq.61.1684745457489; Mon, 22 May 2023 01:50:57 -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 a3-20020adff7c3000000b002f22c44e974sm6946285wrq.102.2023.05.22.01.50.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 01:50:57 -0700 (PDT) From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED] ada: Cleanup redundant condition in resolution of entity names Date: Mon, 22 May 2023 10:50:55 +0200 Message-Id: <20230522085055.1726743-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.5 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: From: Piotr Trojanek Code cleanup related to new contract for SPARK; semantics is unaffected. gcc/ada/ * sem_res.adb (Resolve_Entity_Name): Combine two IF statements that execute code only for references that come from source. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_res.adb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 3eb13de38df..365c75041a9 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -8022,7 +8022,7 @@ package body Sem_Res is if Comes_From_Source (N) then - -- The following checks are only relevant when SPARK_Mode is on as + -- The following checks are only relevant when SPARK_Mode is On as -- they are not standard Ada legality rules. if SPARK_Mode = On then @@ -8067,13 +8067,11 @@ package body Sem_Res is if Is_Ghost_Entity (E) then Check_Ghost_Context (E, N); end if; - end if; - -- We may be resolving an entity within expanded code, so a reference to - -- an entity should be ignored when calculating effective use clauses to - -- avoid inappropriate marking. + -- We may be resolving an entity within expanded code, so a reference + -- to an entity should be ignored when calculating effective use + -- clauses to avoid inappropriate marking. - if Comes_From_Source (N) then Mark_Use_Clauses (E); end if; end Resolve_Entity_Name; -- 2.40.0