summaryrefslogtreecommitdiff
path: root/gcc/cp/rtti.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-22 23:30:22 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-22 23:30:22 +0000
commit1bc16cab85186497eb134f6fbeb188d41b0fd8d2 (patch)
tree74afcc9943903e84e906ee02eba4d464f77fe58b /gcc/cp/rtti.c
parentb4b174c3fb9ec7475e50ef67255cc1b2f274e949 (diff)
downloadgcc-1bc16cab85186497eb134f6fbeb188d41b0fd8d2.tar.gz
* fold-const.c (force_fit_type): Handle OFFSET_TYPE.
* varasam.c (output_constant): Likewise. 2003-07-22 Mark Mitchell <mark@codesourcery.com> Eliminate use of POINTER_TYPE for pointers-to-members. * call.c (standard_conversion): Rework pointer-to-member handling. Add comments. (add_builtin_candidate): Likewise. (resolve_scoped_fn_name): Remove. (build_conditional_expr): Rework pointer-to-member handling. (compare_ics): Likewise. * class.c (check_field_decls): Use TYPE_PTR_P. * cp-lang.c (cp_var_mod_type_p): Rework pointer-to-member handling. * cp-tree.h (SCALAR_TYPE_P): Use TYPE_PTR_TO_MEMBER_P. (TYPE_PTRMEM_P): Add comment. (TYPE_PTR_P): Simplify. (TYPE_PTROB_P): Correct definition. (TYPE_PTR_TO_MEMBER_P): New macro. (TYPE_PTRMEM_CLASS_TYPE): Adjust. (TYPE_PTRMEM_POINTED_TO_TYPE): Likewise. (resolved_scoped_fn_name): Remove declaration. (build_offset_ref): Change prototype. (resolve_offset_ref): Remove. (comp_target_types): Remove. * cvt.c (cp_convert_to_pointer): Rework pointer-to-member handling. (convert_to_reference): Use can_convert. (ocp_convert): Improve error handling. Rework pointer-to-member handling. (perform_qualification_conversions): Rework pointer-to-member handling. * decl.c (build_ptrmem_type): Handle functions too. (create_array_type_for_decl): Remove OFFSET_TYPE error message. (grokdeclarator): Use OFFSET_TYPE for pointers to data members. (grokparms): Remove OFFSET_TYPE error message. * dump.c (cp_dump_tree): Rework pointer-to-member handling. * error.c (dump_type_prefix): Likewise. * expr.c (cplus_expand_constant): Use build_nop. * init.c (build_offset_ref): Add address_p parameter. Fold in necessary bits from resolve_offset_ref. (resolve_offset_ref): Remove. * parser.c (cp_parser_postfix_expression): Remove special case code for OFFSET_TYPE. * pt.c (convert_nontype_argument): Rework pointer-to-member handling. (convert_template_argument): Likewise. (unify): Likewise. (invalid_nontype_parm_type_p): Likewise. (dependent_type_p_r): Likewise. * rtti.c (get_tinfo_decl): Remove OFFSET_TYPE special case. (target_incomplete_p_): Rework pointer-to-member handling. (get_pseudo_ti_init): Likewise. (get_pseudo_ti_desc): Likewise. * semantics.c (finish_qualified_id_expr): Adjust call to build_offset_ref. Remove use of resolve_offset_ref. * tree.c (pod_type_p): Use TYPE_PTR_TO_MEMBER_P. * typeck.c (target_type): Use TYPE_PTRMEM_P. (type_unknown_p): Remove obsolete code about the time before non-dependent expressions were handled correctly. (qualify_type_recursive): Remove. (composite_pointer_type_r): New function. (composite_pointer_type): Use it. (merge_types): Remove dead comments. (comp_cv_target_types): Remove. (comp_target_types): Likewise. (comp_target_parms): Likewise. (cxx_sizeof_or_alignof_type): Remove OFFSET_TYPE error. (build_indirect_ref): Use TYPE_PTR_TO_MEMBER_P. (build_binary_op): Do not use of comp_target_types. (pointer_diff): Remove OFFSET_TYPE case. (build_unary_op): Adjust pointer-to-member handling. (unary_complex_lvalue): Likewise. (check_for_casting_away_constness): Add description parameter. (build_static_cast): Pass it. (build_reinterpret_cast): Use check_for_casting_away_constness. (build_const_cast): Adjust pointer-to-member handling. (build_c_cast): Likewise. (convert_for_assignment): Remove OFFSET_TYPE error message. (comp_ptr_ttypes_real): Adjust pointer-to-member handling. (comp_ptr_ttypes_reinterpret): Remove. (casts_away_constness_r): Adjust pointer-to-member handling. (casts_away_constness): Liekwise. (strip_all_pointer_quals): Remove. * typeck2.c (digest_init): Adjust pointer-to-member handling. (build_m_component_ref): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69691 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/rtti.c')
-rw-r--r--gcc/cp/rtti.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 067ddee1773..fdad47d9cc4 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -331,8 +331,6 @@ get_tinfo_decl (tree type)
return error_mark_node;
}
- if (TREE_CODE (type) == OFFSET_TYPE)
- type = TREE_TYPE (type);
if (TREE_CODE (type) == METHOD_TYPE)
type = build_function_type (TREE_TYPE (type),
TREE_CHAIN (TYPE_ARG_TYPES (type)));
@@ -715,19 +713,17 @@ qualifier_flags (tree type)
static bool
target_incomplete_p (tree type)
{
- while (TREE_CODE (type) == POINTER_TYPE)
+ while (true)
if (TYPE_PTRMEM_P (type))
{
- if (!COMPLETE_TYPE_P (TYPE_PTRMEM_CLASS_TYPE (type)))
- return true;
- type = TYPE_PTRMEM_POINTED_TO_TYPE (type);
+ if (!COMPLETE_TYPE_P (TYPE_PTRMEM_CLASS_TYPE (type)))
+ return true;
+ type = TYPE_PTRMEM_POINTED_TO_TYPE (type);
}
- else
+ else if (TREE_CODE (type) == POINTER_TYPE)
type = TREE_TYPE (type);
- if (!COMPLETE_OR_VOID_TYPE_P (type))
- return true;
-
- return false;
+ else
+ return !COMPLETE_OR_VOID_TYPE_P (type);
}
/* Return a CONSTRUCTOR for the common part of the type_info objects. This
@@ -999,12 +995,10 @@ get_pseudo_ti_init (tree type, tree var_desc, bool *non_public_p)
my_friendly_assert (at_eof, 20021120);
switch (TREE_CODE (type))
{
+ case OFFSET_TYPE:
+ return ptm_initializer (var_desc, type, non_public_p);
case POINTER_TYPE:
- if (TYPE_PTRMEM_P (type))
- return ptm_initializer (var_desc, type, non_public_p);
- else
- return ptr_initializer (var_desc, type, non_public_p);
- break;
+ return ptr_initializer (var_desc, type, non_public_p);
case ENUMERAL_TYPE:
return generic_initializer (var_desc, type);
break;
@@ -1164,8 +1158,10 @@ get_pseudo_ti_desc (tree type)
{
switch (TREE_CODE (type))
{
+ case OFFSET_TYPE:
+ return ptm_desc_type_node;
case POINTER_TYPE:
- return TYPE_PTRMEM_P (type) ? ptm_desc_type_node : ptr_desc_type_node;
+ return ptr_desc_type_node;
case ENUMERAL_TYPE:
return enum_desc_type_node;
case FUNCTION_TYPE: