OSDN Git Service

* gcc.dg/attr-weakref-1.c: Add exit (0) to avoid spurious
[pf3gnuchains/gcc-fork.git] / gcc / ada / debug_a.ads
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-2002 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,  51  Franklin  Street,  Fifth  Floor, --
20 -- Boston, MA 02110-1301, USA.                                              --
21 --                                                                          --
22 -- GNAT was originally developed  by the GNAT team at  New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
24 --                                                                          --
25 ------------------------------------------------------------------------------
26
27 --  This package contains data and subprograms to support the A debug switch
28 --  that is used to generate output showing what node is being analyzed,
29 --  resolved, evaluated, or expanded.
30
31 with Types; use Types;
32
33 package Debug_A is
34
35    --  Note: the following subprograms are used in a stack like manner, with
36    --  an exit call matching each entry call. This means that they can keep
37    --  track of the current node being worked on, with the entry call setting
38    --  a new value, by pushing the Node_Id value on a stack, and the exit call
39    --  popping this value off. Atree.Current_Error_Node is set by both the
40    --  entry and exit routines to point to the current node so that an abort
41    --  message indicates the node involved as accurately as possible.
42
43    procedure Debug_A_Entry (S : String; N : Node_Id);
44    pragma Inline (Debug_A_Entry);
45    --  Generates a message prefixed by a sequence of bars showing the nesting
46    --  depth (depth increases by 1 for a Debug_A_Entry call and is decreased
47    --  by the corresponding Debug_A_Exit call). Then the string is output
48    --  (analyzing, expanding etc), followed by the node number and its kind.
49    --  This output is generated only if the debug A flag is set. If the debug
50    --  A flag is not set, then no output is generated. This call also sets the
51    --  Node_Id value in Atree.Current_Error_Node in case a bomb occurs. This
52    --  is done unconditionally, whether or not the debug A flag is set.
53
54    procedure Debug_A_Exit (S : String; N : Node_Id; Comment : String);
55    pragma Inline (Debug_A_Exit);
56    --  Generates the corresponding termination message. The message is preceded
57    --  by a sequence of bars, followed by the string S, the node number, and
58    --  a trailing comment (e.g. " (already evaluated)"). This output is
59    --  generated only if the debug A flag is set. If the debug A flag is not
60    --  set, then no output is generated. This call also resets the value in
61    --  Atree.Current_Error_Node to what it was before the corresponding call
62    --  to Debug_A_Entry.
63
64 end Debug_A;