]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Remove unreferenced CCG-specific routine Insert_Declaration
authorPiotr Trojanek <trojanek@adacore.com>
Fri, 7 Jan 2022 10:11:10 +0000 (11:11 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 11 Jan 2022 13:24:49 +0000 (13:24 +0000)
gcc/ada/

* exp_util.ads (Insert_Declaration): Remove spec.
* exp_util.adb (Insert_Declaration): Remove body.

gcc/ada/exp_util.adb
gcc/ada/exp_util.ads

index aa4707248151d6d1faaf3b5e396425e662bd3fd2..64324bfcb72c7ac08790e41270f176d588d590e0 100644 (file)
@@ -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 --
    ---------------------------------
index 9598b87e31abfa7a215f56bead5d94e3d4bfd513..0233e566b28a5595c204cd7f92d9120ee15fe782 100644 (file)
@@ -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