From patchwork Thu May 19 14:15:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Marie de Rodat X-Patchwork-Id: 1633264 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=vK5b8Mr9; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4L3sNK1jMcz9tkb for ; Fri, 20 May 2022 00:16:17 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 19BAC383E82F for ; Thu, 19 May 2022 14:16:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 19BAC383E82F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1652969775; bh=18TdOv5PtcM8pumFQfPlBuPtnfJ7R9aSPuYVUS5DVoE=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=vK5b8Mr98bntwtwTNvToAqxmaiaXTGDmN0mdkbMlXDzvANfzqI8BWhlPH27vYCmOG DhPtm9Q3Zk2csWLGssqDK+lCg7/kVcezZfXnl5qg7OPt3nizeSLL7fi0VAdKyAKubh U2UE6PtCGv82AT2xWNrECIgguiumlAuG5tkUEIWc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id ADEDC385703E for ; Thu, 19 May 2022 14:15:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ADEDC385703E Received: by mail-wr1-x436.google.com with SMTP id u27so6553743wru.8 for ; Thu, 19 May 2022 07:15:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=18TdOv5PtcM8pumFQfPlBuPtnfJ7R9aSPuYVUS5DVoE=; b=3xGKFWasHNWnEuOP2IQMx1Wlr/e5DrEpfIUF6LGj+yoyRBAW/DD2+u1RO2DxRfLpgo jKm6ETh9GSH5xwCdQwo0kQdnae93EDftQaSI6L0bjqwQqn0tugz8SjYzob9byTcYw8Gd gWBDFMz6ZZ8M4OenQTvbxuqknbHsAMD7NQggXDxlunTcIFJUa//M2tizFLQ2xy24VS7j yQc4FPvZJww2LLf+UvZJZA6u1g9yPUEKmQOdZecZzOPsm5ywYuvyX9U1lPfla++muVZR xWPlGbDWb+qNngzyj1wG1ABIZxw4NgNXPXd6OagoW6iM5RLt8CtGxivMR+sX0/G1ppmw /P0Q== X-Gm-Message-State: AOAM532993c4i8aoyFWBSww439slDHimLZpIp06lF4YLGDN8I8PY33T7 Yjj7GutBQL6HqCiyzr3usf06O7ZsZNEJQg== X-Google-Smtp-Source: ABdhPJzqNwxXDtBbVPaPH4BbLMXmo+dqZijc+R+Uyj/251XQXoHSQwN1lJxT+GXHpfcxeFbFT3zzzw== X-Received: by 2002:a5d:594e:0:b0:20d:bb7:72b3 with SMTP id e14-20020a5d594e000000b0020d0bb772b3mr4262177wri.702.1652969752274; Thu, 19 May 2022 07:15:52 -0700 (PDT) Received: from adacore.com ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id s19-20020adf9793000000b0020d098935dbsm5200341wrb.58.2022.05.19.07.15.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 May 2022 07:15:51 -0700 (PDT) Date: Thu, 19 May 2022 14:15:50 +0000 To: gcc-patches@gcc.gnu.org Subject: [Ada] Remove dead code for scope entity having E_Subprogram_Body kind Message-ID: <20220519141550.GA3723011@adacore.com> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-13.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 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: Pierre-Marie de Rodat via Gcc-patches From: Pierre-Marie de Rodat Reply-To: Pierre-Marie de Rodat Cc: Piotr Trojanek Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" In GNAT AST the Scope field always points to the semantic scope (e.g. subprogram) and never to syntactic scope (e.g. subprogram body). Cleanup related to handling of circular access-to-record types. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity): Remove dead code which expected Scope to return E_Subprogram_Body entity. diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -363,10 +363,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) if (Is_Type (gnat_temp)) gnat_temp = Underlying_Type (gnat_temp); - if (Ekind (gnat_temp) == E_Subprogram_Body) - gnat_temp - = Corresponding_Spec (Parent (Declaration_Node (gnat_temp))); - if (Is_Subprogram (gnat_temp) && Present (Protected_Body_Subprogram (gnat_temp))) gnat_temp = Protected_Body_Subprogram (gnat_temp);