1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
5 -- B I N D O . W R I T E R S --
9 -- Copyright (C) 2019-2023, Free Software Foundation, Inc. --
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. --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 ------------------------------------------------------------------------------
26 -- For full architecture, see unit Bindo.
28 -- The following unit contains facilities to output the various graphs used in
29 -- determining the elaboration order, as well as the elaboration order itself
30 -- to standard output.
32 with Types
; use Types
;
36 use Bindo
.Graphs
.Invocation_Graphs
;
37 use Bindo
.Graphs
.Library_Graphs
;
39 package Bindo
.Writers
is
45 -- The following type defines the level of indentation used in various
48 type Indentation_Level
is new Natural;
49 No_Indentation
: constant Indentation_Level
:= Indentation_Level
'First;
51 Nested_Indentation
: constant Indentation_Level
:= 2;
52 -- The level of indentation for a nested new line
54 Number_Column
: constant Indentation_Level
:= 6;
55 -- The level of right justification of numbers
57 Step_Column
: constant Indentation_Level
:= 4;
58 -- The level of right justification of the elaboration order step
60 procedure Indent_By
(Indent
: Indentation_Level
);
61 pragma Inline
(Indent_By
);
62 -- Indent the current line by Indent spaces
66 Val_Indent
: Indentation_Level
:= Number_Column
);
67 pragma Inline
(Write_Num
);
68 -- Output integer value Val in a right-justified form based on the value of
75 package ALI_Writers
is
76 procedure Write_ALI_Tables
;
77 -- Write the contents of the following tables to standard output:
79 -- * ALI.Invocation_Constructs
80 -- * ALI.Invocation_Relations
88 package Cycle_Writers
is
89 procedure Write_Cycles
(G
: Library_Graph
);
90 -- Write all cycles of library graph G to standard output
94 ------------------------
95 -- Dependency_Writers --
96 ------------------------
98 package Dependency_Writers
is
99 procedure Write_Dependencies
(G
: Library_Graph
);
100 -- Write all elaboration dependencies of the units represented by
101 -- vertices of library graph G.
103 end Dependency_Writers
;
105 -------------------------------
106 -- Elaboration_Order_Writers --
107 -------------------------------
109 package Elaboration_Order_Writers
is
110 procedure Write_Elaboration_Order
(Order
: Unit_Id_Table
);
111 -- Write elaboration order Order to standard output
113 end Elaboration_Order_Writers
;
115 ------------------------------
116 -- Invocation_Graph_Writers --
117 ------------------------------
119 package Invocation_Graph_Writers
is
120 procedure Write_Invocation_Graph
(G
: Invocation_Graph
);
121 -- Write invocation graph G to standard output
123 end Invocation_Graph_Writers
;
125 ---------------------------
126 -- Library_Graph_Writers --
127 ---------------------------
129 package Library_Graph_Writers
is
130 procedure Write_Library_Graph
(G
: Library_Graph
);
131 -- Write library graph G to standard output
133 end Library_Graph_Writers
;
139 package Phase_Writers
is
140 procedure End_Phase
(Phase
: Elaboration_Phase
);
141 pragma Inline
(End_Phase
);
142 -- Write the end message associated with elaboration phase Phase to
145 procedure Start_Phase
(Phase
: Elaboration_Phase
);
146 pragma Inline
(Start_Phase
);
147 -- Write the start message associated with elaboration phase Phase to
152 --------------------------
153 -- Unit_Closure_Writers --
154 --------------------------
156 package Unit_Closure_Writers
is
157 procedure Write_Unit_Closure
(Order
: Unit_Id_Table
);
158 -- Write all sources in the closure of the main unit as enumerated in
159 -- elaboration order Order.
161 end Unit_Closure_Writers
;