From 4f94fa1186d071b2f4b5d864acb4b0427cb63368 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Thu, 19 Jan 2017 12:55:21 +0100 Subject: [multiple changes] 2017-01-19 Javier Miranda * 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 * 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 * 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 * 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 * sinfo.adb (Pragma_Name): Only access up to Last_Pair of Pragma_Map. From-SVN: r244622 --- gcc/ada/lib-xref-spark_specific.adb | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'gcc/ada/lib-xref-spark_specific.adb') 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); -- cgit v1.1