aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/lib-xref-spark_specific.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2017-01-19 12:55:21 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2017-01-19 12:55:21 +0100
commit4f94fa1186d071b2f4b5d864acb4b0427cb63368 (patch)
tree433636d571333cf3b1f941de0615bedd050305ca /gcc/ada/lib-xref-spark_specific.adb
parent4fcf700c916e89d5b1351200b2dd44a9fe8678d3 (diff)
downloadgcc-4f94fa1186d071b2f4b5d864acb4b0427cb63368.zip
gcc-4f94fa1186d071b2f4b5d864acb4b0427cb63368.tar.gz
gcc-4f94fa1186d071b2f4b5d864acb4b0427cb63368.tar.bz2
[multiple changes]
2017-01-19 Javier Miranda <miranda@adacore.com> * exp_ch6.adb (Expand_Call): Remove side effects on actuals that are allocators with qualified expression since the initialization of the object is performed by means of individual statements (and hence it must be done before the call). 2017-01-19 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Analyze_Declarations): Minor reformatting. (Build_Derived_Enumeration_Type): If the derived type inherits a dynamic predicate from its parent, the bounds of the type must freeze because an explicit constraint is constructed for the type and the corresponding range is elaborated now. 2017-01-19 Arnaud Charlet <charlet@adacore.com> * sem_attr.ads: minor fix of inconsistent casing in comment * lib-writ.ads: minor align comments in columns * sem_ch3.adb: Minor reformatting. * spark_xrefs.ads: minor fix typo in SPARK-related comment * table.ads: minor style fix in comment * lib-xref-spark_specific.adb (Add_SPARK_Xrefs): simplify processing of SPARK cross-references. * sem_ch12.adb: minor whitespace fix * freeze.adb: Add comment. * sem_util.adb (Unique_Name): for instances of generic subprograms ignore the name of the wrapper package. 2017-01-19 Javier Miranda <miranda@adacore.com> * exp_aggr.adb (Resolve_Record_Aggregate): Factorize code needed for aggregates of limited and unlimited types in a new routine. (Pass_Aggregate_To_Back_End): New subprogram. 2017-01-19 Yannick Moy <moy@adacore.com> * sinfo.adb (Pragma_Name): Only access up to Last_Pair of Pragma_Map. From-SVN: r244622
Diffstat (limited to 'gcc/ada/lib-xref-spark_specific.adb')
-rw-r--r--gcc/ada/lib-xref-spark_specific.adb24
1 files changed, 8 insertions, 16 deletions
diff --git a/gcc/ada/lib-xref-spark_specific.adb b/gcc/ada/lib-xref-spark_specific.adb
index d00c4eed..8cd50af 100644
--- a/gcc/ada/lib-xref-spark_specific.adb
+++ b/gcc/ada/lib-xref-spark_specific.adb
@@ -381,7 +381,7 @@ package body SPARK_Specific is
Rnums : array (0 .. Nrefs + Nrefs_Add) of Nat;
-- This array contains numbers of references in the Xrefs table. This
-- list is sorted in output order. The extra 0'th entry is convenient
- -- for the call to sort. When we sort the table, we move the entries in
+ -- for the call to sort. When we sort the table, we move the indices in
-- Rnums around, but we do not move the original table entries.
---------------------
@@ -683,7 +683,7 @@ package body SPARK_Specific is
Col : Nat;
From_Index : Xref_Index;
Line : Nat;
- Loc : Source_Ptr;
+ Prev_Loc : Source_Ptr;
Prev_Typ : Character;
Ref_Count : Nat;
Ref_Id : Entity_Id;
@@ -701,17 +701,9 @@ package body SPARK_Specific is
end;
end loop;
- -- Set up the pointer vector for the sort
-
- for Index in 1 .. Nrefs loop
- Rnums (Index) := Index;
- end loop;
-
for Index in Drefs.First .. Drefs.Last loop
Xrefs.Append (Drefs.Table (Index));
-
- Nrefs := Nrefs + 1;
- Rnums (Nrefs) := Xrefs.Last;
+ Nrefs := Nrefs + 1;
end loop;
-- Capture the definition Sloc values. As in the case of normal cross
@@ -730,7 +722,7 @@ package body SPARK_Specific is
for Index in 1 .. Ref_Count loop
declare
- Ref : Xref_Key renames Xrefs.Table (Rnums (Index)).Key;
+ Ref : Xref_Key renames Xrefs.Table (Index).Key;
begin
if SPARK_Entities (Ekind (Ref.Ent))
@@ -745,7 +737,7 @@ package body SPARK_Specific is
and then Get_Scope_Num (Ref.Ref_Scope) /= No_Scope
then
Nrefs := Nrefs + 1;
- Rnums (Nrefs) := Rnums (Index);
+ Rnums (Nrefs) := Index;
end if;
end;
end loop;
@@ -778,7 +770,7 @@ package body SPARK_Specific is
Ref_Count := Nrefs;
Nrefs := 0;
- Loc := No_Location;
+ Prev_Loc := No_Location;
Prev_Typ := 'm';
for Index in 1 .. Ref_Count loop
@@ -786,10 +778,10 @@ package body SPARK_Specific is
Ref : Xref_Key renames Xrefs.Table (Rnums (Index)).Key;
begin
- if Ref.Loc /= Loc
+ if Ref.Loc /= Prev_Loc
or else (Prev_Typ = 'm' and then Ref.Typ = 'r')
then
- Loc := Ref.Loc;
+ Prev_Loc := Ref.Loc;
Prev_Typ := Ref.Typ;
Nrefs := Nrefs + 1;
Rnums (Nrefs) := Rnums (Index);