2018-08-29 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / ada / debug_a.ads
blobe884121e9ae2e21760bb5947394e9dcbd85cbbe5
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- D E B U G _ A --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 1992-2018, 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 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 ------------------------------------------------------------------------------
26 -- This package contains data and subprograms to support the A debug switch
27 -- that is used to generate output showing what node is being analyzed,
28 -- resolved, evaluated, or expanded.
30 with Types; use Types;
32 package Debug_A is
34 -- Note: the following subprograms are used in a stack like manner, with
35 -- an exit call matching each entry call. This means that they can keep
36 -- track of the current node being worked on, with the entry call setting
37 -- a new value, by pushing the Node_Id value on a stack, and the exit call
38 -- popping this value off. Atree.Current_Error_Node is set by both the
39 -- entry and exit routines to point to the current node so that an abort
40 -- message indicates the node involved as accurately as possible.
42 procedure Debug_A_Entry (S : String; N : Node_Id);
43 pragma Inline (Debug_A_Entry);
44 -- Generates a message prefixed by a sequence of bars showing the nesting
45 -- depth (depth increases by 1 for a Debug_A_Entry call and is decreased
46 -- by the corresponding Debug_A_Exit call). Then the string is output
47 -- (analyzing, expanding etc), followed by the node number and its kind.
48 -- This output is generated only if the debug A flag is set. If the debug
49 -- A flag is not set, then no output is generated. This call also sets the
50 -- Node_Id value in Atree.Current_Error_Node in case a bomb occurs. This
51 -- is done unconditionally, whether or not the debug A flag is set.
53 procedure Debug_A_Exit (S : String; N : Node_Id; Comment : String);
54 pragma Inline (Debug_A_Exit);
55 -- Generates the corresponding termination message. The message is preceded
56 -- by a sequence of bars, followed by the string S, the node number, and
57 -- a trailing comment (e.g. " (already evaluated)"). This output is
58 -- generated only if the debug A flag is set. If the debug A flag is not
59 -- set, then no output is generated. This call also resets the value in
60 -- Atree.Current_Error_Node to what it was before the corresponding call
61 -- to Debug_A_Entry.
63 end Debug_A;