* config/i386/uwin.h: Remove SUBTARGET_PROLOGUE.
[official-gcc.git] / gcc / ada / lib-list.adb
blobccc667ea499310d593f5df2e721426390a2309e9
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- L I B . L I S T --
6 -- --
7 -- B o d y --
8 -- --
9 -- Copyright (C) 1992-1999 Free Software Foundation, Inc. --
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 2, 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 COPYING. If not, write --
19 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
21 -- --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
28 -- --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
31 -- --
32 ------------------------------------------------------------------------------
34 with Output; use Output;
36 separate (Lib)
37 procedure List (File_Names_Only : Boolean := False) is
39 Num_Units : constant Nat := Int (Units.Last) - Int (Units.First) + 1;
40 -- Number of units in file table
42 Sorted_Units : Unit_Ref_Table (1 .. Num_Units);
43 -- Table of unit numbers that we will sort
45 Unit_Node : Node_Id;
46 -- Compilation unit node for current unit
48 Unit_Hed : constant String := "Unit name ";
49 Unit_Und : constant String := "--------- ";
50 Unit_Bln : constant String := " ";
51 File_Hed : constant String := "File name ";
52 File_Und : constant String := "--------- ";
53 File_Bln : constant String := " ";
54 Time_Hed : constant String := "Time stamp";
55 Time_Und : constant String := "----------";
57 Unit_Length : constant Natural := Unit_Hed'Length;
58 File_Length : constant Natural := File_Hed'Length;
60 begin
61 -- First step is to make a sorted table of units
63 for J in 1 .. Num_Units loop
64 Sorted_Units (J) := Unit_Number_Type (Int (Units.First) + J - 1);
65 end loop;
67 Sort (Sorted_Units);
69 -- Now we can generate the unit table listing
71 Write_Eol;
73 if not File_Names_Only then
74 Write_Str (Unit_Hed);
75 Write_Str (File_Hed);
76 Write_Str (Time_Hed);
77 Write_Eol;
79 Write_Str (Unit_Und);
80 Write_Str (File_Und);
81 Write_Str (Time_Und);
82 Write_Eol;
83 Write_Eol;
84 end if;
86 for R in Sorted_Units'Range loop
87 Unit_Node := Cunit (Sorted_Units (R));
89 if File_Names_Only then
90 if not Is_Internal_File_Name
91 (File_Name (Source_Index (Sorted_Units (R))))
92 then
93 Write_Name (Full_File_Name (Source_Index (Sorted_Units (R))));
94 Write_Eol;
95 end if;
97 else
98 Write_Unit_Name (Unit_Name (Sorted_Units (R)));
100 if Name_Len > (Unit_Length - 1) then
101 Write_Eol;
102 Write_Str (Unit_Bln);
103 else
104 for J in Name_Len + 1 .. Unit_Length loop
105 Write_Char (' ');
106 end loop;
107 end if;
109 Write_Name (Full_File_Name (Source_Index (Sorted_Units (R))));
111 if Name_Len > (File_Length - 1) then
112 Write_Eol;
113 Write_Str (Unit_Bln);
114 Write_Str (File_Bln);
115 else
116 for J in Name_Len + 1 .. File_Length loop
117 Write_Char (' ');
118 end loop;
119 end if;
121 Write_Str (String (Time_Stamp (Source_Index (Sorted_Units (R)))));
122 Write_Eol;
123 end if;
124 end loop;
126 Write_Eol;
127 end List;