Commit 783dc739 by Nathan Sidwell Committed by 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.

From-SVN: r252078
parent 491cefb7
2017-09-13 Nathan Sidwell <nathan@acm.org>
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.
2017-09-12 Paolo Carlini <paolo.carlini@oracle.com> 2017-09-12 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/70621 PR c++/70621
......
...@@ -1014,7 +1014,7 @@ add_method (tree type, tree method, bool via_using) ...@@ -1014,7 +1014,7 @@ add_method (tree type, tree method, bool via_using)
/* Maintain TYPE_HAS_USER_CONSTRUCTOR, etc. */ /* Maintain TYPE_HAS_USER_CONSTRUCTOR, etc. */
grok_special_member_properties (method); 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; tree current_fns = *slot;
gcc_assert (!DECL_EXTERN_C_P (method)); gcc_assert (!DECL_EXTERN_C_P (method));
...@@ -2818,10 +2818,10 @@ check_for_override (tree decl, tree ctype) ...@@ -2818,10 +2818,10 @@ check_for_override (tree decl, tree ctype)
static void static void
warn_hidden (tree t) warn_hidden (tree t)
{ {
if (vec<tree, va_gc> *method_vec = CLASSTYPE_METHOD_VEC (t)) if (vec<tree, va_gc> *member_vec = CLASSTYPE_MEMBER_VEC (t))
for (unsigned ix = method_vec->length (); ix--;) for (unsigned ix = member_vec->length (); ix--;)
{ {
tree fns = (*method_vec)[ix]; tree fns = (*member_vec)[ix];
if (!OVL_P (fns)) if (!OVL_P (fns))
continue; continue;
...@@ -4594,7 +4594,7 @@ decl_cloned_function_p (const_tree decl, bool just_testing) ...@@ -4594,7 +4594,7 @@ decl_cloned_function_p (const_tree decl, bool just_testing)
/* Produce declarations for all appropriate clones of FN. If /* Produce declarations for all appropriate clones of FN. If
UPDATE_METHODS is true, the clones are added to the UPDATE_METHODS is true, the clones are added to the
CLASSTYPE_METHOD_VEC. */ CLASSTYPE_MEMBER_VEC. */
void void
clone_function_decl (tree fn, bool update_methods) clone_function_decl (tree fn, bool update_methods)
......
...@@ -2000,7 +2000,7 @@ struct GTY(()) lang_type { ...@@ -2000,7 +2000,7 @@ struct GTY(()) lang_type {
tree as_base; tree as_base;
vec<tree, va_gc> *pure_virtuals; vec<tree, va_gc> *pure_virtuals;
tree friend_classes; tree friend_classes;
vec<tree, va_gc> * GTY((reorder ("resort_type_method_vec"))) methods; vec<tree, va_gc> * GTY((reorder ("resort_type_member_vec"))) members;
tree key_method; tree key_method;
tree decl_list; tree decl_list;
tree befriending_classes; tree befriending_classes;
...@@ -2125,19 +2125,11 @@ struct GTY(()) lang_type { ...@@ -2125,19 +2125,11 @@ struct GTY(()) lang_type {
if there is no key function or if this is a class template */ 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) #define CLASSTYPE_KEY_METHOD(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->key_method)
/* Vector member functions defined in this class. Each element is /* Vector of members. During definition, it is unordered and only
either a FUNCTION_DECL, a TEMPLATE_DECL, or an OVERLOAD. All member functions are present. After completion it is sorted and
functions with the same name end up in the same slot. The first contains both member functions and non-functions. STAT_HACK is
two elements are for constructors, and destructors, respectively. involved to preserve oneslot per name invariant. */
All template conversion operators to innermost template dependent #define CLASSTYPE_MEMBER_VEC(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->members)
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)
/* For class templates, this is a TREE_LIST of all member data, /* For class templates, this is a TREE_LIST of all member data,
functions, types, and friends in the order of declaration. functions, types, and friends in the order of declaration.
......
...@@ -321,8 +321,8 @@ extern tree do_class_using_decl (tree, tree); ...@@ -321,8 +321,8 @@ extern tree do_class_using_decl (tree, tree);
extern tree lookup_arg_dependent (tree, tree, vec<tree, va_gc> *); extern tree lookup_arg_dependent (tree, tree, vec<tree, va_gc> *);
extern tree get_class_binding_direct (tree, tree, int type_or_fns = -1); 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_class_binding (tree, tree, int type_or_fns = -1);
extern tree *get_method_slot (tree klass, tree name); extern tree *get_member_slot (tree klass, tree name);
extern void resort_type_method_vec (void *, void *, extern void resort_type_member_vec (void *, void *,
gt_pointer_operator, void *); gt_pointer_operator, void *);
extern void set_class_bindings (tree, unsigned extra = 0); extern void set_class_bindings (tree, unsigned extra = 0);
extern void insert_late_enum_def_bindings (tree, tree); extern void insert_late_enum_def_bindings (tree, tree);
......
...@@ -1803,18 +1803,18 @@ dfs_locate_field_accessor_pre (tree binfo, void *data) ...@@ -1803,18 +1803,18 @@ dfs_locate_field_accessor_pre (tree binfo, void *data)
locate_field_data *lfd = (locate_field_data *)data; locate_field_data *lfd = (locate_field_data *)data;
tree type = BINFO_TYPE (binfo); tree type = BINFO_TYPE (binfo);
vec<tree, va_gc> *method_vec; vec<tree, va_gc> *member_vec;
tree fn; tree fn;
size_t i; size_t i;
if (!CLASS_TYPE_P (type)) if (!CLASS_TYPE_P (type))
return NULL_TREE; return NULL_TREE;
method_vec = CLASSTYPE_METHOD_VEC (type); member_vec = CLASSTYPE_MEMBER_VEC (type);
if (!method_vec) if (!member_vec)
return NULL_TREE; 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 (fn)
if (field_accessor_p (fn, lfd->field_decl, lfd->const_p)) if (field_accessor_p (fn, lfd->field_decl, lfd->const_p))
return fn; return fn;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment