00001 /* Tree-dumping functionality for intermediate representation. 00002 Copyright (C) 1999, 2000 Free Software Foundation, Inc. 00003 Written by Mark Mitchell <mark@codesourcery.com> 00004 00005 This file is part of GCC. 00006 00007 GCC is free software; you can redistribute it and/or modify it under 00008 the terms of the GNU General Public License as published by the Free 00009 Software Foundation; either version 2, or (at your option) any later 00010 version. 00011 00012 GCC is distributed in the hope that it will be useful, but WITHOUT ANY 00013 WARRANTY; without even the implied warranty of MERCHANTABILITY or 00014 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00015 for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with GCC; see the file COPYING. If not, write to the Free 00019 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 00020 02111-1307, USA. */ 00021 00022 #ifndef GCC_TREE_DUMP_H 00023 #define GCC_TREE_DUMP_H 00024 00025 /* Flags used with queue functions. */ 00026 #define DUMP_NONE 0 00027 #define DUMP_BINFO 1 00028 00029 /* Information about a node to be dumped. */ 00030 00031 typedef struct dump_node_info 00032 { 00033 /* The index for the node. */ 00034 unsigned int index; 00035 /* Nonzero if the node is a binfo. */ 00036 unsigned int binfo_p : 1; 00037 } *dump_node_info_p; 00038 00039 /* A dump_queue is a link in the queue of things to be dumped. */ 00040 00041 typedef struct dump_queue 00042 { 00043 /* The queued tree node. */ 00044 splay_tree_node node; 00045 /* The next node in the queue. */ 00046 struct dump_queue *next; 00047 } *dump_queue_p; 00048 00049 /* A dump_info gives information about how we should perform the dump 00050 and about the current state of the dump. */ 00051 00052 struct dump_info 00053 { 00054 /* The stream on which to dump the information. */ 00055 FILE *stream; 00056 /* The original node. */ 00057 tree node; 00058 /* User flags. */ 00059 int flags; 00060 /* The next unused node index. */ 00061 unsigned int index; 00062 /* The next column. */ 00063 unsigned int column; 00064 /* The first node in the queue of nodes to be written out. */ 00065 dump_queue_p queue; 00066 /* The last node in the queue. */ 00067 dump_queue_p queue_end; 00068 /* Free queue nodes. */ 00069 dump_queue_p free_list; 00070 /* The tree nodes which we have already written out. The 00071 keys are the addresses of the nodes; the values are the integer 00072 indices we assigned them. */ 00073 splay_tree nodes; 00074 }; 00075 00076 /* Dump the CHILD and its children. */ 00077 #define dump_child(field, child) \ 00078 queue_and_dump_index (di, field, child, DUMP_NONE) 00079 00080 extern void dump_pointer 00081 PARAMS ((dump_info_p, const char *, void *)); 00082 extern void dump_int 00083 PARAMS ((dump_info_p, const char *, int)); 00084 extern void dump_string 00085 PARAMS ((dump_info_p, const char *)); 00086 extern void dump_stmt 00087 PARAMS ((dump_info_p, tree)); 00088 extern void dump_next_stmt 00089 PARAMS ((dump_info_p, tree)); 00090 extern void queue_and_dump_index 00091 PARAMS ((dump_info_p, const char *, tree, int)); 00092 extern void queue_and_dump_type 00093 PARAMS ((dump_info_p, tree)); 00094 00095 #endif /* ! GCC_TREE_DUMP_H */
1.5.6