diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-08-08 05:48:39 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-08-08 05:48:39 +0000 |
commit | 4ac852cb02add7a1a1d9ae9b2ce7c1099e8469b2 (patch) | |
tree | 058425a91c86198acce41c98f8f13929c3780dc4 /gcc/cp/decl2.c | |
parent | 14c03a873ffe390858ea8584cb3fe462a8094543 (diff) | |
download | gcc-4ac852cb02add7a1a1d9ae9b2ce7c1099e8469b2.tar.gz |
Rework build_component_ref.
* call.c (build_vfield_ref): Do not go through build_component_ref.
(build_field_call): Use build_class_member_access_expr.
(build_user_type_conversion_1): Use BASELINK_FUNCTIONS.
(build_object_call): Likewise.
* class.c (convert_to_base): New function.
(type_requires_array_cookie): Use BASELINK_FUNCTIONS.
(instantiate_type): Handle BASELINKs.
* cp-tree.def (BASELINK): New tree code.
* cp-tree.h (BASELINK_P): Reimplement.
(SET_BASELINK_P): Remove.
(BASELINK_BINFO): Reimplement.
(BASELINK_FUNCTIONS): Likewise.
(BASELINK_ACCESS_BINFO): Likewise.
(BASELINK_OPTYPE): Likewise.
(convert_to_base): New function.
(name_p): Likewise.
(build_object_ref): Remove.
(build_component_ref_1): Likewise.
(build_component_ref): Likewise.
(build_x_component_ref): Likewise.
(build_class_member_access_expr): New function.
(finish_class_member_access_expr): Likewise.
(build_ptrmemfunc_access_expr): Likewise.
* decl.c (grokdeclarator): Handle BASELINKs.
* decl2. (build_expr_from_tree): Handle COMPONENT_REFs by using
finish_class_member_access_expr.
(arg_assoc): Handle BASELINKs.
(do_class_using_decl): Likewise.
* error.c (dump_decl): Likewise.
(dump_expr): Use build_ptrmemfunc_access_expr.
* except.c (dtor_nothrow): Use CLASSTYPE_DESTRUCTORS to find
destructors.
(build_throw): Use BASELINK_FUNCTIONS.
* init.c (perform_member_init): Use
build_class_member_access_expr.
(build_offset_ref): Handle BASELINKs. Use
build_class_member_access_expr.
* method.c (hack_identifier): Likewise.
* parse.y (do_id): Use BASELINK, not TREE_LIST.
(primary): Remove uses of build_object_ref.
* pt.c (lookup_template_function): Handle BASELINKs.
(resolve_overloaded_unification): Likewise.
* search.c (build_baselink): Build a BASELINK, not a TREE_LIST.
(lookup_field): Use BASELINK, not TREE_LIST.
(lookup_fnfiels): Likewise.
(setup_class_bindings): Likewise.
* semantics.c (finish_object_call_expr): Do not use
build_method_call when we already know what function is being
called.
* spew.c (identifier_type): Use BASELINK, not TREE_LIST.
* tree.c (really_overloaded_fn): Use OVL_CHAIN for OVERLOADs, not
TREE_CHAIN.
(name_p): New function.
* typeck.c (build_object_ref): Remove.
(build_component_ref_1): Likewise.
(build_x_component_ref): Likewise.
(build_class_member_access_expr): New function.
(finish_class_member_access_expr): Likewise.
(build_ptrmemfunc_access_expr): Likewise.
(get_member_function_from_ptrfunc): Use
build_ptrmemfunc_access_expr.
(build_binary_op): Likewise.
(build_unary_op): Likewise.
(build_ptrmemfunc): Likewise.
(pfn_from_ptrmemfunc): Likewise.
* typeck2.c (build_m_component_ref): Adjust comment.
* g++.dg/abi/offsetof.C: Tweak error messages.
* g++.old-deja/g++.mike/p10769a.C: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56117 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 26442068c4e..bdd854f4d5a 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -3369,17 +3369,8 @@ build_expr_from_tree (t) case COMPONENT_REF: { tree object = build_expr_from_tree (TREE_OPERAND (t, 0)); - tree field = TREE_OPERAND (t, 1); - - /* We use a COMPONENT_REF to indicate things of the form `x.b' - and `x.A::b'. We must distinguish between those cases - here. */ - if (TREE_CODE (field) == SCOPE_REF) - return build_object_ref (object, - TREE_OPERAND (field, 0), - TREE_OPERAND (field, 1)); - else - return build_x_component_ref (object, field, NULL_TREE); + return finish_class_member_access_expr (object, + TREE_OPERAND (t, 1)); } case THROW_EXPR: @@ -4283,6 +4274,8 @@ arg_assoc (k, n) n = TREE_OPERAND (n, 1); while (TREE_CODE (n) == TREE_LIST) n = TREE_VALUE (n); + if (TREE_CODE (n) == BASELINK) + n = BASELINK_FUNCTIONS (n); if (TREE_CODE (n) == FUNCTION_DECL) return arg_assoc_type (k, TREE_TYPE (n)); @@ -4647,6 +4640,13 @@ do_class_using_decl (decl) } if (TREE_CODE (name) == TYPE_DECL || TREE_CODE (name) == TEMPLATE_DECL) name = DECL_NAME (name); + else if (BASELINK_P (name)) + { + name = BASELINK_FUNCTIONS (name); + if (TREE_CODE (name) == TEMPLATE_ID_EXPR) + name = TREE_OPERAND (name, 0); + name = DECL_NAME (get_first_fn (name)); + } my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 980716); |