]>
Commit | Line | Data |
---|---|---|
721de836 MM |
1 | /* Tree-dumping functionality for intermediate representation. |
2 | Copyright (C) 1999, 2000 Free Software Foundation, Inc. | |
3 | Written by Mark Mitchell <mark@codesourcery.com> | |
4 | ||
1322177d | 5 | This file is part of GCC. |
721de836 | 6 | |
1322177d LB |
7 | GCC is free software; you can redistribute it and/or modify it under |
8 | the terms of the GNU General Public License as published by the Free | |
9 | Software Foundation; either version 2, or (at your option) any later | |
10 | version. | |
721de836 | 11 | |
1322177d LB |
12 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 | for more details. | |
721de836 MM |
16 | |
17 | You should have received a copy of the GNU General Public License | |
1322177d LB |
18 | along with GCC; see the file COPYING. If not, write to the Free |
19 | Software Foundation, 59 Temple Place - Suite 330, Boston, MA | |
20 | 02111-1307, USA. */ | |
721de836 | 21 | |
88657302 RH |
22 | #ifndef GCC_C_DUMP_H |
23 | #define GCC_C_DUMP_H | |
24 | ||
721de836 MM |
25 | /* Flags used with queue functions. */ |
26 | #define DUMP_NONE 0 | |
27 | #define DUMP_BINFO 1 | |
28 | ||
29 | /* Information about a node to be dumped. */ | |
30 | ||
31 | typedef struct dump_node_info | |
32 | { | |
33 | /* The index for the node. */ | |
34 | unsigned int index; | |
35 | /* Nonzero if the node is a binfo. */ | |
36 | unsigned int binfo_p : 1; | |
37 | } *dump_node_info_p; | |
38 | ||
39 | /* A dump_queue is a link in the queue of things to be dumped. */ | |
40 | ||
41 | typedef struct dump_queue | |
42 | { | |
43 | /* The queued tree node. */ | |
44 | splay_tree_node node; | |
45 | /* The next node in the queue. */ | |
46 | struct dump_queue *next; | |
47 | } *dump_queue_p; | |
48 | ||
49 | /* A dump_info gives information about how we should perform the dump | |
50 | and about the current state of the dump. */ | |
51 | ||
52 | struct dump_info | |
53 | { | |
54 | /* The stream on which to dump the information. */ | |
55 | FILE *stream; | |
b7442fb5 NS |
56 | /* The original node. */ |
57 | tree node; | |
58 | /* User flags. */ | |
59 | int flags; | |
721de836 MM |
60 | /* The next unused node index. */ |
61 | unsigned int index; | |
62 | /* The next column. */ | |
63 | unsigned int column; | |
64 | /* The first node in the queue of nodes to be written out. */ | |
65 | dump_queue_p queue; | |
66 | /* The last node in the queue. */ | |
67 | dump_queue_p queue_end; | |
68 | /* Free queue nodes. */ | |
69 | dump_queue_p free_list; | |
70 | /* The tree nodes which we have already written out. The | |
71 | keys are the addresses of the nodes; the values are the integer | |
72 | indices we assigned them. */ | |
73 | splay_tree nodes; | |
74 | }; | |
75 | ||
76 | /* Dump the CHILD and its children. */ | |
77 | #define dump_child(field, child) \ | |
78 | queue_and_dump_index (di, field, child, DUMP_NONE) | |
79 | ||
b7442fb5 NS |
80 | extern void dump_pointer |
81 | PARAMS ((dump_info_p, const char *, void *)); | |
721de836 MM |
82 | extern void dump_int |
83 | PARAMS ((dump_info_p, const char *, int)); | |
84 | extern void dump_string | |
85 | PARAMS ((dump_info_p, const char *)); | |
86 | extern void dump_stmt | |
87 | PARAMS ((dump_info_p, tree)); | |
88 | extern void dump_next_stmt | |
89 | PARAMS ((dump_info_p, tree)); | |
90 | extern void queue_and_dump_index | |
91 | PARAMS ((dump_info_p, const char *, tree, int)); | |
92 | extern void queue_and_dump_type | |
93 | PARAMS ((dump_info_p, tree)); | |
88657302 RH |
94 | |
95 | #endif /* ! GCC_C_DUMP_H */ |