GCC Middle and Back End API Reference
tree-dump.h
Go to the documentation of this file.
1/* Tree-dumping functionality for intermediate representation.
2 Copyright (C) 1999-2024 Free Software Foundation, Inc.
3 Written by Mark Mitchell <mark@codesourcery.com>
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 3, or (at your option) any later
10version.
11
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
20
21#ifndef GCC_TREE_DUMP_H
22#define GCC_TREE_DUMP_H
23
24#include "splay-tree.h"
25#include "dumpfile.h"
26
27typedef struct dump_info *dump_info_p;
28
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
35typedef 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;
42
43/* A dump_queue is a link in the queue of things to be dumped. */
44
45typedef struct dump_queue
46{
47 /* The queued tree node. */
49 /* The next node in the queue. */
52
53/* A dump_info gives information about how we should perform the dump
54 and about the current state of the dump. */
55
57{
58 /* The stream on which to dump the information. */
60 /* The original node. */
62 /* User flags. */
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. */
70 /* The last node in the queue. */
72 /* Free queue nodes. */
74 /* The tree nodes which we have already written out. The
75 keys are the addresses of the nodes; the values are the integer
76 indices we assigned them. */
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
84extern void dump_pointer (dump_info_p, const char *, void *);
85extern void dump_int (dump_info_p, const char *, int);
86extern void dump_string (dump_info_p, const char *);
87extern void dump_string_field (dump_info_p, const char *, const char *);
88extern void queue_and_dump_index (dump_info_p, const char *, const_tree, int);
91
92#endif /* ! GCC_TREE_DUMP_H */
Definition splay-tree-utils.h:147
Definition splay-tree-utils.h:366
const union tree_node * const_tree
Definition coretypes.h:98
dump_flag
Definition dumpfile.h:78
enum dump_flag dump_flags_t
Definition dumpfile.h:209
T * ggc_alloc(ALONE_CXX_MEM_STAT_INFO)
Definition ggc.h:184
Definition tree-dump.h:57
FILE * stream
Definition tree-dump.h:59
const_tree node
Definition tree-dump.h:61
dump_queue_p queue_end
Definition tree-dump.h:71
unsigned int column
Definition tree-dump.h:67
splay_tree nodes
Definition tree-dump.h:77
unsigned int index
Definition tree-dump.h:65
dump_queue_p free_list
Definition tree-dump.h:73
dump_flags_t flags
Definition tree-dump.h:63
dump_queue_p queue
Definition tree-dump.h:69
Definition tree-dump.h:36
unsigned int index
Definition tree-dump.h:38
unsigned int binfo_p
Definition tree-dump.h:40
Definition tree-dump.h:46
splay_tree_node node
Definition tree-dump.h:48
struct dump_queue * next
Definition tree-dump.h:50
void queue_and_dump_type(dump_info_p, const_tree)
Definition tree-dump.cc:117
struct dump_queue * dump_queue_p
void dump_string(dump_info_p, const char *)
Definition tree-dump.cc:204
struct dump_node_info * dump_node_info_p
void dump_pointer(dump_info_p, const char *, void *)
Definition tree-dump.cc:158
void dump_int(dump_info_p, const char *, int)
Definition tree-dump.cc:169
struct dump_info * dump_info_p
Definition tree-dump.h:27
void queue_and_dump_index(dump_info_p, const char *, const_tree, int)
Definition tree-dump.cc:89
void dump_string_field(dump_info_p, const char *, const char *)
Definition tree-dump.cc:217