]>
Commit | Line | Data |
---|---|---|
74338ff6 | 1 | /* Tree-dumping functionality for intermediate representation. |
fbd26352 | 2 | Copyright (C) 1999-2019 Free Software Foundation, Inc. |
74338ff6 | 3 | Written by Mark Mitchell <mark@codesourcery.com> |
4 | ||
5 | This file is part of GCC. | |
6 | ||
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 | |
8c4c00c1 | 9 | Software Foundation; either version 3, or (at your option) any later |
74338ff6 | 10 | version. |
11 | ||
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. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
8c4c00c1 | 18 | along with GCC; see the file COPYING3. If not see |
19 | <http://www.gnu.org/licenses/>. */ | |
74338ff6 | 20 | |
3119c950 | 21 | #ifndef GCC_TREE_DUMP_H |
22 | #define GCC_TREE_DUMP_H | |
74338ff6 | 23 | |
4ee9c684 | 24 | #include "splay-tree.h" |
b9ed1410 | 25 | #include "dumpfile.h" |
77fce4cd | 26 | |
27 | typedef struct dump_info *dump_info_p; | |
4ee9c684 | 28 | |
74338ff6 | 29 | /* Flags used with queue functions. */ |
30 | #define DUMP_NONE 0 | |
31 | #define DUMP_BINFO 1 | |
32 | ||
33 | /* Information about a node to be dumped. */ | |
34 | ||
35 | typedef struct dump_node_info | |
36 | { | |
37 | /* The index for the node. */ | |
38 | unsigned int index; | |
39 | /* Nonzero if the node is a binfo. */ | |
40 | unsigned int binfo_p : 1; | |
41 | } *dump_node_info_p; | |
42 | ||
43 | /* A dump_queue is a link in the queue of things to be dumped. */ | |
44 | ||
45 | typedef struct dump_queue | |
46 | { | |
47 | /* The queued tree node. */ | |
48 | splay_tree_node node; | |
49 | /* The next node in the queue. */ | |
50 | struct dump_queue *next; | |
51 | } *dump_queue_p; | |
52 | ||
6c34d0c2 | 53 | /* A dump_info gives information about how we should perform the dump |
74338ff6 | 54 | and about the current state of the dump. */ |
55 | ||
56 | struct dump_info | |
57 | { | |
58 | /* The stream on which to dump the information. */ | |
59 | FILE *stream; | |
60 | /* The original node. */ | |
9f627b1a | 61 | const_tree node; |
74338ff6 | 62 | /* User flags. */ |
3f6e5ced | 63 | dump_flags_t flags; |
74338ff6 | 64 | /* The next unused node index. */ |
65 | unsigned int index; | |
66 | /* The next column. */ | |
67 | unsigned int column; | |
68 | /* The first node in the queue of nodes to be written out. */ | |
69 | dump_queue_p queue; | |
70 | /* The last node in the queue. */ | |
71 | dump_queue_p queue_end; | |
72 | /* Free queue nodes. */ | |
73 | dump_queue_p free_list; | |
6c34d0c2 | 74 | /* The tree nodes which we have already written out. The |
74338ff6 | 75 | keys are the addresses of the nodes; the values are the integer |
76 | indices we assigned them. */ | |
77 | splay_tree nodes; | |
78 | }; | |
79 | ||
80 | /* Dump the CHILD and its children. */ | |
81 | #define dump_child(field, child) \ | |
82 | queue_and_dump_index (di, field, child, DUMP_NONE) | |
83 | ||
d598ad0d | 84 | extern void dump_pointer (dump_info_p, const char *, void *); |
85 | extern void dump_int (dump_info_p, const char *, int); | |
86 | extern void dump_string (dump_info_p, const char *); | |
5a471c32 | 87 | extern void dump_string_field (dump_info_p, const char *, const char *); |
9f627b1a | 88 | extern void queue_and_dump_index (dump_info_p, const char *, const_tree, int); |
89 | extern void queue_and_dump_type (dump_info_p, const_tree); | |
3f6e5ced | 90 | extern int dump_flag (dump_info_p, dump_flags_t, const_tree); |
4ee9c684 | 91 | |
3119c950 | 92 | #endif /* ! GCC_TREE_DUMP_H */ |