spark_xrefs.ads (Scope_Num): type refined to positive integers.

2016-06-22  Arnaud Charlet  <charlet@adacore.com>

	* spark_xrefs.ads (Scope_Num): type refined to positive integers.
	* lib-xref-spark_specific.adb (Detect_And_Add_SPARK_Scope):
	moved into scope of Collect_SPARK_Xrefs.
	(Add_SPARK_Scope): moved into scope of Collect_SPARK_Xrefs;
	now uses Dspec and Scope_Id from Collect_SPARK_Xrefs.
	(Collect_SPARK_Xrefs): refactored to avoid retraversing the list
	of scopes.
	(Traverse_Compilation_Unit): refactored as a generic procedure.
	* types.ads (Unit_Number_Type): range refined.

From-SVN: r237690
This commit is contained in:
Arnaud Charlet 2016-06-22 10:31:47 +00:00 committed by Arnaud Charlet
parent 71b235999d
commit 7ffbef9966
5 changed files with 472 additions and 510 deletions

View File

@ -1,3 +1,15 @@
2016-06-22 Arnaud Charlet <charlet@adacore.com>
* spark_xrefs.ads (Scope_Num): type refined to positive integers.
* lib-xref-spark_specific.adb (Detect_And_Add_SPARK_Scope):
moved into scope of Collect_SPARK_Xrefs.
(Add_SPARK_Scope): moved into scope of Collect_SPARK_Xrefs;
now uses Dspec and Scope_Id from Collect_SPARK_Xrefs.
(Collect_SPARK_Xrefs): refactored to avoid retraversing the list
of scopes.
(Traverse_Compilation_Unit): refactored as a generic procedure.
* types.ads (Unit_Number_Type): range refined.
2016-06-22 Hristian Kirtchev <kirtchev@adacore.com>
* lib-xref-spark_specific.adb, a-cuprqu.ads, sem_ch6.adb: Minor

File diff suppressed because it is too large Load Diff

View File

@ -639,16 +639,6 @@ package Lib.Xref is
-- This procedure is called to record a dereference. N is the location
-- of the dereference.
type Node_Processing is access procedure (N : Node_Id);
procedure Traverse_Compilation_Unit
(CU : Node_Id;
Process : Node_Processing;
Inside_Stubs : Boolean);
-- Call Process on all declarations in compilation unit CU. If
-- Inside_Stubs is True, then the body of stubs is also traversed.
-- Generic declarations are ignored.
procedure Collect_SPARK_Xrefs
(Sdep_Table : Unit_Ref_Table;
Num_Sdep : Nat);

View File

@ -285,7 +285,7 @@ package SPARK_Xrefs is
File_Num : Nat;
-- Set to the file dependency number for the scope
Scope_Num : Nat;
Scope_Num : Pos;
-- Set to the scope number for the scope
Spec_File_Num : Nat;

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@ -554,7 +554,7 @@ package Types is
-- Types used for Library Management --
---------------------------------------
type Unit_Number_Type is new Int;
type Unit_Number_Type is new Int range -1 .. Int'Last;
-- Unit number. The main source is unit 0, and subsidiary sources have
-- non-zero numbers starting with 1. Unit numbers are used to index the
-- Units table in package Lib.