annotate gcc/ada/debug_a.ads @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ------------------------------------------------------------------------------
kono
parents:
diff changeset
2 -- --
kono
parents:
diff changeset
3 -- GNAT COMPILER COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- D E B U G _ A --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
9 -- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
111
kono
parents:
diff changeset
10 -- --
kono
parents:
diff changeset
11 -- GNAT is free software; you can redistribute it and/or modify it under --
kono
parents:
diff changeset
12 -- terms of the GNU General Public License as published by the Free Soft- --
kono
parents:
diff changeset
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
kono
parents:
diff changeset
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
kono
parents:
diff changeset
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
kono
parents:
diff changeset
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
kono
parents:
diff changeset
17 -- for more details. You should have received a copy of the GNU General --
kono
parents:
diff changeset
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
kono
parents:
diff changeset
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
kono
parents:
diff changeset
20 -- --
kono
parents:
diff changeset
21 -- GNAT was originally developed by the GNAT team at New York University. --
kono
parents:
diff changeset
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
kono
parents:
diff changeset
23 -- --
kono
parents:
diff changeset
24 ------------------------------------------------------------------------------
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 -- This package contains data and subprograms to support the A debug switch
kono
parents:
diff changeset
27 -- that is used to generate output showing what node is being analyzed,
kono
parents:
diff changeset
28 -- resolved, evaluated, or expanded.
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 with Types; use Types;
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 package Debug_A is
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 -- Note: the following subprograms are used in a stack like manner, with
kono
parents:
diff changeset
35 -- an exit call matching each entry call. This means that they can keep
kono
parents:
diff changeset
36 -- track of the current node being worked on, with the entry call setting
kono
parents:
diff changeset
37 -- a new value, by pushing the Node_Id value on a stack, and the exit call
kono
parents:
diff changeset
38 -- popping this value off. Atree.Current_Error_Node is set by both the
kono
parents:
diff changeset
39 -- entry and exit routines to point to the current node so that an abort
kono
parents:
diff changeset
40 -- message indicates the node involved as accurately as possible.
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 procedure Debug_A_Entry (S : String; N : Node_Id);
kono
parents:
diff changeset
43 pragma Inline (Debug_A_Entry);
kono
parents:
diff changeset
44 -- Generates a message prefixed by a sequence of bars showing the nesting
kono
parents:
diff changeset
45 -- depth (depth increases by 1 for a Debug_A_Entry call and is decreased
kono
parents:
diff changeset
46 -- by the corresponding Debug_A_Exit call). Then the string is output
kono
parents:
diff changeset
47 -- (analyzing, expanding etc), followed by the node number and its kind.
kono
parents:
diff changeset
48 -- This output is generated only if the debug A flag is set. If the debug
kono
parents:
diff changeset
49 -- A flag is not set, then no output is generated. This call also sets the
kono
parents:
diff changeset
50 -- Node_Id value in Atree.Current_Error_Node in case a bomb occurs. This
kono
parents:
diff changeset
51 -- is done unconditionally, whether or not the debug A flag is set.
kono
parents:
diff changeset
52
kono
parents:
diff changeset
53 procedure Debug_A_Exit (S : String; N : Node_Id; Comment : String);
kono
parents:
diff changeset
54 pragma Inline (Debug_A_Exit);
kono
parents:
diff changeset
55 -- Generates the corresponding termination message. The message is preceded
kono
parents:
diff changeset
56 -- by a sequence of bars, followed by the string S, the node number, and
kono
parents:
diff changeset
57 -- a trailing comment (e.g. " (already evaluated)"). This output is
kono
parents:
diff changeset
58 -- generated only if the debug A flag is set. If the debug A flag is not
kono
parents:
diff changeset
59 -- set, then no output is generated. This call also resets the value in
kono
parents:
diff changeset
60 -- Atree.Current_Error_Node to what it was before the corresponding call
kono
parents:
diff changeset
61 -- to Debug_A_Entry.
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 end Debug_A;