public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-6468] [Ada] Remove unreferenced CCG-specific routine Insert_Declaration
Date: Tue, 11 Jan 2022 13:28:26 +0000 (GMT)	[thread overview]
Message-ID: <20220111132826.3FC2338A941F@sourceware.org> (raw)

https://gcc.gnu.org/g:ce263de61fb0817d4d5adcb740e1b08dbd7bb6b4

commit r12-6468-gce263de61fb0817d4d5adcb740e1b08dbd7bb6b4
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Fri Jan 7 11:11:10 2022 +0100

    [Ada] Remove unreferenced CCG-specific routine Insert_Declaration
    
    gcc/ada/
    
            * exp_util.ads (Insert_Declaration): Remove spec.
            * exp_util.adb (Insert_Declaration): Remove body.

Diff:
---
 gcc/ada/exp_util.adb | 37 -------------------------------------
 gcc/ada/exp_util.ads | 12 ------------
 2 files changed, 49 deletions(-)

diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index aa470724815..64324bfcb72 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -7916,43 +7916,6 @@ package body Exp_Util is
       end if;
    end Insert_Actions_After;
 
-   ------------------------
-   -- Insert_Declaration --
-   ------------------------
-
-   procedure Insert_Declaration (N : Node_Id; Decl : Node_Id) is
-      P : Node_Id;
-
-   begin
-      pragma Assert (Nkind (N) in N_Subexpr);
-
-      --  Climb until we find a procedure or a package
-
-      P := N;
-      loop
-         pragma Assert (Present (Parent (P)));
-         P := Parent (P);
-
-         if Is_List_Member (P) then
-            exit when Nkind (Parent (P)) in
-                        N_Package_Specification | N_Subprogram_Body;
-
-            --  Special handling for handled sequence of statements, we must
-            --  insert in the statements not the exception handlers!
-
-            if Nkind (Parent (P)) = N_Handled_Sequence_Of_Statements then
-               P := First (Statements (Parent (P)));
-               exit;
-            end if;
-         end if;
-      end loop;
-
-      --  Now do the insertion
-
-      Insert_Before (P, Decl);
-      Analyze (Decl);
-   end Insert_Declaration;
-
    ---------------------------------
    -- Insert_Library_Level_Action --
    ---------------------------------
diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads
index 9598b87e31a..0233e566b28 100644
--- a/gcc/ada/exp_util.ads
+++ b/gcc/ada/exp_util.ads
@@ -164,18 +164,6 @@ package Exp_Util is
    --  generalize to expressions if there is a need but this is tricky to
    --  implement because of short-circuits (among other things).
 
-   procedure Insert_Declaration (N : Node_Id; Decl : Node_Id);
-   --  N must be a subexpression (Nkind in N_Subexpr). This is similar to
-   --  Insert_Action (N, Decl), but inserts Decl outside the expression in
-   --  which N appears. This is called Insert_Declaration because the intended
-   --  use is for declarations that have no associated code. We can't go
-   --  moving other kinds of things out of the current expression, since they
-   --  could be executed conditionally (e.g. right operand of short circuit,
-   --  or THEN/ELSE of if expression). This is currently used only in
-   --  Modify_Tree_For_C mode, where it is needed because in C we have no
-   --  way of having declarations within an expression (a really annoying
-   --  limitation).
-
    procedure Insert_Library_Level_Action (N : Node_Id);
    --  This procedure inserts and analyzes the node N as an action at the
    --  library level for the current unit (i.e. it is attached to the


                 reply	other threads:[~2022-01-11 13:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220111132826.3FC2338A941F@sourceware.org \
    --to=pmderodat@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).