From c23f55b4932192981183ab6a3f914ef22476ec93 Mon Sep 17 00:00:00 2001 From: Pierre-Marie de Rodat Date: Thu, 9 Nov 2017 11:13:49 +0000 Subject: gnat1drv.adb (Adjust_Global_Switches): Suppress warnings in codepeer mode here unless -gnateC is specified. gcc/ada/ 2017-11-09 Arnaud Charlet * gnat1drv.adb (Adjust_Global_Switches): Suppress warnings in codepeer mode here unless -gnateC is specified. * switch-c.adb (Scan_Front_End_Switches): Do not suppress warnings with -gnatC here. 2017-11-09 Piotr Trojanek * lib-writ.adb (Write_ALI): Remove processing of the frontend xrefs as part of the ALI writing; they are now processed directly from memory when requested by the backend. * lib-xref.ads (Collect_SPARK_Xrefs): Remove. (Iterate_SPARK_Xrefs): New routine for iterating over frontend xrefs. * lib-xref-spark_specific.adb (Traverse_Compilation_Unit): Remove. (Add_SPARK_File): Remove. (Add_SPARK_Xref): Refactored from removed code; filters xref entries that are trivially uninteresting to the SPARK backend. * spark_xrefs.ads: Remove code that is no longer needed. * spark_xrefs.adb (dspark): Adapt to use Iterate_SPARK_Xrefs. 2017-11-09 Hristian Kirtchev * sem_elab.adb: Update the documentation on adding a new elaboration schenario. Add new hash table Recorded_Top_Level_Scenarios. (Is_Check_Emitting_Scenario): Removed. (Is_Recorded_Top_Level_Scenario): New routine. (Kill_Elaboration_Scenario): Reimplemented. (Record_Elaboration_Scenario): Mark the scenario as recorded. (Set_Is_Recorded_Top_Level_Scenario): New routine. (Update_Elaboration_Scenario): Reimplemented. * sinfo.adb (Is_Recorded_Scenario): Removed. (Set_Is_Recorded_Scenario): Removed. * sinfo.ads: Remove attribute Is_Recorded_Scenario along with occurrences in nodes. (Is_Recorded_Scenario): Removed along with pragma Inline. (Set_Is_Recorded_Scenario): Removed along with pragma Inline. 2017-11-09 Piotr Trojanek * sem_prag.adb (Analyze_Part_Of): Change "designate" to "denote" in error message. 2017-11-09 Justin Squirek * sem_res.adb (Resolve_Allocator): Add warning messages corresponding to the allocation of an anonymous access-to-controlled object. gcc/testsuite/ 2017-11-09 Hristian Kirtchev * gnat.dg/elab3.adb, gnat.dg/elab3.ads, gnat.dg/elab3_pkg.adb, gnat.dg/elab3_pkg.ads: New testcase. 2017-11-09 Pierre-Marie de Rodat * gnat.dg/controlled2.adb, gnat.dg/controlled4.adb, gnat.dg/finalized.adb: Disable the new warning from GNAT. From-SVN: r254568 --- gcc/ada/spark_xrefs.adb | 105 ++++++++++++++---------------------------------- 1 file changed, 31 insertions(+), 74 deletions(-) (limited to 'gcc/ada/spark_xrefs.adb') diff --git a/gcc/ada/spark_xrefs.adb b/gcc/ada/spark_xrefs.adb index cea28a6..e59114d 100644 --- a/gcc/ada/spark_xrefs.adb +++ b/gcc/ada/spark_xrefs.adb @@ -23,6 +23,7 @@ -- -- ------------------------------------------------------------------------------ +with Lib.Xref; with Output; use Output; with Sem_Util; use Sem_Util; @@ -33,92 +34,48 @@ package body SPARK_Xrefs is ------------ procedure dspark is - begin - -- Dump SPARK cross-reference file table - - Write_Line ("SPARK Xrefs File Table"); - Write_Line ("----------------------"); - - for Index in SPARK_File_Table.First .. SPARK_File_Table.Last loop - declare - AFR : SPARK_File_Record renames SPARK_File_Table.Table (Index); - - begin - Write_Str (" "); - Write_Int (Int (Index)); - Write_Str (". File_Num = "); - Write_Int (Int (AFR.File_Num)); - Write_Str (" From = "); - Write_Int (Int (AFR.From_Scope)); - Write_Str (" To = "); - Write_Int (Int (AFR.To_Scope)); - Write_Eol; - end; - end loop; - - -- Dump SPARK cross-reference scope table - Write_Eol; - Write_Line ("SPARK Xrefs Scope Table"); - Write_Line ("-----------------------"); + procedure Dump (Index : Nat; AXR : SPARK_Xref_Record); + + procedure Dump_SPARK_Xrefs is new + Lib.Xref.SPARK_Specific.Iterate_SPARK_Xrefs (Dump); + + ---------- + -- Dump -- + ---------- + + procedure Dump (Index : Nat; AXR : SPARK_Xref_Record) is + begin + Write_Str (" "); + Write_Int (Index); + Write_Char ('.'); + + Write_Str (" Entity = " & Unique_Name (AXR.Entity)); + Write_Str (" ("); + Write_Int (Nat (AXR.Entity)); + Write_Str (")"); - for Index in SPARK_Scope_Table.First .. SPARK_Scope_Table.Last loop - declare - ASR : SPARK_Scope_Record renames SPARK_Scope_Table.Table (Index); + Write_Str (" Scope = " & Unique_Name (AXR.Ref_Scope)); + Write_Str (" ("); + Write_Int (Nat (AXR.Ref_Scope)); + Write_Str (")"); - begin - Write_Str (" "); - Write_Int (Int (Index)); - Write_Str (" Scope_Name = """); + Write_Str (" Ref_Type = '" & AXR.Rtype & "'"); - Write_Str (Unique_Name (ASR.Entity)); + Write_Eol; + end Dump; - Write_Char ('"'); - Write_Str (" From = "); - Write_Int (Int (ASR.From_Xref)); - Write_Str (" To = "); - Write_Int (Int (ASR.To_Xref)); - Write_Eol; - end; - end loop; + -- Start of processing for dspark + begin -- Dump SPARK cross-reference table Write_Eol; Write_Line ("SPARK Xref Table"); Write_Line ("----------------"); - for Index in SPARK_Xref_Table.First .. SPARK_Xref_Table.Last loop - declare - AXR : SPARK_Xref_Record renames SPARK_Xref_Table.Table (Index); - - begin - Write_Str (" "); - Write_Int (Int (Index)); - Write_Str (". Entity_Name = """); - - Write_Str (Unique_Name (AXR.Entity)); - - Write_Char ('"'); - Write_Str (" Reference_Scope = "); - Write_Str (Unique_Name (AXR.Ref_Scope)); - Write_Char ('"'); - Write_Str (" Type = "); - Write_Char (AXR.Rtype); - Write_Eol; - end; - end loop; - end dspark; - - ---------------- - -- Initialize -- - ---------------- + Dump_SPARK_Xrefs; - procedure Initialize_SPARK_Tables is - begin - SPARK_File_Table.Init; - SPARK_Scope_Table.Init; - SPARK_Xref_Table.Init; - end Initialize_SPARK_Tables; + end dspark; end SPARK_Xrefs; -- cgit v1.1