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: 54207 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6C1ED383D800 for ; Thu, 19 May 2022 14:16:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6C1ED383D800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1652969784; bh=18TdOv5PtcM8pumFQfPlBuPtnfJ7R9aSPuYVUS5DVoE=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=qSDpCCXoHGxVmBRvUaO743wWMhFv7WVbqxpmMNU2d3AaKw1FCbve+i7U9OaR4kQhW 7EiYCCuoBJybeKgXqmqDQejREkzCy/Ic+x5fz8ozT9A9BJMTjYM46HUbOnNtVj//wi uiTkQ8wGH0xh9py2e7WZ9zMqob3WVZ0ljEoW1JTk= 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+patchwork=sourceware.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);