[multiple changes]
authorPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 8 Nov 2017 16:52:32 +0000 (16:52 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 8 Nov 2017 16:52:32 +0000 (16:52 +0000)
2017-11-08  Piotr Trojanek  <trojanek@adacore.com>

* spark_xrefs.ads (SPARK_Scope_Record): Remove Spec_File_Num and
Spec_Scope_Num components.
* spark_xrefs.adb (dspark): Skip pretty-printing to removed components.
* lib-xref-spark_specific.adb (Add_SPARK_Scope): Skip initialization of
removed components.
(Collect_SPARK_Xrefs): Skip setting proper values of removed
components.

2017-11-08  Gary Dismukes  <dismukes@adacore.com>

* exp_ch4.adb (Expand_N_Type_Conversion): Add test that the selector
name is a discriminant in check for unconditional accessibility
violation within instances.

From-SVN: r254545

gcc/ada/ChangeLog
gcc/ada/exp_ch4.adb
gcc/ada/lib-xref-spark_specific.adb
gcc/ada/spark_xrefs.adb
gcc/ada/spark_xrefs.ads

index beff132b57e7d384ee45b845b5474666fa6882de..be7a8bb8c7e60557e14d6dc18848d136a0ba1152 100644 (file)
@@ -1,3 +1,19 @@
+2017-11-08  Piotr Trojanek  <trojanek@adacore.com>
+
+       * spark_xrefs.ads (SPARK_Scope_Record): Remove Spec_File_Num and
+       Spec_Scope_Num components.
+       * spark_xrefs.adb (dspark): Skip pretty-printing to removed components.
+       * lib-xref-spark_specific.adb (Add_SPARK_Scope): Skip initialization of
+       removed components.
+       (Collect_SPARK_Xrefs): Skip setting proper values of removed
+       components.
+
+2017-11-08  Gary Dismukes  <dismukes@adacore.com>
+
+       * exp_ch4.adb (Expand_N_Type_Conversion): Add test that the selector
+       name is a discriminant in check for unconditional accessibility
+       violation within instances.
+
 2017-11-08  Piotr Trojanek  <trojanek@adacore.com>
 
        * lib-xref-spark_specific.adb (Add_SPARK_Xrefs): Remove special-case
index 0ef99799a1e510d736fbfb69ee0c8e0409fff584..86d488392a91b0c8a085e35bc32504b2fbae072c 100644 (file)
@@ -11279,6 +11279,7 @@ package body Exp_Ch4 is
          elsif In_Instance_Body
            and then Ekind (Operand_Type) = E_Anonymous_Access_Type
            and then Nkind (Operand) = N_Selected_Component
+           and then Ekind (Entity (Selector_Name (Operand))) = E_Discriminant
            and then Object_Access_Level (Operand) >
                       Type_Access_Level (Target_Type)
          then
index 37349faf2f0504f4b6bbb0b97cfd0fa194410f0d..56bcf5de91922a5308770afce8521b7587af37a7 100644 (file)
@@ -164,8 +164,6 @@ package body SPARK_Specific is
            ((Entity         => E,
              File_Num       => Dspec,
              Scope_Num      => Scope_Id,
-             Spec_File_Num  => 0,
-             Spec_Scope_Num => 0,
              From_Xref      => 1,
              To_Xref        => 0));
 
@@ -836,55 +834,6 @@ package body SPARK_Specific is
          Sdep := Sdep_Next;
       end loop;
 
-      --  Fill in the spec information when relevant
-
-      declare
-         package Entity_Hash_Table is new
-           GNAT.HTable.Simple_HTable
-             (Header_Num => Entity_Hashed_Range,
-              Element    => Scope_Index,
-              No_Element => 0,
-              Key        => Entity_Id,
-              Hash       => Entity_Hash,
-              Equal      => "=");
-
-      begin
-         --  Fill in the hash-table
-
-         for S in SPARK_Scope_Table.First .. SPARK_Scope_Table.Last loop
-            declare
-               Srec : SPARK_Scope_Record renames SPARK_Scope_Table.Table (S);
-            begin
-               Entity_Hash_Table.Set (Srec.Entity, S);
-            end;
-         end loop;
-
-         --  Use the hash-table to locate spec entities
-
-         for S in SPARK_Scope_Table.First .. SPARK_Scope_Table.Last loop
-            declare
-               Srec : SPARK_Scope_Record renames SPARK_Scope_Table.Table (S);
-
-               Spec_Entity : constant Entity_Id :=
-                               Unique_Entity (Srec.Entity);
-               Spec_Scope  : constant Scope_Index :=
-                               Entity_Hash_Table.Get (Spec_Entity);
-
-            begin
-               --  Generic spec may be missing in which case Spec_Scope is zero
-
-               if Spec_Entity /= Srec.Entity
-                 and then Spec_Scope /= 0
-               then
-                  Srec.Spec_File_Num :=
-                    SPARK_Scope_Table.Table (Spec_Scope).File_Num;
-                  Srec.Spec_Scope_Num :=
-                    SPARK_Scope_Table.Table (Spec_Scope).Scope_Num;
-               end if;
-            end;
-         end loop;
-      end;
-
       --  Generate SPARK cross-reference information
 
       Add_SPARK_Xrefs;
index 552ed595ead24ffef1353ddab215645ddbfbfbe5..cea28a606ca90cced50a6a4d8746653de452180e 100644 (file)
@@ -69,10 +69,6 @@ package body SPARK_Xrefs is
          begin
             Write_Str ("  ");
             Write_Int (Int (Index));
-            Write_Str (".  File_Num = ");
-            Write_Int (Int (ASR.File_Num));
-            Write_Str ("  Scope_Num = ");
-            Write_Int (Int (ASR.Scope_Num));
             Write_Str ("  Scope_Name = """);
 
             Write_Str (Unique_Name (ASR.Entity));
index 422300381a8bd9bbe8043acd000a1611f8990fdb..a5d337334d270a45f148f89361e24a06ef7346a7 100644 (file)
@@ -110,14 +110,6 @@ package SPARK_Xrefs is
       Scope_Num : Pos;
       --  Set to the scope number for the scope
 
-      Spec_File_Num : Nat;
-      --  Set to the file dependency number for the scope corresponding to the
-      --  spec of the current scope entity, if different, or else 0.
-
-      Spec_Scope_Num : Nat;
-      --  Set to the scope number for the scope corresponding to the spec of
-      --  the current scope entity, if different, or else 0.
-
       From_Xref : Xref_Index;
       --  Starting index in Xref table for this scope