Commit 45e3a33d by Nathan Sidwell Committed by Nathan Sidwell

Kill CLASSTYPE_SORTED_FIELDS.

	* cp-tree.h (struct lang_type): Lose sorted_fields member.
	(CLASSTYPE_SORTED_FIELDS): Delete.
	* name-lookup.h (set_class_bindings): Add EXTRA arg.
	* name-lookup.c (fields_linear_search): New, broken out of ...
	(lookup_field_1): ... here.  Delete remainder of function.
	(get_class_binding_direct): Reimplement without sorted_fields.
	(get_class_binding): Rename TYPE arg to KLASS, for consistency.
	(get_method_slot): Call set_class_binding when creating method_vec
	on complete type.
	(method_name_cmp): Order identically named slots.
	(sorted_fields_type_new): Delete.
	(field_vc_append_class_fields): Rename to ...
	(method_vec_append_class_fields): ... here.  Adjust.
	(field_vec_append_enum_values): Renme to ...
	(method_vec_append_enum_values): ... here. Adjust.
	(method_vec_dedup): New.
	(set_class_bindings): Reimplement.
	(insert_late_enum_def_bindings): Reimplement.

From-SVN: r252005
parent 20614c86
2017-09-12 Nathan Sidwell <nathan@acm.org> 2017-09-12 Nathan Sidwell <nathan@acm.org>
Kill CLASSTYPE_SORTED_FIELDS.
* cp-tree.h (struct lang_type): Lose sorted_fields member.
(CLASSTYPE_SORTED_FIELDS): Delete.
* name-lookup.h (set_class_bindings): Add EXTRA arg.
* name-lookup.c (fields_linear_search): New, broken out of ...
(lookup_field_1): ... here. Delete remainder of function.
(get_class_binding_direct): Reimplement without sorted_fields.
(get_class_binding): Rename TYPE arg to KLASS, for consistency.
(get_method_slot): Call set_class_binding when creating method_vec
on complete type.
(method_name_cmp): Order identically named slots.
(sorted_fields_type_new): Delete.
(field_vc_append_class_fields): Rename to ...
(method_vec_append_class_fields): ... here. Adjust.
(field_vec_append_enum_values): Renme to ...
(method_vec_append_enum_values): ... here. Adjust.
(method_vec_dedup): New.
(set_class_bindings): Reimplement.
(insert_late_enum_def_bindings): Reimplement.
* name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for * name-lookup.c (get_class_binding): Rename TYPE arg to KLASS for
consistency. consistency.
(restort_data): Move later. (restort_data): Move later.
......
...@@ -2008,10 +2008,6 @@ struct GTY(()) lang_type { ...@@ -2008,10 +2008,6 @@ struct GTY(()) lang_type {
as a list of adopted protocols or a pointer to a corresponding as a list of adopted protocols or a pointer to a corresponding
@interface. See objc/objc-act.h for details. */ @interface. See objc/objc-act.h for details. */
tree objc_info; tree objc_info;
/* sorted_fields is sorted based on a pointer, so we need to be able
to resort it if pointers get rearranged. */
struct sorted_fields_type * GTY ((reorder ("resort_sorted_fields")))
sorted_fields;
/* FIXME reuse another field? */ /* FIXME reuse another field? */
tree lambda_expr; tree lambda_expr;
}; };
...@@ -3229,11 +3225,6 @@ extern void decl_shadowed_for_var_insert (tree, tree); ...@@ -3229,11 +3225,6 @@ extern void decl_shadowed_for_var_insert (tree, tree);
&& TREE_CODE (TYPE_NAME (NODE)) == TYPE_DECL \ && TREE_CODE (TYPE_NAME (NODE)) == TYPE_DECL \
&& TYPE_DECL_ALIAS_P (TYPE_NAME (NODE))) && TYPE_DECL_ALIAS_P (TYPE_NAME (NODE)))
/* For a class type: if this structure has many fields, we'll sort them
and put them into a TREE_VEC. */
#define CLASSTYPE_SORTED_FIELDS(NODE) \
(LANG_TYPE_CLASS_CHECK (NODE)->sorted_fields)
/* If non-NULL for a VAR_DECL, FUNCTION_DECL, TYPE_DECL or /* If non-NULL for a VAR_DECL, FUNCTION_DECL, TYPE_DECL or
TEMPLATE_DECL, the entity is either a template specialization (if TEMPLATE_DECL, the entity is either a template specialization (if
DECL_USE_TEMPLATE is nonzero) or the abstract instance of the DECL_USE_TEMPLATE is nonzero) or the abstract instance of the
......
...@@ -324,7 +324,7 @@ extern tree get_class_binding (tree, tree, int type_or_fns = -1); ...@@ -324,7 +324,7 @@ extern tree get_class_binding (tree, tree, int type_or_fns = -1);
extern tree *get_method_slot (tree klass, tree name); extern tree *get_method_slot (tree klass, tree name);
extern void resort_type_method_vec (void *, void *, extern void resort_type_method_vec (void *, void *,
gt_pointer_operator, void *); gt_pointer_operator, void *);
extern void set_class_bindings (tree); 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);
extern tree innermost_non_namespace_value (tree); extern tree innermost_non_namespace_value (tree);
extern cxx_binding *outer_binding (tree, cxx_binding *, bool); extern cxx_binding *outer_binding (tree, cxx_binding *, bool);
......
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