Commit 45a6947d by Piotr Trojanek Committed by Pierre-Marie de Rodat

spark_xrefs.ads (SPARK_Scope_Record): Rename Scope_Id component to Entity.

2017-11-08  Piotr Trojanek  <trojanek@adacore.com>

	* spark_xrefs.ads (SPARK_Scope_Record): Rename Scope_Id component to
	Entity.
	* lib-xref-spark_specific.adb, spark_xrefs.adb: Propagate renaming of
	the Scope_Id record component.

From-SVN: r254542
parent 00b3de22
2017-11-08 Piotr Trojanek <trojanek@adacore.com> 2017-11-08 Piotr Trojanek <trojanek@adacore.com>
* spark_xrefs.ads (SPARK_Scope_Record): Rename Scope_Id component to
Entity.
* lib-xref-spark_specific.adb, spark_xrefs.adb: Propagate renaming of
the Scope_Id record component.
2017-11-08 Piotr Trojanek <trojanek@adacore.com>
* spark_xrefs.ads (SPARK_File_Record): Remove string components. * spark_xrefs.ads (SPARK_File_Record): Remove string components.
* spark_xrefs.adb (dspark): Remove pretty-printing of removed * spark_xrefs.adb (dspark): Remove pretty-printing of removed
SPARK_File_Record components. SPARK_File_Record components.
......
...@@ -161,7 +161,7 @@ package body SPARK_Specific is ...@@ -161,7 +161,7 @@ package body SPARK_Specific is
-- range. -- range.
SPARK_Scope_Table.Append SPARK_Scope_Table.Append
((Scope_Id => E, ((Entity => E,
File_Num => Dspec, File_Num => Dspec,
Scope_Num => Scope_Id, Scope_Num => Scope_Id,
Spec_File_Num => 0, Spec_File_Num => 0,
...@@ -323,7 +323,7 @@ package body SPARK_Specific is ...@@ -323,7 +323,7 @@ package body SPARK_Specific is
function Entity_Of_Scope (S : Scope_Index) return Entity_Id is function Entity_Of_Scope (S : Scope_Index) return Entity_Id is
begin begin
return SPARK_Scope_Table.Table (S).Scope_Id; return SPARK_Scope_Table.Table (S).Entity;
end Entity_Of_Scope; end Entity_Of_Scope;
------------------- -------------------
...@@ -395,7 +395,7 @@ package body SPARK_Specific is ...@@ -395,7 +395,7 @@ package body SPARK_Specific is
function Is_Past_Scope_Entity return Boolean is function Is_Past_Scope_Entity return Boolean is
begin begin
for Index in SPARK_Scope_Table.First .. S - 1 loop for Index in SPARK_Scope_Table.First .. S - 1 loop
if SPARK_Scope_Table.Table (Index).Scope_Id = E then if SPARK_Scope_Table.Table (Index).Entity = E then
return True; return True;
end if; end if;
end loop; end loop;
...@@ -407,7 +407,7 @@ package body SPARK_Specific is ...@@ -407,7 +407,7 @@ package body SPARK_Specific is
begin begin
for Index in S .. SPARK_Scope_Table.Last loop for Index in S .. SPARK_Scope_Table.Last loop
if SPARK_Scope_Table.Table (Index).Scope_Id = E then if SPARK_Scope_Table.Table (Index).Entity = E then
return True; return True;
end if; end if;
end loop; end loop;
...@@ -606,7 +606,7 @@ package body SPARK_Specific is ...@@ -606,7 +606,7 @@ package body SPARK_Specific is
declare declare
S : SPARK_Scope_Record renames SPARK_Scope_Table.Table (Index); S : SPARK_Scope_Record renames SPARK_Scope_Table.Table (Index);
begin begin
Set_Scope_Num (S.Scope_Id, S.Scope_Num); Set_Scope_Num (S.Entity, S.Scope_Num);
end; end;
end loop; end loop;
...@@ -920,7 +920,7 @@ package body SPARK_Specific is ...@@ -920,7 +920,7 @@ package body SPARK_Specific is
declare declare
Srec : SPARK_Scope_Record renames SPARK_Scope_Table.Table (S); Srec : SPARK_Scope_Record renames SPARK_Scope_Table.Table (S);
begin begin
Entity_Hash_Table.Set (Srec.Scope_Id, S); Entity_Hash_Table.Set (Srec.Entity, S);
end; end;
end loop; end loop;
...@@ -931,14 +931,14 @@ package body SPARK_Specific is ...@@ -931,14 +931,14 @@ package body SPARK_Specific is
Srec : SPARK_Scope_Record renames SPARK_Scope_Table.Table (S); Srec : SPARK_Scope_Record renames SPARK_Scope_Table.Table (S);
Spec_Entity : constant Entity_Id := Spec_Entity : constant Entity_Id :=
Unique_Entity (Srec.Scope_Id); Unique_Entity (Srec.Entity);
Spec_Scope : constant Scope_Index := Spec_Scope : constant Scope_Index :=
Entity_Hash_Table.Get (Spec_Entity); Entity_Hash_Table.Get (Spec_Entity);
begin begin
-- Generic spec may be missing in which case Spec_Scope is zero -- Generic spec may be missing in which case Spec_Scope is zero
if Spec_Entity /= Srec.Scope_Id if Spec_Entity /= Srec.Entity
and then Spec_Scope /= 0 and then Spec_Scope /= 0
then then
Srec.Spec_File_Num := Srec.Spec_File_Num :=
......
...@@ -75,7 +75,7 @@ package body SPARK_Xrefs is ...@@ -75,7 +75,7 @@ package body SPARK_Xrefs is
Write_Int (Int (ASR.Scope_Num)); Write_Int (Int (ASR.Scope_Num));
Write_Str (" Scope_Name = """); Write_Str (" Scope_Name = """);
Write_Str (Unique_Name (ASR.Scope_Id)); Write_Str (Unique_Name (ASR.Entity));
Write_Char ('"'); Write_Char ('"');
Write_Str (" From = "); Write_Str (" From = ");
......
...@@ -109,8 +109,8 @@ package SPARK_Xrefs is ...@@ -109,8 +109,8 @@ package SPARK_Xrefs is
-- determined. -- determined.
type SPARK_Scope_Record is record type SPARK_Scope_Record is record
Scope_Id : Entity_Id; Entity : Entity_Id;
-- Pointer to scope name in ALI file -- Entity that is represented by the scope
File_Num : Nat; File_Num : Nat;
-- Set to the file dependency number for the scope -- Set to the file dependency number for the scope
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment