From patchwork Wed Sep 13 11:45:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 813389 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-462025-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="jaDbK6FL"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xsfy7175fz9sNw for ; Wed, 13 Sep 2017 21:46:22 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=AMWv5oBKvwYOSsvp0DNKcSpWS4cw3HRdsf2AagOKjyFwg8keqJ R4UTZkhtglAwiLs+32+kQ3bCJxKC2rCLn91QOnDE1WJs+ynXfrabK04BVpiZToMs UrwUJPbZFj4LuwaniBhqVzhVaQyUXeeyGmj+XHL7v/HgI3s1oyUtw5W2g= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=ZuCtN7tYw8w3WSLHwjQPoNnysNQ=; b=jaDbK6FLDMXiUmQEDFGY JSTempxWXV11cUGtKdw1s53GNuCbwLvFO8T5AX++Oq6CYrZ98Ml+wa8IWpJ08Uwp hKGoWDnSnWO88rWCOu1PH3j5M+j+ntMrZFGXjZrDpRv2Iigm6HlKTV2EUH+W9q24 25A9HyQcY5qz2TqGpb88KE8= Received: (qmail 117905 invoked by alias); 13 Sep 2017 11:46:11 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 117408 invoked by uid 89); 13 Sep 2017 11:46:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-yw0-f176.google.com Received: from mail-yw0-f176.google.com (HELO mail-yw0-f176.google.com) (209.85.161.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 13 Sep 2017 11:46:06 +0000 Received: by mail-yw0-f176.google.com with SMTP id q80so34167522ywg.2 for ; Wed, 13 Sep 2017 04:46:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version:content-language; bh=RoGh30MWK4EeUq0FtWudC1K7ds5MGvXZsFxKgkfFjuM=; b=OmM6AechjpRWu84xHKkNF6zy4u7qFTqinzw3B1eCh5i6ce+TWLgRclfmygK9QLuIte 80GlVgkW/jpZcnkyCe+3I5FiaPP/eHinBqr25qxpujkZ7auT4GcDXrE4eIsmlAcNNGmM 384HFFdUgOu08dIfx2Kh8Er1wRvKwuySS5oEEPH+oy/gA76Pgo46/tNt/l++Lsj487Ky 5eSF7HmBTu/avXPNYgaC/0ynpcgOUChnT758GjEpt64wc1d2Ik37EQR64/XkY3WtvrGy sNls4eiaxGKufFsVQrZKHnyhhOA349doq1AVFjw0pe1Lc3qJ8n12sePE6YPCDUtPK5ew Ag5A== X-Gm-Message-State: AHPjjUir/iClaVcaLC/fwVoVtBZsjSnHJjumqaAxRslvdGEbVrjEQuLr PFkgeKv3wPzWLg== X-Google-Smtp-Source: AOwi7QBaIfXzjgQqVd5ldObaNnKek2LVMcUcQugTa345SJYjD46RnuK3V7A57Ae4bUmXJg8fHNGSRA== X-Received: by 10.129.138.133 with SMTP id a127mr1285429ywg.196.1505303164557; Wed, 13 Sep 2017 04:46:04 -0700 (PDT) Received: from ?IPv6:2620:10d:c0a3:20fb:7500:e7fb:4a6f:2254? ([2620:10d:c091:200::a68b]) by smtp.googlemail.com with ESMTPSA id l132sm4538742ywc.62.2017.09.13.04.46.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Sep 2017 04:46:03 -0700 (PDT) To: GCC Patches From: Nathan Sidwell Subject: [C++ PATCH] rename METHOD_VEC to MEMBER_VEC Message-ID: Date: Wed, 13 Sep 2017 07:45:57 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Now that we hold all members on the sorted METHOD_VEC, that's no longer a suitable name. This patch renames the macro and all associated functions from method_vec_foo to member_vec_foo. Applied to trunk. This wraps up my current effort of class member lookup cleaning. nathan 2017-09-13 Nathan Sidwell Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC. * cp-tree.h (struct lang_type): Rename methods to members. (CLASSTYPE_METHOD_VEC): Rename to ... (CLASSTYPE_MEMBER_VEC): ... this. * name-lookup.h (get_method_slot): Rename to ... (get_member_slot): ... this. (resort_type_method_vec): Rename to ... (resort_type_member_vec): ... this. * class.c (add_method, warn_hidden): Adjust. * search.c (dfs_locate_field_accessor_pre): Adjust. * name-lookup.c (method_vec_binary_search): Rename to ... (member_vec_binary_search): ... this and adjust. (method_vec_linear_search): Rename to ... (member_vec_linear_search): ... this and adjust. (fields_linear_search, get_class_binding_direct): Adjust. (get_method_slot): Rename to ... (get_member_slot): ... this and adjust. (method_name_slot): Rename to ... (member_name_slot): ... this and adjust. (resort_type_method_vec): Rename to ... (resort_type_member_vec): ... this and adjust. (method_vec_append_class_fields): Rename to ... (member_vec_append_class_fields): ... this and adjust. (method_vec_append_enum_values): Rename to ... (member_vec_append_enum_values): ... this and adjust. (method_vec_dedup): Rename to ... (member_vec_dedup): ... this and adjust. (set_class_bindings, insert_late_enum_def_bindings): Adjust. Index: class.c =================================================================== --- class.c (revision 252076) +++ class.c (working copy) @@ -1014,7 +1014,7 @@ add_method (tree type, tree method, bool /* Maintain TYPE_HAS_USER_CONSTRUCTOR, etc. */ grok_special_member_properties (method); - tree *slot = get_method_slot (type, DECL_NAME (method)); + tree *slot = get_member_slot (type, DECL_NAME (method)); tree current_fns = *slot; gcc_assert (!DECL_EXTERN_C_P (method)); @@ -2818,10 +2818,10 @@ check_for_override (tree decl, tree ctyp static void warn_hidden (tree t) { - if (vec *method_vec = CLASSTYPE_METHOD_VEC (t)) - for (unsigned ix = method_vec->length (); ix--;) + if (vec *member_vec = CLASSTYPE_MEMBER_VEC (t)) + for (unsigned ix = member_vec->length (); ix--;) { - tree fns = (*method_vec)[ix]; + tree fns = (*member_vec)[ix]; if (!OVL_P (fns)) continue; @@ -4594,7 +4594,7 @@ decl_cloned_function_p (const_tree decl, /* Produce declarations for all appropriate clones of FN. If UPDATE_METHODS is true, the clones are added to the - CLASSTYPE_METHOD_VEC. */ + CLASSTYPE_MEMBER_VEC. */ void clone_function_decl (tree fn, bool update_methods) Index: cp-tree.h =================================================================== --- cp-tree.h (revision 252076) +++ cp-tree.h (working copy) @@ -2000,7 +2000,7 @@ struct GTY(()) lang_type { tree as_base; vec *pure_virtuals; tree friend_classes; - vec * GTY((reorder ("resort_type_method_vec"))) methods; + vec * GTY((reorder ("resort_type_member_vec"))) members; tree key_method; tree decl_list; tree befriending_classes; @@ -2125,19 +2125,11 @@ struct GTY(()) lang_type { if there is no key function or if this is a class template */ #define CLASSTYPE_KEY_METHOD(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->key_method) -/* Vector member functions defined in this class. Each element is - either a FUNCTION_DECL, a TEMPLATE_DECL, or an OVERLOAD. All - functions with the same name end up in the same slot. The first - two elements are for constructors, and destructors, respectively. - All template conversion operators to innermost template dependent - types are overloaded on the next slot, if they exist. Note, the - names for these functions will not all be the same. The - non-template conversion operators & templated conversions to - non-innermost template types are next, followed by ordinary member - functions. There may be empty entries at the end of the vector. - The conversion operators are unsorted. The ordinary member - functions are sorted, once the class is complete. */ -#define CLASSTYPE_METHOD_VEC(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->methods) +/* Vector of members. During definition, it is unordered and only + member functions are present. After completion it is sorted and + contains both member functions and non-functions. STAT_HACK is + involved to preserve oneslot per name invariant. */ +#define CLASSTYPE_MEMBER_VEC(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->members) /* For class templates, this is a TREE_LIST of all member data, functions, types, and friends in the order of declaration. Index: name-lookup.c =================================================================== --- name-lookup.c (revision 252076) +++ name-lookup.c (working copy) @@ -1113,15 +1113,15 @@ extract_conversion_operator (tree fns, t return convs; } -/* Binary search of (ordered) METHOD_VEC for NAME. */ +/* Binary search of (ordered) MEMBER_VEC for NAME. */ static tree -method_vec_binary_search (vec *method_vec, tree name) +member_vec_binary_search (vec *member_vec, tree name) { - for (unsigned lo = 0, hi = method_vec->length (); lo < hi;) + for (unsigned lo = 0, hi = member_vec->length (); lo < hi;) { unsigned mid = (lo + hi) / 2; - tree binding = (*method_vec)[mid]; + tree binding = (*member_vec)[mid]; tree binding_name = OVL_NAME (binding); if (binding_name > name) @@ -1135,17 +1135,17 @@ method_vec_binary_search (vec *method_vec, tree name) +member_vec_linear_search (vec *member_vec, tree name) { - for (int ix = method_vec->length (); ix--;) + for (int ix = member_vec->length (); ix--;) /* We can get a NULL binding during insertion of a new method name, because the identifier_binding machinery performs a lookup. If we find such a NULL slot, that's the thing we were looking for, so we might as well bail out immediately. */ - if (tree binding = (*method_vec)[ix]) + if (tree binding = (*member_vec)[ix]) { if (OVL_NAME (binding) == name) return binding; @@ -1173,8 +1173,8 @@ fields_linear_search (tree klass, tree n gcc_assert (COMPLETE_TYPE_P (anon)); tree temp; - if (vec *method_vec = CLASSTYPE_METHOD_VEC (anon)) - temp = method_vec_linear_search (method_vec, name); + if (vec *member_vec = CLASSTYPE_MEMBER_VEC (anon)) + temp = member_vec_linear_search (member_vec, name); else temp = fields_linear_search (anon, name, want_type); @@ -1224,11 +1224,11 @@ get_class_binding_direct (tree klass, tr bool conv_op = IDENTIFIER_CONV_OP_P (name); tree lookup = conv_op ? conv_op_identifier : name; tree val = NULL_TREE; - vec *method_vec = CLASSTYPE_METHOD_VEC (klass); + vec *member_vec = CLASSTYPE_MEMBER_VEC (klass); - if (COMPLETE_TYPE_P (klass) && method_vec) + if (COMPLETE_TYPE_P (klass) && member_vec) { - val = method_vec_binary_search (method_vec, lookup); + val = member_vec_binary_search (member_vec, lookup); if (!val) ; else if (type_or_fns > 0) @@ -1254,8 +1254,8 @@ get_class_binding_direct (tree klass, tr } else { - if (method_vec && type_or_fns <= 0) - val = method_vec_linear_search (method_vec, lookup); + if (member_vec && type_or_fns <= 0) + val = member_vec_linear_search (member_vec, lookup); if (type_or_fns < 0) /* Don't bother looking for field. We don't want it. */; @@ -1325,33 +1325,33 @@ get_class_binding (tree klass, tree name conv_op marker handling. */ tree * -get_method_slot (tree klass, tree name) +get_member_slot (tree klass, tree name) { bool complete_p = COMPLETE_TYPE_P (klass); - vec *method_vec = CLASSTYPE_METHOD_VEC (klass); - if (!method_vec) + vec *member_vec = CLASSTYPE_MEMBER_VEC (klass); + if (!member_vec) { - vec_alloc (method_vec, 8); - CLASSTYPE_METHOD_VEC (klass) = method_vec; + vec_alloc (member_vec, 8); + CLASSTYPE_MEMBER_VEC (klass) = member_vec; if (complete_p) { - /* If the class is complete but had no method_vec, we need + /* If the class is complete but had no member_vec, we need to add the TYPE_FIELDS into it. We're also most likely to be adding ctors & dtors, so ask for 6 spare slots (the abstract cdtors and their clones). */ set_class_bindings (klass, 6); - method_vec = CLASSTYPE_METHOD_VEC (klass); + member_vec = CLASSTYPE_MEMBER_VEC (klass); } } if (IDENTIFIER_CONV_OP_P (name)) name = conv_op_identifier; - unsigned ix, length = method_vec->length (); + unsigned ix, length = member_vec->length (); for (ix = 0; ix < length; ix++) { - tree *slot = &(*method_vec)[ix]; + tree *slot = &(*member_vec)[ix]; tree fn_name = OVL_NAME (*slot); if (fn_name == name) @@ -1381,17 +1381,17 @@ get_method_slot (tree klass, tree name) { /* Do exact allocation when complete, as we don't expect to add many. */ - vec_safe_reserve_exact (method_vec, 1); - method_vec->quick_insert (ix, NULL_TREE); + vec_safe_reserve_exact (member_vec, 1); + member_vec->quick_insert (ix, NULL_TREE); } else { gcc_checking_assert (ix == length); - vec_safe_push (method_vec, NULL_TREE); + vec_safe_push (member_vec, NULL_TREE); } - CLASSTYPE_METHOD_VEC (klass) = method_vec; + CLASSTYPE_MEMBER_VEC (klass) = member_vec; - tree *slot = &(*method_vec)[ix]; + tree *slot = &(*member_vec)[ix]; if (name == conv_op_identifier) { /* Install the marker prefix. */ @@ -1402,13 +1402,13 @@ get_method_slot (tree klass, tree name) return slot; } -/* Comparison function to compare two TYPE_METHOD_VEC entries by - name. Because we can have duplicates during insertion of - TYPE_FIELDS, we do extra checking so deduping doesn't have to deal - with so many cases. */ +/* Comparison function to compare two MEMBER_VEC entries by name. + Because we can have duplicates during insertion of TYPE_FIELDS, we + do extra checking so deduping doesn't have to deal with so many + cases. */ static int -method_name_cmp (const void *a_p, const void *b_p) +member_name_cmp (const void *a_p, const void *b_p) { tree a = *(const tree *)a_p; tree b = *(const tree *)b_p; @@ -1464,12 +1464,12 @@ static struct { void *cookie; } resort_data; -/* This routine compares two fields like method_name_cmp but using the +/* This routine compares two fields like member_name_cmp but using the pointer operator in resort_field_decl_data. We don't have to deal with duplicates here. */ static int -resort_method_name_cmp (const void *a_p, const void *b_p) +resort_member_name_cmp (const void *a_p, const void *b_p) { tree a = *(const tree *)a_p; tree b = *(const tree *)b_p; @@ -1484,18 +1484,18 @@ resort_method_name_cmp (const void *a_p, return name_a < name_b ? -1 : +1; } -/* Resort TYPE_METHOD_VEC because pointers have been reordered. */ +/* Resort CLASSTYPE_MEMBER_VEC because pointers have been reordered. */ void -resort_type_method_vec (void *obj, void */*orig_obj*/, +resort_type_member_vec (void *obj, void */*orig_obj*/, gt_pointer_operator new_value, void* cookie) { - if (vec *method_vec = (vec *) obj) + if (vec *member_vec = (vec *) obj) { resort_data.new_value = new_value; resort_data.cookie = cookie; - qsort (method_vec->address (), method_vec->length (), - sizeof (tree), resort_method_name_cmp); + qsort (member_vec->address (), member_vec->length (), + sizeof (tree), resort_member_name_cmp); } } @@ -1519,18 +1519,18 @@ count_class_fields (tree klass) return n_fields; } -/* Append all the nonfunction members fields of KLASS to METHOD_VEC. - Recurse for anonymous members. METHOD_VEC must have space. */ +/* Append all the nonfunction members fields of KLASS to MEMBER_VEC. + Recurse for anonymous members. MEMBER_VEC must have space. */ static void -method_vec_append_class_fields (vec *method_vec, tree klass) +member_vec_append_class_fields (vec *member_vec, tree klass) { for (tree fields = TYPE_FIELDS (klass); fields; fields = DECL_CHAIN (fields)) if (DECL_DECLARES_FUNCTION_P (fields)) /* Functions are handled separately. */; else if (TREE_CODE (fields) == FIELD_DECL && ANON_AGGR_TYPE_P (TREE_TYPE (fields))) - method_vec_append_class_fields (method_vec, TREE_TYPE (fields)); + member_vec_append_class_fields (member_vec, TREE_TYPE (fields)); else if (DECL_NAME (fields)) { tree field = fields; @@ -1538,22 +1538,22 @@ method_vec_append_class_fields (vecquick_push (field); + member_vec->quick_push (field); } } -/* Append all of the enum values of ENUMTYPE to METHOD_VEC. - METHOD_VEC must have space. */ +/* Append all of the enum values of ENUMTYPE to MEMBER_VEC. + MEMBER_VEC must have space. */ static void -method_vec_append_enum_values (vec *method_vec, tree enumtype) +member_vec_append_enum_values (vec *member_vec, tree enumtype) { for (tree values = TYPE_VALUES (enumtype); values; values = TREE_CHAIN (values)) - method_vec->quick_push (TREE_VALUE (values)); + member_vec->quick_push (TREE_VALUE (values)); } -/* METHOD_VEC has just had new DECLs added to it, but is sorted. +/* MEMBER_VEC has just had new DECLs added to it, but is sorted. DeDup adjacent DECLS of the same name. We already dealt with conflict resolution when adding the fields or methods themselves. There are three cases (which could all be combined): @@ -1562,16 +1562,16 @@ method_vec_append_enum_values (vec */ static void -method_vec_dedup (vec *method_vec) +member_vec_dedup (vec *member_vec) { - unsigned len = method_vec->length (); + unsigned len = member_vec->length (); unsigned store = 0; - tree current = (*method_vec)[0], name = OVL_NAME (current); + tree current = (*member_vec)[0], name = OVL_NAME (current); tree next = NULL_TREE, next_name = NULL_TREE; for (unsigned jx, ix = 0; ix < len; ix = jx, current = next, name = next_name) @@ -1607,7 +1607,7 @@ method_vec_dedup (vec *meth for (jx = ix + 1; jx < len; jx++) { - next = (*method_vec)[jx]; + next = (*member_vec)[jx]; next_name = OVL_NAME (next); if (next_name != name) break; @@ -1657,15 +1657,15 @@ method_vec_dedup (vec *meth OVL_CHAIN (marker) = current; current = marker; } - (*method_vec)[store++] = current; + (*member_vec)[store++] = current; } while (store++ < len) - method_vec->pop (); + member_vec->pop (); } -/* Add the non-function members to CLASSTYPE_METHOD_VEC. If there is - no existing METHOD_VEC and fewer than 8 fields, do nothing. We +/* Add the non-function members to CLASSTYPE_MEMBER_VEC. If there is + no existing MEMBER_VEC and fewer than 8 fields, do nothing. We know there must be at least 1 field -- the self-reference TYPE_DECL, except for anon aggregates, which will have at least one field. */ @@ -1674,21 +1674,21 @@ void set_class_bindings (tree klass, unsigned extra) { unsigned n_fields = count_class_fields (klass); - vec *method_vec = CLASSTYPE_METHOD_VEC (klass); + vec *member_vec = CLASSTYPE_MEMBER_VEC (klass); - if (method_vec || n_fields >= 8) + if (member_vec || n_fields >= 8) { /* Append the new fields. */ - vec_safe_reserve_exact (method_vec, extra + n_fields); - method_vec_append_class_fields (method_vec, klass); + vec_safe_reserve_exact (member_vec, extra + n_fields); + member_vec_append_class_fields (member_vec, klass); } - if (method_vec) + if (member_vec) { - CLASSTYPE_METHOD_VEC (klass) = method_vec; - qsort (method_vec->address (), method_vec->length (), - sizeof (tree), method_name_cmp); - method_vec_dedup (method_vec); + CLASSTYPE_MEMBER_VEC (klass) = member_vec; + qsort (member_vec->address (), member_vec->length (), + sizeof (tree), member_name_cmp); + member_vec_dedup (member_vec); } } @@ -1698,26 +1698,26 @@ void insert_late_enum_def_bindings (tree klass, tree enumtype) { int n_fields; - vec *method_vec = CLASSTYPE_METHOD_VEC (klass); + vec *member_vec = CLASSTYPE_MEMBER_VEC (klass); /* The enum bindings will already be on the TYPE_FIELDS, so don't count them twice. */ - if (!method_vec) + if (!member_vec) n_fields = count_class_fields (klass); else n_fields = list_length (TYPE_VALUES (enumtype)); - if (method_vec || n_fields >= 8) + if (member_vec || n_fields >= 8) { - vec_safe_reserve_exact (method_vec, n_fields); - if (CLASSTYPE_METHOD_VEC (klass)) - method_vec_append_enum_values (method_vec, enumtype); + vec_safe_reserve_exact (member_vec, n_fields); + if (CLASSTYPE_MEMBER_VEC (klass)) + member_vec_append_enum_values (member_vec, enumtype); else - method_vec_append_class_fields (method_vec, klass); - CLASSTYPE_METHOD_VEC (klass) = method_vec; - qsort (method_vec->address (), method_vec->length (), - sizeof (tree), method_name_cmp); - method_vec_dedup (method_vec); + member_vec_append_class_fields (member_vec, klass); + CLASSTYPE_MEMBER_VEC (klass) = member_vec; + qsort (member_vec->address (), member_vec->length (), + sizeof (tree), member_name_cmp); + member_vec_dedup (member_vec); } } Index: name-lookup.h =================================================================== --- name-lookup.h (revision 252076) +++ name-lookup.h (working copy) @@ -321,8 +321,8 @@ extern tree do_class_using_decl (tree, t extern tree lookup_arg_dependent (tree, tree, vec *); extern tree get_class_binding_direct (tree, tree, int type_or_fns = -1); extern tree get_class_binding (tree, tree, int type_or_fns = -1); -extern tree *get_method_slot (tree klass, tree name); -extern void resort_type_method_vec (void *, void *, +extern tree *get_member_slot (tree klass, tree name); +extern void resort_type_member_vec (void *, void *, gt_pointer_operator, void *); extern void set_class_bindings (tree, unsigned extra = 0); extern void insert_late_enum_def_bindings (tree, tree); Index: search.c =================================================================== --- search.c (revision 252076) +++ search.c (working copy) @@ -1803,18 +1803,18 @@ dfs_locate_field_accessor_pre (tree binf locate_field_data *lfd = (locate_field_data *)data; tree type = BINFO_TYPE (binfo); - vec *method_vec; + vec *member_vec; tree fn; size_t i; if (!CLASS_TYPE_P (type)) return NULL_TREE; - method_vec = CLASSTYPE_METHOD_VEC (type); - if (!method_vec) + member_vec = CLASSTYPE_MEMBER_VEC (type); + if (!member_vec) return NULL_TREE; - for (i = 0; vec_safe_iterate (method_vec, i, &fn); ++i) + for (i = 0; vec_safe_iterate (member_vec, i, &fn); ++i) if (fn) if (field_accessor_p (fn, lfd->field_decl, lfd->const_p)) return fn;