diff mbox series

[Ada] Renamed_Entity should return Entity_Id

Message ID 20220105113327.GA2712732@adacore.com
State New
Headers show
Series [Ada] Renamed_Entity should return Entity_Id | expand

Commit Message

Pierre-Marie de Rodat Jan. 5, 2022, 11:33 a.m. UTC
This patch is minor cleanup. The Renamed_Entity and Alias synthesized
attributes are of type Entity_Id.  No change in behavior.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* einfo-utils.ads, einfo-utils.adb (Renamed_Entity Alias):
	Change Node_Id to Entity_Id.
diff mbox series

Patch

diff --git a/gcc/ada/einfo-utils.adb b/gcc/ada/einfo-utils.adb
--- a/gcc/ada/einfo-utils.adb
+++ b/gcc/ada/einfo-utils.adb
@@ -47,16 +47,16 @@  package body Einfo.Utils is
    -- Aliases/Renamings of Renamed_Or_Alias --
    -------------------------------------------
 
-   function Alias (N : Entity_Id) return Node_Id is
+   function Alias (N : Entity_Id) return Entity_Id is
    begin
-      return Val : constant Node_Id := Renamed_Or_Alias (N) do
+      return Val : constant Entity_Id := Renamed_Or_Alias (N) do
          pragma Assert
            (Is_Overloadable (N) or else Ekind (N) = E_Subprogram_Type);
          pragma Assert (Val in N_Entity_Id | N_Empty_Id);
       end return;
    end Alias;
 
-   procedure Set_Alias (N : Entity_Id; Val : Node_Id) is
+   procedure Set_Alias (N : Entity_Id; Val : Entity_Id) is
    begin
       pragma Assert
         (Is_Overloadable (N) or else Ekind (N) = E_Subprogram_Type);
@@ -65,15 +65,15 @@  package body Einfo.Utils is
       Set_Renamed_Or_Alias (N, Val);
    end Set_Alias;
 
-   function Renamed_Entity (N : Entity_Id) return Node_Id is
+   function Renamed_Entity (N : Entity_Id) return Entity_Id is
    begin
-      return Val : constant Node_Id := Renamed_Or_Alias (N) do
+      return Val : constant Entity_Id := Renamed_Or_Alias (N) do
          pragma Assert (not Is_Object (N) or else Etype (N) = Any_Type);
          pragma Assert (Val in N_Entity_Id | N_Empty_Id);
       end return;
    end Renamed_Entity;
 
-   procedure Set_Renamed_Entity (N : Entity_Id; Val : Node_Id) is
+   procedure Set_Renamed_Entity (N : Entity_Id; Val : Entity_Id) is
    begin
       pragma Assert (not Is_Object (N));
       pragma Assert (Val in N_Entity_Id);


diff --git a/gcc/ada/einfo-utils.ads b/gcc/ada/einfo-utils.ads
--- a/gcc/ada/einfo-utils.ads
+++ b/gcc/ada/einfo-utils.ads
@@ -42,10 +42,10 @@  package Einfo.Utils is
    --  expressions, but those use different mechanisms; the fields here are not
    --  used.
 
-   function Alias (N : Entity_Id) return Node_Id;
-   procedure Set_Alias (N : Entity_Id; Val : Node_Id);
-   function Renamed_Entity (N : Entity_Id) return Node_Id;
-   procedure Set_Renamed_Entity (N : Entity_Id; Val : Node_Id);
+   function Alias (N : Entity_Id) return Entity_Id;
+   procedure Set_Alias (N : Entity_Id; Val : Entity_Id);
+   function Renamed_Entity (N : Entity_Id) return Entity_Id;
+   procedure Set_Renamed_Entity (N : Entity_Id; Val : Entity_Id);
    function Renamed_Object (N : Entity_Id) return Node_Id;
    procedure Set_Renamed_Object (N : Entity_Id; Val : Node_Id);