aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2000-11-10 16:29:34 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2000-11-10 16:29:34 +0000
commit721de8363b9ab36eaf7a7cecc341d04871f3d57a (patch)
tree1cf026a0e8877c427bccb133ca69d6b0e09c1a79
parent4e135bdd14d2035632e78008730027c4ef82aa7a (diff)
downloadgcc-721de8363b9ab36eaf7a7cecc341d04871f3d57a.zip
gcc-721de8363b9ab36eaf7a7cecc341d04871f3d57a.tar.gz
gcc-721de8363b9ab36eaf7a7cecc341d04871f3d57a.tar.bz2
* c-dump.h: New file.
From-SVN: r37368
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/c-dump.h84
2 files changed, 88 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 896a2dd..5cc14f3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2000-11-10 Mark Mitchell <mark@codesourcery.com>
+
+ * c-dump.h: New file.
+
2000-11-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* alpha.c (check_float_value): Use memcpy, not bcopy.
diff --git a/gcc/c-dump.h b/gcc/c-dump.h
new file mode 100644
index 0000000..bb246ce
--- /dev/null
+++ b/gcc/c-dump.h
@@ -0,0 +1,84 @@
+/* Tree-dumping functionality for intermediate representation.
+ Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+ Written by Mark Mitchell <mark@codesourcery.com>
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* Flags used with queue functions. */
+#define DUMP_NONE 0
+#define DUMP_BINFO 1
+
+/* Information about a node to be dumped. */
+
+typedef struct dump_node_info
+{
+ /* The index for the node. */
+ unsigned int index;
+ /* Nonzero if the node is a binfo. */
+ unsigned int binfo_p : 1;
+} *dump_node_info_p;
+
+/* A dump_queue is a link in the queue of things to be dumped. */
+
+typedef struct dump_queue
+{
+ /* The queued tree node. */
+ splay_tree_node node;
+ /* The next node in the queue. */
+ struct dump_queue *next;
+} *dump_queue_p;
+
+/* A dump_info gives information about how we should perform the dump
+ and about the current state of the dump. */
+
+struct dump_info
+{
+ /* The stream on which to dump the information. */
+ FILE *stream;
+ /* The next unused node index. */
+ unsigned int index;
+ /* The next column. */
+ unsigned int column;
+ /* The first node in the queue of nodes to be written out. */
+ dump_queue_p queue;
+ /* The last node in the queue. */
+ dump_queue_p queue_end;
+ /* Free queue nodes. */
+ dump_queue_p free_list;
+ /* The tree nodes which we have already written out. The
+ keys are the addresses of the nodes; the values are the integer
+ indices we assigned them. */
+ splay_tree nodes;
+};
+
+/* Dump the CHILD and its children. */
+#define dump_child(field, child) \
+ queue_and_dump_index (di, field, child, DUMP_NONE)
+
+extern void dump_int
+ PARAMS ((dump_info_p, const char *, int));
+extern void dump_string
+ PARAMS ((dump_info_p, const char *));
+extern void dump_stmt
+ PARAMS ((dump_info_p, tree));
+extern void dump_next_stmt
+ PARAMS ((dump_info_p, tree));
+extern void queue_and_dump_index
+ PARAMS ((dump_info_p, const char *, tree, int));
+extern void queue_and_dump_type
+ PARAMS ((dump_info_p, tree));