From patchwork Tue Nov 9 09:46:22 2021 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: 47264 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 D404A385843D for ; Tue, 9 Nov 2021 10:09:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D404A385843D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1636452588; bh=NxI2I3tBzfWtxs+erTV6psPjKWLBy5j8shgxf7YkJPk=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=pn+MkLhnY/pKrN38jwOTAJkbwZ/bSpTuKqQpcakL7t0qGPj9FDaMBrAjYjy9zbzo4 BZQo/QHgDUWZ4nIF8t8gLi2KcVAAncmKpW1LBQ0p6V6xOjKF2ruUc1vXBElx0r8vOV GSpK2IGC9mkoLLj059H/ZUu+U0NVcUo9ohIbeeKA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by sourceware.org (Postfix) with ESMTPS id 7A1E43858000 for ; Tue, 9 Nov 2021 09:46:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7A1E43858000 Received: by mail-lf1-x135.google.com with SMTP id y26so42968912lfa.11 for ; Tue, 09 Nov 2021 01:46:25 -0800 (PST) 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=NxI2I3tBzfWtxs+erTV6psPjKWLBy5j8shgxf7YkJPk=; b=cFS0aVKcCfUgQ+PTX0GxaKqZjY+6lZuUJ+X09fZE3ZbrRmXOwoPkISaS1gu3nLO3CA 21Vvfv6YjYuPMrOGMPTM4sxods2+Zjph5MzBHTSw8Tm5mi///6vXMDGiDce9C0Re+Z4M i0Ka+NLWearZGmcRKy1h+9iddnXr6sOvq4ZEshXzzDeDAR1TD1AHRW4CSBu6PXPKRBQJ WNZDiGaKTk1NaRq94g0jaWTf3Myv8wet2xGUSvGspGDxbhuqblM/7oyZZHVACkxjuU7h Zu6sN750oPPsBn6kQneoN55lIqiX+6TLIXrQgKx6Uv88SifieJicsTLor8fmMzuzJeBZ NYNw== X-Gm-Message-State: AOAM5315lhswKnUR+Bh/buDSf5s91oOH0aht7btxu1SJ419g9j1qn/YM 3mAOVwxPxMX3kPFlOJ2NtxncovKu979vfLlP X-Google-Smtp-Source: ABdhPJw3nbtL8flAm1SU2/lheylWwSzpN1YRx9a00UnTcCeDi8nReUEYDomMSuv78FDEde7c+EU8Ww== X-Received: by 2002:a19:d602:: with SMTP id n2mr5437272lfg.86.1636451184317; Tue, 09 Nov 2021 01:46:24 -0800 (PST) Received: from adacore.com ([2a02:2ab8:224:2ce:72b5:e8ff:feef:ee60]) by smtp.gmail.com with ESMTPSA id v2sm200133ljg.46.2021.11.09.01.46.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Nov 2021 01:46:23 -0800 (PST) Date: Tue, 9 Nov 2021 09:46:22 +0000 To: gcc-patches@gcc.gnu.org Subject: [Ada] Print Storage_Pool and Procedure_To_Call fields Message-ID: <20211109094622.GA831001@adacore.com> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-13.0 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Eric Botcazou Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" This makes Sprint output the Storage_Pool and Procedure_To_Call fields of the nodes for which they are defined (allocator, free and returns). Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sprint.adb (Sprint_Node_Actual) : Also print the Procedure_To_Call field if it is present. : Also print the Storage_Pool and Procedure_To_Call fields if they are present. : Likewise. : Likewise. diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb --- a/gcc/ada/sprint.adb +++ b/gcc/ada/sprint.adb @@ -1116,6 +1116,12 @@ package body Sprint is Write_Char (']'); end if; + if Present (Procedure_To_Call (Node)) then + Write_Str_With_Col_Check ("[procedure_to_call = "); + Sprint_Node (Procedure_To_Call (Node)); + Write_Char (']'); + end if; + when N_And_Then => Sprint_Left_Opnd (Node); Write_Str_Sloc (" and then "); @@ -1785,11 +1791,23 @@ package body Sprint is if Present (Handled_Statement_Sequence (Node)) then Write_Str_With_Col_Check (" do"); Sprint_Node (Handled_Statement_Sequence (Node)); - Write_Indent_Str ("end return;"); - else - Write_Indent_Str (";"); + Write_Indent_Str ("end return"); + end if; + + if Present (Storage_Pool (Node)) then + Write_Str_With_Col_Check ("[storage_pool = "); + Sprint_Node (Storage_Pool (Node)); + Write_Char (']'); end if; + if Present (Procedure_To_Call (Node)) then + Write_Str_With_Col_Check ("[procedure_to_call = "); + Sprint_Node (Procedure_To_Call (Node)); + Write_Char (']'); + end if; + + Write_Char (';'); + when N_Delta_Aggregate => Write_Str_With_Col_Check_Sloc ("("); Sprint_Node (Expression (Node)); @@ -1973,6 +1991,19 @@ package body Sprint is when N_Free_Statement => Write_Indent_Str_Sloc ("free "); Sprint_Node (Expression (Node)); + + if Present (Storage_Pool (Node)) then + Write_Str_With_Col_Check ("[storage_pool = "); + Sprint_Node (Storage_Pool (Node)); + Write_Char (']'); + end if; + + if Present (Procedure_To_Call (Node)) then + Write_Str_With_Col_Check ("[procedure_to_call = "); + Sprint_Node (Procedure_To_Call (Node)); + Write_Char (']'); + end if; + Write_Char (';'); when N_Freeze_Entity => @@ -3170,11 +3201,24 @@ package body Sprint is if Present (Expression (Node)) then Write_Indent_Str_Sloc ("return "); Sprint_Node (Expression (Node)); - Write_Char (';'); else - Write_Indent_Str_Sloc ("return;"); + Write_Indent_Str_Sloc ("return"); + end if; + + if Present (Storage_Pool (Node)) then + Write_Str_With_Col_Check ("[storage_pool = "); + Sprint_Node (Storage_Pool (Node)); + Write_Char (']'); end if; + if Present (Procedure_To_Call (Node)) then + Write_Str_With_Col_Check ("[procedure_to_call = "); + Sprint_Node (Procedure_To_Call (Node)); + Write_Char (']'); + end if; + + Write_Char (';'); + when N_Selective_Accept => Write_Indent_Str_Sloc ("select");