aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@gcc.gnu.org>2003-01-10 02:22:34 +0000
committerGeoffrey Keating <geoffk@gcc.gnu.org>2003-01-10 02:22:34 +0000
commit17211ab55314d76370a68036f2d057b1effd687f (patch)
treea3ff2e89f1924fd7ea1d99358736bc8491352747 /include
parent5f7c78d8a4df096dacfa2d9de367a6174dd631ba (diff)
downloadgcc-17211ab55314d76370a68036f2d057b1effd687f.zip
gcc-17211ab55314d76370a68036f2d057b1effd687f.tar.gz
gcc-17211ab55314d76370a68036f2d057b1effd687f.tar.bz2
Merge from pch-branch.
From-SVN: r61136
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog8
-rw-r--r--include/splay-tree.h25
2 files changed, 23 insertions, 10 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index f6b05bb..9318821 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,11 @@
+2002-07-17 Geoffrey Keating <geoffk@redhat.com>
+
+ * splay-tree.h (GTY): Define if undefined.
+ (splay_tree_allocate_fn): Return PTR for compatibility, not void *.
+ (struct splay_tree_node_s): Support gengtype.
+ (struct splay_tree_s): Likewise. Make allocate_data a PTR,
+ not a void *.
+
2002-11-23 Simon Burge <simonb@wasabisystems.com>
* libiberty.h (basename): Add NetBSD to the list.
diff --git a/include/splay-tree.h b/include/splay-tree.h
index 23f7ac6..86707fc 100644
--- a/include/splay-tree.h
+++ b/include/splay-tree.h
@@ -36,6 +36,10 @@ extern "C" {
#include "ansidecl.h"
+#ifndef GTY
+#define GTY(X)
+#endif
+
/* Use typedefs for the key and data types to facilitate changing
these types, if necessary. These types should be sufficiently wide
that any pointer or scalar can be cast to these types, and then
@@ -65,7 +69,7 @@ typedef int (*splay_tree_foreach_fn) PARAMS((splay_tree_node, void*));
node structures. The first argument is the number of bytes needed;
the second is a data pointer the splay tree functions pass through
to the allocator. This function must never return zero. */
-typedef void *(*splay_tree_allocate_fn) PARAMS((int, void *));
+typedef PTR (*splay_tree_allocate_fn) PARAMS((int, void *));
/* The type of a function used to free memory allocated using the
corresponding splay_tree_allocate_fn. The first argument is the
@@ -74,24 +78,24 @@ typedef void *(*splay_tree_allocate_fn) PARAMS((int, void *));
typedef void (*splay_tree_deallocate_fn) PARAMS((void *, void *));
/* The nodes in the splay tree. */
-struct splay_tree_node_s
+struct splay_tree_node_s GTY(())
{
/* The key. */
- splay_tree_key key;
+ splay_tree_key GTY ((use_param1 (""))) key;
/* The value. */
- splay_tree_value value;
+ splay_tree_value GTY ((use_param2 (""))) value;
/* The left and right children, respectively. */
- splay_tree_node left;
- splay_tree_node right;
+ splay_tree_node GTY ((use_params (""))) left;
+ splay_tree_node GTY ((use_params (""))) right;
};
/* The splay tree itself. */
-typedef struct splay_tree_s
+struct splay_tree_s GTY(())
{
/* The root of the tree. */
- splay_tree_node root;
+ splay_tree_node GTY ((use_params (""))) root;
/* The comparision function. */
splay_tree_compare_fn comp;
@@ -105,9 +109,10 @@ typedef struct splay_tree_s
/* Allocate/free functions, and a data pointer to pass to them. */
splay_tree_allocate_fn allocate;
splay_tree_deallocate_fn deallocate;
- void *allocate_data;
+ PTR GTY((skip (""))) allocate_data;
-} *splay_tree;
+};
+typedef struct splay_tree_s *splay_tree;
extern splay_tree splay_tree_new PARAMS((splay_tree_compare_fn,
splay_tree_delete_key_fn,