diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-11-27 09:45:25 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-11-27 09:45:25 +0000 |
commit | 3161e9394c35c3d4aa9c0b79e42cd3421c2d0ae0 (patch) | |
tree | b962c4a419322b81aa4729d5e2509595fc30c65b /gcc | |
parent | 16b493168c670dafb7a5799b0f9f5bf4a3ccfe18 (diff) | |
download | gcc-3161e9394c35c3d4aa9c0b79e42cd3421c2d0ae0.tar.gz |
* class.c: Remove static pending_hard_virtuals.
(add_virtual_function): Take pointers to pending_virtuals
and pending_hard_virtuals.
(finish_struct_1): Pass them. Declare pending_hard_virtuals.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@16787 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/class.c | 28 |
2 files changed, 21 insertions, 14 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 02eeb27f78c..a62a3981d9b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +Thu Nov 27 00:59:46 1997 Jason Merrill <jason@yorick.cygnus.com> + + * class.c: Remove static pending_hard_virtuals. + (add_virtual_function): Take pointers to pending_virtuals + and pending_hard_virtuals. + (finish_struct_1): Pass them. Declare pending_hard_virtuals. + Wed Nov 26 20:28:49 1997 Jason Merrill <jason@yorick.cygnus.com> * decl2.c (import_export_vtable): If we support one_only but not diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 7777b8a2b34..d021fae7dbd 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -103,7 +103,7 @@ static void grow_method PROTO((tree, tree *)); static void finish_vtbls PROTO((tree, int, tree)); static void modify_vtable_entry PROTO((tree, tree, tree)); static tree get_vtable_entry_n PROTO((tree, unsigned HOST_WIDE_INT)); -static tree add_virtual_function PROTO((tree, int *, tree, tree)); +static void add_virtual_function PROTO((tree *, tree *, int *, tree, tree)); static tree delete_duplicate_fields_1 PROTO((tree, tree)); static void delete_duplicate_fields PROTO((tree)); static void finish_struct_bits PROTO((tree, int)); @@ -416,11 +416,6 @@ build_vbase_path (code, type, expr, path, alias_this) /* Virtual function things. */ -/* Virtual functions to be dealt with after laying out our base - classes. We do all overrides after we layout virtual base classes. */ - -static tree pending_hard_virtuals; - /* Build an entry in the virtual function table. DELTA is the offset for the `this' pointer. PFN is an ADDR_EXPR containing a pointer to the virtual function. @@ -953,13 +948,16 @@ get_vtable_entry_n (virtuals, n) vtable for the type, and we build upon the PENDING_VIRTUALS list and return it. */ -static tree -add_virtual_function (pending_virtuals, has_virtual, fndecl, t) - tree pending_virtuals; +static void +add_virtual_function (pv, phv, has_virtual, fndecl, t) + tree *pv, *phv; int *has_virtual; tree fndecl; tree t; /* Structure type. */ { + tree pending_virtuals = *pv; + tree pending_hard_virtuals = *phv; + /* FUNCTION_TYPEs and OFFSET_TYPEs no longer freely convert to void *. Make such a conversion here. */ tree vfn = build1 (ADDR_EXPR, vfunc_ptr_type_node, fndecl); @@ -1023,7 +1021,8 @@ add_virtual_function (pending_virtuals, has_virtual, fndecl, t) Deal with this after we have laid out our virtual base classes. */ pending_hard_virtuals = temp_tree_cons (fndecl, vfn, pending_hard_virtuals); } - return pending_virtuals; + *pv = pending_virtuals; + *phv = pending_hard_virtuals; } /* Obstack on which to build the vector of class methods. */ @@ -3109,6 +3108,7 @@ finish_struct_1 (t, warn_anon) int has_virtual; int max_has_virtual; tree pending_virtuals = NULL_TREE; + tree pending_hard_virtuals = NULL_TREE; tree abstract_virtuals = NULL_TREE; tree vfield; tree vfields; @@ -3275,8 +3275,8 @@ finish_struct_1 (t, warn_anon) if (DECL_VINDEX (x) || (all_virtual == 1 && ! DECL_CONSTRUCTOR_P (x))) { - pending_virtuals = add_virtual_function (pending_virtuals, - &has_virtual, x, t); + add_virtual_function (&pending_virtuals, &pending_hard_virtuals, + &has_virtual, x, t); if (DECL_ABSTRACT_VIRTUAL_P (x)) abstract_virtuals = tree_cons (NULL_TREE, x, abstract_virtuals); #if 0 @@ -3663,8 +3663,8 @@ finish_struct_1 (t, warn_anon) fn_fields = dtor; if (DECL_VINDEX (dtor)) - pending_virtuals = add_virtual_function (pending_virtuals, - &has_virtual, dtor, t); + add_virtual_function (&pending_virtuals, &pending_hard_virtuals, + &has_virtual, dtor, t); nonprivate_method = 1; } } |