From 585b44d301a56eb7c2e40e840c6c9868f6b92d46 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Thu, 16 Sep 2004 09:53:40 +0000 Subject: cp-tree.h (struct lang_type_class): Make pure_virtuals a VEC(tree). * cp-tree.h (struct lang_type_class): Make pure_virtuals a VEC(tree). (CLASSTYPE_INLINE_FRIENDS, CLASSTYPE_PURE_VIRTUALS): Update comments. * call.c (build_new_method_call): Don't confirm a pure virtual is in CLASSTYPE_PURE_VIRTUALS. Reorder checks. Make it a warning. * class.c (check_methods): CLASSTYPE_INLINE_FRIENDS is a VEC(tree). (fixup_inline_methods, finish_struct): Likewise. * decl.c (finish_method): Likewise. * search.c (dfs_get_pure_virtuals, get_pure_virtuals): CLASSTYPE_PURE_VIRTUALS is a VEC(tree). * typeck2.c (abstract_virtuals_error): Likewise. Truncate the vector to avoid repeating the list in error messages. From-SVN: r87592 --- gcc/cp/search.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'gcc/cp/search.c') diff --git a/gcc/cp/search.c b/gcc/cp/search.c index f547e6c..c68fc3c 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -1875,9 +1875,8 @@ dfs_get_pure_virtuals (tree binfo, void *data) virtuals; virtuals = TREE_CHAIN (virtuals)) if (DECL_PURE_VIRTUAL_P (BV_FN (virtuals))) - CLASSTYPE_PURE_VIRTUALS (type) - = tree_cons (NULL_TREE, BV_FN (virtuals), - CLASSTYPE_PURE_VIRTUALS (type)); + VEC_safe_push (tree, CLASSTYPE_PURE_VIRTUALS (type), + BV_FN (virtuals)); } BINFO_MARKED (binfo) = 1; @@ -1892,7 +1891,7 @@ get_pure_virtuals (tree type) { /* Clear the CLASSTYPE_PURE_VIRTUALS list; whatever is already there is going to be overridden. */ - CLASSTYPE_PURE_VIRTUALS (type) = NULL_TREE; + CLASSTYPE_PURE_VIRTUALS (type) = NULL; /* Now, run through all the bases which are not primary bases, and collect the pure virtual functions. We look at the vtable in each class to determine what pure virtual functions are present. @@ -1901,9 +1900,6 @@ get_pure_virtuals (tree type) pure virtuals in the base class. */ dfs_walk (TYPE_BINFO (type), dfs_get_pure_virtuals, unmarkedp, type); dfs_walk (TYPE_BINFO (type), dfs_unmark, markedp, type); - - /* Put the pure virtuals in dfs order. */ - CLASSTYPE_PURE_VIRTUALS (type) = nreverse (CLASSTYPE_PURE_VIRTUALS (type)); } /* DEPTH-FIRST SEARCH ROUTINES. */ -- cgit v1.1