[Ada] Remove UET_Address attribute

Arnaud Charlet charlet@adacore.com
Tue Oct 20 12:13:00 GMT 2015


This was an unused and internal-use only attribute.
No testcase.

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

2015-10-20  Tristan Gingold  <gingold@adacore.com>

	* sem_util.adb (Is_Protected_Self_Reference): Remove reference to
	UET_Address in comment.
	* sem_attr.adb (Check_Unit_Name): Adjust comment.
	(Analyze_Attribute): Remove handling of UET_Address.
	* sem_attr.ads (Attribute_Impl_Def): Remove Attribute_UET_Address.
	* snames.ads-tmpl Remove Name_UET_Address, Attribute_UET_Address.
	* exp_attr.adb (Expand_N_Attribute_Reference): Remove
	Attribute_UET_Address.

-------------- next part --------------
Index: exp_attr.adb
===================================================================
--- exp_attr.adb	(revision 229057)
+++ exp_attr.adb	(working copy)
@@ -6152,49 +6152,6 @@
             Expand_Fpt_Attribute_R (N);
          end if;
 
-      -----------------
-      -- UET_Address --
-      -----------------
-
-      when Attribute_UET_Address => UET_Address : declare
-         Ent : constant Entity_Id := Make_Temporary (Loc, 'T');
-
-      begin
-         Insert_Action (N,
-           Make_Object_Declaration (Loc,
-             Defining_Identifier => Ent,
-             Aliased_Present     => True,
-             Object_Definition   =>
-               New_Occurrence_Of (RTE (RE_Address), Loc)));
-
-         --  Construct name __gnat_xxx__SDP, where xxx is the unit name
-         --  in normal external form.
-
-         Get_External_Unit_Name_String (Get_Unit_Name (Pref));
-         Name_Buffer (1 + 7 .. Name_Len + 7) := Name_Buffer (1 .. Name_Len);
-         Name_Len := Name_Len + 7;
-         Name_Buffer (1 .. 7) := "__gnat_";
-         Name_Buffer (Name_Len + 1 .. Name_Len + 5) := "__SDP";
-         Name_Len := Name_Len + 5;
-
-         Set_Is_Imported (Ent);
-         Set_Interface_Name (Ent,
-           Make_String_Literal (Loc,
-             Strval => String_From_Name_Buffer));
-
-         --  Set entity as internal to ensure proper Sprint output of its
-         --  implicit importation.
-
-         Set_Is_Internal (Ent);
-
-         Rewrite (N,
-           Make_Attribute_Reference (Loc,
-             Prefix => New_Occurrence_Of (Ent, Loc),
-             Attribute_Name => Name_Address));
-
-         Analyze_And_Resolve (N, Typ);
-      end UET_Address;
-
       ------------
       -- Update --
       ------------
Index: sem_util.adb
===================================================================
--- sem_util.adb	(revision 229059)
+++ sem_util.adb	(working copy)
@@ -12730,9 +12730,9 @@
 
    begin
       --  Verify that prefix is analyzed and has the proper form. Note that
-      --  the attributes Elab_Spec, Elab_Body, Elab_Subp_Body and UET_Address,
-      --  which also produce the address of an entity, do not analyze their
-      --  prefix because they denote entities that are not necessarily visible.
+      --  the attributes Elab_Spec, Elab_Body and Elab_Subp_Body which also
+      --  produce the address of an entity, do not analyze their prefix
+      --  because they denote entities that are not necessarily visible.
       --  Neither of them can apply to a protected type.
 
       return Ada_Version >= Ada_2005
Index: sem_attr.adb
===================================================================
--- sem_attr.adb	(revision 229057)
+++ sem_attr.adb	(working copy)
@@ -388,8 +388,8 @@
       --  itself of the form of a library unit name. Note that this is
       --  quite different from Check_Program_Unit, since it only checks
       --  the syntactic form of the name, not the semantic identity. This
-      --  is because it is used with attributes (Elab_Body, Elab_Spec,
-      --  UET_Address and Elaborated) which can refer to non-visible unit.
+      --  is because it is used with attributes (Elab_Body, Elab_Spec and
+      --  Elaborated) which can refer to non-visible unit.
 
       procedure Error_Attr (Msg : String; Error_Node : Node_Id);
       pragma No_Return (Error_Attr);
@@ -2675,7 +2675,6 @@
       if Aname /= Name_Elab_Body       and then
          Aname /= Name_Elab_Spec       and then
          Aname /= Name_Elab_Subp_Body  and then
-         Aname /= Name_UET_Address     and then
          Aname /= Name_Enabled         and then
          Aname /= Name_Old
       then
@@ -6026,15 +6025,6 @@
 
          Analyze_And_Resolve (N, Standard_String);
 
-      -----------------
-      -- UET_Address --
-      -----------------
-
-      when Attribute_UET_Address =>
-         Check_E0;
-         Check_Unit_Name (P);
-         Set_Etype (N, RTE (RE_Address));
-
       -----------------------
       -- Unbiased_Rounding --
       -----------------------
@@ -9710,7 +9700,6 @@
            Attribute_Terminated                   |
            Attribute_To_Address                   |
            Attribute_Type_Key                     |
-           Attribute_UET_Address                  |
            Attribute_Unchecked_Access             |
            Attribute_Universal_Literal_String     |
            Attribute_Unrestricted_Access          |
@@ -11060,16 +11049,6 @@
          when Attribute_Result =>
             null;
 
-         -----------------
-         -- UET_Address --
-         -----------------
-
-         --  Prefix must not be resolved in this case, since it is not a
-         --  real entity reference. No action of any kind is require.
-
-         when Attribute_UET_Address =>
-            return;
-
          ----------------------
          -- Unchecked_Access --
          ----------------------
Index: sem_attr.ads
===================================================================
--- sem_attr.ads	(revision 229049)
+++ sem_attr.ads	(working copy)
@@ -508,16 +508,6 @@
       --  Aux_DEC into System, then the type Type_Class can be referenced
       --  as an entity within System, as can its enumeration literals.
 
-      -----------------
-      -- UET_Address --
-      -----------------
-
-      Attribute_UET_Address => True,
-      --  Unit'UET_Address, where Unit is a program unit, yields the address
-      --  of the unit exception table for the specified unit. This is only
-      --  used in the internal implementation of exception handling. See the
-      --  implementation of unit Ada.Exceptions for details on its use.
-
       ------------------------------
       -- Universal_Literal_String --
       ------------------------------
Index: snames.ads-tmpl
===================================================================
--- snames.ads-tmpl	(revision 229049)
+++ snames.ads-tmpl	(working copy)
@@ -938,7 +938,6 @@
    Name_To_Address                     : constant Name_Id := N + $; -- GNAT
    Name_Type_Class                     : constant Name_Id := N + $; -- GNAT
    Name_Type_Key                       : constant Name_Id := N + $; -- GNAT
-   Name_UET_Address                    : constant Name_Id := N + $; -- GNAT
    Name_Unbiased_Rounding              : constant Name_Id := N + $;
    Name_Unchecked_Access               : constant Name_Id := N + $;
    Name_Unconstrained_Array            : constant Name_Id := N + $; -- GNAT
@@ -1575,7 +1574,6 @@
       Attribute_To_Address,
       Attribute_Type_Class,
       Attribute_Type_Key,
-      Attribute_UET_Address,
       Attribute_Unbiased_Rounding,
       Attribute_Unchecked_Access,
       Attribute_Unconstrained_Array,


More information about the Gcc-patches mailing list