]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Deconstruct unused Withed_Body filed of N_With_Clause node
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 16 Jul 2018 14:11:42 +0000 (14:11 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 16 Jul 2018 14:11:42 +0000 (14:11 +0000)
The Withed_Body field was added to N_With_Clause node to help the
Walk_Library_Items routine, which was created for the CodePeer backend
and later adopted by the GNATprove.

This routine is meant to traverse all library units, such that declarations
are visited before references. However, for complex units (in particular,
with generics and child packages) it never worked reliably and backends
developed their own workarounds. This patch deconstructs the field, as it
hasn't been used for years.

Semantics unaffected; no test provided.

2018-07-16  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

* sinfo.ads, sinfo.adb (Withed_Body): Remove.
(Set_Withed_Body): Remove.

From-SVN: r262721

gcc/ada/ChangeLog
gcc/ada/sinfo.adb
gcc/ada/sinfo.ads

index f3c32e125ef2839f4c9888dd39da325f285db10c..1a14dae784e04d26ee7b3c5cb15805a4e787fbf5 100644 (file)
@@ -1,3 +1,8 @@
+2018-07-16  Piotr Trojanek  <trojanek@adacore.com>
+
+       * sinfo.ads, sinfo.adb (Withed_Body): Remove.
+       (Set_Withed_Body): Remove.
+
 2018-07-16  Piotr Trojanek  <trojanek@adacore.com>
 
        * sem.adb (Walk_Library_Items): Skip units with configuration pragmas
index 45f2867cce7eb3d46b4a7de419adc6c5e94fd9ca..e6ff0e774afa165ec16096bab86ea2ff0f7fac6e 100644 (file)
@@ -3522,14 +3522,6 @@ package body Sinfo is
       return Flag13 (N);
    end Was_Originally_Stub;
 
-   function Withed_Body
-      (N : Node_Id) return Node_Id is
-   begin
-      pragma Assert (False
-        or else NT (N).Nkind = N_With_Clause);
-      return Node1 (N);
-   end Withed_Body;
-
    --------------------------
    -- Field Set Procedures --
    --------------------------
@@ -6990,14 +6982,6 @@ package body Sinfo is
       Set_Flag13 (N, Val);
    end Set_Was_Originally_Stub;
 
-   procedure Set_Withed_Body
-     (N : Node_Id; Val : Node_Id) is
-   begin
-      pragma Assert (False
-        or else NT (N).Nkind = N_With_Clause);
-      Set_Node1 (N, Val);
-   end Set_Withed_Body;
-
    -------------------------
    -- Iterator Procedures --
    -------------------------
index c6e04e7920a4c91ba4466085af104308cbf7e63f..ae296612ed31fb06505a3b38c38a07c029e2c611 100644 (file)
@@ -2504,12 +2504,6 @@ package Sinfo is
    --    Original_Node here because of the case of nested instantiations where
    --    the substituted node can be copied.
 
-   --  Withed_Body (Node1-Sem)
-   --    Present in N_With_Clause nodes. Set if the unit in whose context
-   --    the with_clause appears instantiates a generic contained in the
-   --    library unit of the with_clause and as a result loads its body.
-   --    Used for a more precise unit traversal for CodePeer.
-
    --------------------------------------------------
    -- Note on Use of End_Label and End_Span Fields --
    --------------------------------------------------
@@ -6743,7 +6737,6 @@ package Sinfo is
 
       --  N_With_Clause
       --  Sloc points to first token of library unit name
-      --  Withed_Body (Node1-Sem)
       --  Name (Node2)
       --  Private_Present (Flag15) set if with_clause has private keyword
       --  Limited_Present (Flag17) set if LIMITED is present
@@ -10307,9 +10300,6 @@ package Sinfo is
    function Was_Originally_Stub
      (N : Node_Id) return Boolean;    -- Flag13
 
-   function Withed_Body
-     (N : Node_Id) return Node_Id;    -- Node1
-
    --  End functions (note used by xsinfo utility program to end processing)
 
    ----------------------------
@@ -11408,9 +11398,6 @@ package Sinfo is
    procedure Set_Was_Originally_Stub
      (N : Node_Id; Val : Boolean := True);    -- Flag13
 
-   procedure Set_Withed_Body
-     (N : Node_Id; Val : Node_Id);            -- Node1
-
    -------------------------
    -- Iterator Procedures --
    -------------------------
@@ -13613,7 +13600,6 @@ package Sinfo is
    pragma Inline (Was_Attribute_Reference);
    pragma Inline (Was_Expression_Function);
    pragma Inline (Was_Originally_Stub);
-   pragma Inline (Withed_Body);
 
    pragma Inline (Set_Abort_Present);
    pragma Inline (Set_Abortable_Part);
@@ -13975,6 +13961,5 @@ package Sinfo is
    pragma Inline (Set_Was_Attribute_Reference);
    pragma Inline (Set_Was_Expression_Function);
    pragma Inline (Set_Was_Originally_Stub);
-   pragma Inline (Set_Withed_Body);
 
 end Sinfo;