111
|
1 ------------------------------------------------------------------------------
|
|
2 -- --
|
|
3 -- GNAT COMPILER COMPONENTS --
|
|
4 -- --
|
|
5 -- S P A R K _ X R E F S --
|
|
6 -- --
|
|
7 -- B o d y --
|
|
8 -- --
|
145
|
9 -- Copyright (C) 2011-2019, Free Software Foundation, Inc. --
|
111
|
10 -- --
|
|
11 -- GNAT is free software; you can redistribute it and/or modify it under --
|
|
12 -- terms of the GNU General Public License as published by the Free Soft- --
|
|
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
|
|
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
|
|
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
|
|
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
|
|
17 -- for more details. You should have received a copy of the GNU General --
|
|
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
|
|
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
|
|
20 -- --
|
|
21 -- GNAT was originally developed by the GNAT team at New York University. --
|
|
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
|
|
23 -- --
|
|
24 ------------------------------------------------------------------------------
|
|
25
|
131
|
26 with Lib.Xref;
|
|
27 with Output; use Output;
|
|
28 with Sem_Util; use Sem_Util;
|
111
|
29
|
|
30 package body SPARK_Xrefs is
|
|
31
|
|
32 ------------
|
|
33 -- dspark --
|
|
34 ------------
|
|
35
|
|
36 procedure dspark is
|
131
|
37
|
|
38 procedure Dump (Index : Nat; AXR : SPARK_Xref_Record);
|
111
|
39
|
131
|
40 procedure Dump_SPARK_Xrefs is new
|
|
41 Lib.Xref.SPARK_Specific.Iterate_SPARK_Xrefs (Dump);
|
111
|
42
|
131
|
43 ----------
|
|
44 -- Dump --
|
|
45 ----------
|
111
|
46
|
131
|
47 procedure Dump (Index : Nat; AXR : SPARK_Xref_Record) is
|
|
48 begin
|
|
49 Write_Str (" ");
|
|
50 Write_Int (Index);
|
|
51 Write_Char ('.');
|
111
|
52
|
131
|
53 Write_Str (" Entity = " & Unique_Name (AXR.Entity));
|
|
54 Write_Str (" (");
|
|
55 Write_Int (Nat (AXR.Entity));
|
|
56 Write_Str (")");
|
111
|
57
|
131
|
58 Write_Str (" Scope = " & Unique_Name (AXR.Ref_Scope));
|
|
59 Write_Str (" (");
|
|
60 Write_Int (Nat (AXR.Ref_Scope));
|
|
61 Write_Str (")");
|
|
62
|
|
63 Write_Str (" Ref_Type = '" & AXR.Rtype & "'");
|
111
|
64
|
131
|
65 Write_Eol;
|
|
66 end Dump;
|
111
|
67
|
131
|
68 -- Start of processing for dspark
|
|
69
|
|
70 begin
|
111
|
71 -- Dump SPARK cross-reference table
|
|
72
|
|
73 Write_Eol;
|
|
74 Write_Line ("SPARK Xref Table");
|
|
75 Write_Line ("----------------");
|
|
76
|
131
|
77 Dump_SPARK_Xrefs;
|
111
|
78
|
|
79 end dspark;
|
|
80
|
|
81 end SPARK_Xrefs;
|