diff options
author | Mark Mitchell <mark@codesourcery.com> | 1999-12-16 22:18:22 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1999-12-16 22:18:22 +0000 |
commit | 607cf13135fdf7c664bb26f7cf2c5b3c18204f96 (patch) | |
tree | 418097af1b72d5c3400d623aa2be1b3611051d92 /gcc/cp/method.c | |
parent | a97901e608d0e3233e28a6d8e39d3124d661a650 (diff) | |
download | gcc-607cf13135fdf7c664bb26f7cf2c5b3c18204f96.zip gcc-607cf13135fdf7c664bb26f7cf2c5b3c18204f96.tar.gz gcc-607cf13135fdf7c664bb26f7cf2c5b3c18204f96.tar.bz2 |
class.c (check_field_decls): Don't return a value.
1999-12-16 Mark Mitchell <mark@codesourcery.com>
* class.c (check_field_decls): Don't return a value.
(avoid_overlap): Moved here from tree.c.
(build_base_fields): Likewise.
(check_bases): New function, split out from finish_base_struct.
(check_bases_and_members): New function, split out from finish_struct_1.
(struct base_info): Remove cant_have_default_ctor,
cant_have_const_ctor, cant_have_asn_ref.
(finish_base_struct): Split semantic analysis into check_bases.
(finish_struct_methods): Fix bogus assertion.
(check_field_decls): Call finish_struct_anon here.
(build_vbase_pointer_fields): Use CLASSTYPE_N_BASECLASSES.
(finish_struct_1): Use check_bases_and_members. Reorganize.
* cp-tree.h (CLASSTYPE_VBASECLASSES): Improve documentation.
(build_base_fields): Don't declare.
* tree.c (avoid_overlap): Remove.
(build_base_fields): Likewise.
From-SVN: r30983
Diffstat (limited to 'gcc/cp/method.c')
-rw-r--r-- | gcc/cp/method.c | 64 |
1 files changed, 28 insertions, 36 deletions
diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 7373f06..4873285 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -98,6 +98,7 @@ static int is_back_referenceable_type PROTO((tree)); static int check_btype PROTO((tree)); static void build_mangled_name_for_type PROTO((tree)); static void build_mangled_name_for_type_with_Gcode PROTO((tree, int)); +static void fixup_pending_inline PROTO((struct pending_inline *)); # define OB_INIT() (scratch_firstobj ? (obstack_free (&scratch_obstack, scratch_firstobj), 0) : 0) # define OB_PUTC(C) (obstack_1grow (&scratch_obstack, (C))) @@ -142,6 +143,27 @@ init_method () value. */ static char digit_buffer[128]; +/* Fixup the inline function given by INFO now that the class is + complete. */ + +static void +fixup_pending_inline (info) + struct pending_inline *info; +{ + if (info) + { + tree args; + tree fn = info->fndecl; + + args = DECL_ARGUMENTS (fn); + while (args) + { + DECL_CONTEXT (args) = fn; + args = TREE_CHAIN (args); + } + } +} + /* Move inline function definitions out of structure so that they can be processed normally. CNAME is the name of the class we are working from, METHOD_LIST is the list of method lists @@ -164,43 +186,13 @@ do_inline_function_hair (type, friend_list) method = TREE_VEC_ELT (method, 2); } - while (method) - { - /* Do inline member functions. */ - struct pending_inline *info = DECL_PENDING_INLINE_INFO (method); - if (info) - { - tree args; - - my_friendly_assert (info->fndecl == method, 238); - args = DECL_ARGUMENTS (method); - while (args) - { - DECL_CONTEXT (args) = method; - args = TREE_CHAIN (args); - } - } - method = TREE_CHAIN (method); - } - while (friend_list) - { - tree fndecl = TREE_VALUE (friend_list); - struct pending_inline *info = DECL_PENDING_INLINE_INFO (fndecl); - if (info) - { - tree args; - - my_friendly_assert (info->fndecl == fndecl, 239); - args = DECL_ARGUMENTS (fndecl); - while (args) - { - DECL_CONTEXT (args) = fndecl; - args = TREE_CHAIN (args); - } - } + /* Do inline member functions. */ + for (; method; method = TREE_CHAIN (method)) + fixup_pending_inline (DECL_PENDING_INLINE_INFO (method)); - friend_list = TREE_CHAIN (friend_list); - } + /* Do friends. */ + for (; friend_list; friend_list = TREE_CHAIN (friend_list)) + fixup_pending_inline (DECL_PENDING_INLINE_INFO (TREE_VALUE (friend_list))); } /* Here is where overload code starts. */ |