aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/rtti.c
AgeCommit message (Collapse)AuthorFilesLines
2001-05-22class.c, [...]: Remove com_interface attribute support.Jason Merrill1-10/+0
* class.c, cp-tree.h, rtti.c: Remove com_interface attribute support. * tree.c (cp_valid_lang_attribute): Warn about use of com_interface attribute. From-SVN: r42465
2001-05-02call.c: NULL_PTR -> NULL.Kaveh R. Ghazi1-2/+2
cp: * call.c: NULL_PTR -> NULL. * class.c: Likewise. * cvt.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * except.c: Likewise. * init.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * tree.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. f: * com.c: NULL_PTR -> NULL. java: * decl.c: NULL_PTR -> NULL. * jcf-write.c: Likewise. From-SVN: r41762
2001-04-04cp-tree.h (OPERATOR_ASSIGN_FORMAT): Remove.Mark Mitchell1-0/+8
* cp-tree.h (OPERATOR_ASSIGN_FORMAT): Remove. (OPERATOR_FORMAT): Likewise. (OPERATOR_TYPENAME_FORMAT): Likewise. * operators.def: Remove old name-mangling information. * decl.c (grok_op_properties): Adjust accordingly. * lex.c (init_operators): Likewise. * rtti.c (get_tinfo_decl): Issue error messages about types that have variable size. From-SVN: r41076
2001-03-21pt.c (instantiate_decl): Abort if we see a member constant instantiation ↵Jason Merrill1-1/+1
that doesn't already have its... * pt.c (instantiate_decl): Abort if we see a member constant instantiation that doesn't already have its initializer. Downgrade explicit instantiation without definition to pedwarn. * cp-tree.h (DECL_TINFO_FN_P, SET_DECL_TINFO_FN_P): Remove. * class.c (build_vtable_entry): Don't check DECL_TINFO_FN_P. (import_export_decl): Check tinfo_decl_p, not DECL_TINFO_FN_P. * cp-tree.h (CLASSTYPE_VTABLE_NEEDS_WRITING): Remove. (pending_vtables): Remove. * decl2.c (pending_vtables): Remove. (import_export_vtable): Use CLASSTYPE_INTERFACE_ONLY, not CLASSTYPE_VTABLE_NEEDS_WRITING. (import_export_class): Likewise. (init_decl2): Don't mark pending_vtables. * lex.c (handle_pragma_vtable): Just sorry. * pt.c (instantiate_class_template): Don't mess with CLASSTYPE_VTABLE_NEEDS_WRITING. (mark_class_instantiated): Likewise. * ptree.c (print_lang_type): Don't print it. * semantics.c (begin_class_definition): Don't set it. * pt.c (template_tail): Replace with last_pending_template. (maybe_templates, maybe_template_tail): Remove. (add_pending_template): Adjust. (instantiate_pending_templates): Adjust. * cp-tree.h (struct saved_scope): Remove lang_stack field. (current_lang_stack): Remove. * decl.c (maybe_push_to_top_level): Don't initialize it. (duplicate_decls): Use current_lang_depth. (xref_basetypes): Likewise. * class.c (current_lang_depth): New fn. (push_lang_context): Use more varray functionality. (pop_lang_context): Likewise. From-SVN: r40724
2001-03-19Compute DECL_ASSEMBLER_NAME lazily.Mark Mitchell1-4/+4
* tree.h (DECL_ASSEMBLER_NAME): Compute it lazily. (DECL_ASSEMBLER_NAME_SET_P): New macro. (SET_DECL_ASSEMBLER_NAME): Likewise. (COPY_DECL_ASSEMBLER_NAME): Likewise. (set_decl_assembler_name): Declare. (lang_set_decl_assembler_name): Likewise. * tree.c (lang_set_decl_assembler_name): New variab.e (set_decl_assembler_name): New function. (init_obstacks): Set lang_set_decl_assembler_name. (build_decl): Don't set DECL_ASSEMBLER_NAME. * c-decl.c (duplicate_decls): Use SET_DECL_ASSEMBLER_NAME, COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME where it's not necessary. (builtin_function): Likewise. (finish_decl): Likewise. * dbxout.c (dbxout_type_methods): Likewise. * ggc-common.c (ggc_mark_trees): Likewise. * profile.c (output_func_start_profiler): Likewise. * varasm.c (make_decl_rtl): Likewise. * class.c (get_vtable_decl): Use SET_DECL_ASSEMBLER_NAME, COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME where it's not necessary. (add_method): Remove optimization involving comparison of DECL_ASSEMBLER_NAME. (build_vtbl_or_vbase_field): Use SET_DECL_ASSEMBLER_NAME, COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME where it's not necessary. (check_methods): Likewise. (build_clone): Likewise. (built_vtt): Likewise. * cp-tree.h (DECL_NEEDED_P): Likewise. * decl.c (pushtag): Likewise. (duplicate_decls): Likewise. (pushdecl): Likewise. (builtin_function): Likewise. (build_library_fn_1): Set DECL_LANGUAGE for library functions. (build_cp_library_fn): Likewise. (maybe_commonize_var): Use SET_DECL_ASSEMBLER_NAME, COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME where it's not necessary. (make_rtl_for_nonlocal_decl): Likewise. (cp_finish_decl): Likewise. (grokfndecl): Likewise. (grokvardecl): Likewise. (grokdeclarator): Likewise. (start_function): Likewise. (cp_missing_return_ok_p): Likewise. * decl2.c (grokclassfn): Likewise. (check_classfn): Likewise. (finish_static_data_member_decl): Likewise. (grokfield): Likewise. * error.c (GLOBAL_IORD_P): Remove. (dump_global_iord): Improve output. (dump_decl): Avoid using DECL_ASSEMBLER_NAME. * except.c (nothrow_libfn_p): Summarily reject any function not in namespace-scope. * init.c (build_java_class_ref): Don't explicitly set DECL_ASSEMBLER_NAME after calling mangle_decl. * mangle.c (mangle_decl_string): Handle extern "C" functions. (mangle_decl): Set the DECL_ASSEMBLER_NAME for the decl. * method.c (set_mangled_name_for_decl): Don't explicitly set DECL_ASSEMBLER_NAME after calling mangle_decl. (make_thunk): Explicitly set the DECL_ASSEMBLER_NAME and IDENTIFIER_GLOBAL_VALUE for the thunk. * pt.c (set_mangled_name_for_template_decl): Remove. (check_explicit_specialization): Don't use it. (looup_template_class): Don't set DECL_ASSEMBLER_NAME. (tsubst_friend_function): Likewise. (tsubst_decl): Likewise. (regenerate_decl_from_template): Use COPY_DECL_ASSEMBLER_NAME. * rtti.c (get_tinfo_decl): Use SET_DECL_ASSEMBLER_NAME, COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME where it's not necessary. (tinfo_base_init): Likewise. (create_real_tinfo_var): Likewise. * search.c (looup_field_1): Likewise. * semantics.c (finish_named_return_value): Likewise. * tree.c (init_tree): Set lang_set_decl_assembler_name. * com.c (builtin_function): Use SET_DECL_ASSEMBLER_NAME. * class.c (build_class_ref): Use SET_DECL_ASSEMBLER_NAME. (layout_class): Likewise. (layout_class_method): Likewise. (emit_register_classes): Likewise. * decl.c (builtin_function): Likewise. (give_name_to_locals): Likewise. From-SVN: r40642
2001-02-18invoke.texi (-fsquangle): Remove documentation.Mark Mitchell1-88/+28
* invoke.texi (-fsquangle): Remove documentation. (-fname-mangling-version): Likewise. * cp-tree.h (new_abi_rtti_p): Remove. (name_mangling_version): Likewise. (flag_do_squangling): Likewise. * class.c (build_rtti_vtbl_entries): Remove old ABI support. * decl.c (grokfndecl): Likewise. * decl2.c (name_mangling_version): Remove. (flag_do_squangling): Likewise. (lang_f_options): Remove `squangle'. (unsupported_options): Add `squangle'. (cxx_decode_option): Issue a warning about uses of -fname-mangling-version. (finish_file): Remove old ABI support. * pt.c (check_explicit_specialization): Likewise. (tsubst_decl): Likewise. * rtti.c (init_rtti_processing): Likewise. (build_headof): Likewise. (get_tinfo_decl_dynamic): Likewise. (tinfo_from_decl): Likewise. (build_dynamic_cast_1): Likewise. (synthesize_tinfo_var): Likewise. * init.c (build_new): Allow enumeration types for the array-bounds in a direct-new-declarator. From-SVN: r39845
2001-02-12Remove old ABI support.Mark Mitchell1-469/+16
From-SVN: r39599
2001-02-04cp-tree.h (CLASSTYPE_INTERFACE_UNKNOWN): Fix formatting.Mark Mitchell1-26/+52
* cp-tree.h (CLASSTYPE_INTERFACE_UNKNOWN): Fix formatting. Document. (CLASSTYPE_INTERFACE_KNOWN): Likewise. (SET_CLASSTYPE_INTERFACE_UNKNOWN_X): Likewise. (SET_CLASSTYPE_INTERFACE_UNKNOWN): Likewise. (SET_CLASSTYPE_INTERFACE_KNOWN): Likewise. * decl.c (maybe_commonize_var): Use the new name-mangling where appropriate. * decl2.c (comdat_linkage): Enhance comments. Make all compiler-generated things static, if COMDAT is not available. (get_tinfo_decl): Do not make typeinfo objects that belong in the library COMDAT. (tinfo_base_init): Use the correct mangled name for typeinfo strings, and push them into the global scope. (typeinfo_in_lib_p): New function. (synthesize_tinfo_var): Use it. (create_real_tinfo_var): Likewise. From-SVN: r39437
2001-01-29stmt.c (estimate_case_costs): Use integer_minus_one_node.Kaveh R. Ghazi1-1/+1
* stmt.c (estimate_case_costs): Use integer_minus_one_node. * tree.c (build_common_tree_nodes_2): Set integer_minus_one_node. * tree.h (tree_index): Add new element TI_INTEGER_MINUS_ONE. (integer_minus_one_node): Define. ch: * ch-tree.h (integer_minus_one_node): Moved to top level gcc directory. * decl.c (integer_minus_one_node): Likewise. (init_decl_processing): Don't set integer_minus_one_node. cp: * cp-tree.h (cp_tree_index): Delete CPTI_MINUS_ONE. (minus_one_node): Moved to top level gcc directory. Renamed to integer_minus_one_node. * init.c (init_init_processing): Don't set minus_one_node. (build_vec_init): Use integer_minus_one_node. * rtti.c (get_tinfo_decl_dynamic): Likewise. From-SVN: r39325
2001-01-28configure.in: Arrange to include defaults.h in [ht]config.h/tm.h.Kaveh R. Ghazi1-2/+1
* configure.in: Arrange to include defaults.h in [ht]config.h/tm.h. * Makefile.in: Remove all dependencies on defaults.h. * builtins.c: Don't include defaults.h. * c-common.c: Likewise. * c-decl.c: Likewise. * c-pragma.c: Likewise. * c-typeck.c: Likewise. * combine.c: Likewise. * i386.c: Likewise. * frame-ia64.c: Likewise. * cppexp.c: Likewise. * crtstuff.c: Likewise. * dbxout.c: Likewise. * dwarf2out.c: Likewise. * dwarfout.c: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * frame-dwarf2.c: Likewise. * libgcc2.c: Likewise. * optabs.c: Likewise. * profile.c: Likewise. * sdbout.c: Likewise. * toplev.c: Likewise. * tradcif.y: Likewise. * tree.c: Likewise. * varasm.c: Likewise. ch: * Makefile.in: Remove all dependencies on defaults.h. * decl.c: Don't include defaults.h. * timing.c: Likewise. cp: * Make-lang.in: Remove all dependencies on defaults.h. * call.c: Don't include defaults.h. * decl.c: Likewise. * decl2.c: Likewise. * except.c: Likewise. * pt.c: Likewise. * rtti.c: Likewise. * tree.c: Likewise. * typeck.c: Likewise. f: * Make-lang.in: Remove all dependencies on defaults.h. * com.c: Don't include defaults.h. java: * Make-lang.in: Remove all dependencies on defaults.h. * decl.c: Don't include defaults.h. * expr.c: Likewise. * parse.y: Likewise. From-SVN: r39308
2001-01-03class.c (invalidate_class_lookup_cache): Zero the previous_class_values.Mark Mitchell1-1/+1
* class.c (invalidate_class_lookup_cache): Zero the previous_class_values. * cp-tree.h (TMPL_PARMS_DEPTH): Use TREE_INT_CST_LOW, not TREE_INT_CST_HIGH. (CLASSTYPE_TEMPLATE_LEVEL): Likewise. * decl.c (free_bindings): New variable. (push_binding): Don't create a new binding if we have one on the free list. (pop_binding): Put old bindings on the free list. (init_decl_processing): Use size_int, not build_int_2. Register free_bindings as a GC root. (cp_make_fname_decl): Use size_int, not build_int_2. (push_inline_template_parms_recursive): Likewise. (end_template_parm_list): Likewise. (for_each_tempalte_parm): Do not use walk_tree_without_duplicates. (tsubst_template_parms): Use size_int, not build_int_2. (tsubst): Likewise. * rtti.c (get_vmi_pseudo_type_info): Likewise. From-SVN: r38641
2000-11-19decl.c (init_decl_processing): Correct name of pure virtual function under ↵Mark Mitchell1-2/+6
the new ABI. * decl.c (init_decl_processing): Correct name of pure virtual function under the new ABI. * rtti.c (throw_bad_cast): Likewise, for bad cast function. (throw_bad_typeid): Likewise for bad typeid function. * libsupc++/exception_support.cc (__throw_bad_cast): Name it __cxa_bad_cast under the new ABI. (__throw_bad_typeid): Name it __cxa_bad_typeid under the new ABI. * libsupc++/pure.cc (__pure_virtual): Name it __cxa_pure_virtual under the new ABI. From-SVN: r37575
2000-10-18c-common.h (flag_no_builtin): Declare.Mark Mitchell1-1/+1
* c-common.h (flag_no_builtin): Declare. (flag_no_nonansi_builtin): Likewise. (c_common_nodes_and_builtins): Change prototype. * c-common.c (flag_no_builtin): New variable. (flag_no_nonansi_builtin): Likewise. (c_common_nodes_and_builtins): Remove parameters. Adjust accordingly. * c-decl.c (flag_no_builtin): Remove. (flag_no_nonansi_builtin): Likewise. (init_decl_processing): Adjust call to c_common_nodes_and_builtins. * cp-tree.h (cp_tree_index): Add CPTI_FAKE_STD. (fake_std_node): New macro. * decl.c (in_std): Rename to ... (in_fake_std): ... this. (flag_no_builtin): Remove. (flag_no_nonansi_builtin): Likewise. (walk_namespaces_r): Use fake_std_node. (push_namespace): Use std_identifier. (pop_namespace): Use in_fake_std. (lookup_name_real): Use fake_std_node. (init_decl_processing): When -fhonor-std, create the `std' namespace. Don't create a dummy fake_std_node in that case. Adjust call to c_common_nodes_and_builtins. Use std_identifier. (builtin_function): Put builtins whose names don't begin with `_' in the std namespace. * decl2.c (flag_no_builtin): Remove. (flag_no_nonansi_builtin): Likewise. (set_decl_namespace): Use fake_std_node. (validate_nonmember_using_decl): Likewise. (do_using_directive): Likewise. (handle_class_head): Likewise. * dump.c (dequeue_and_dump): Likewise. * except.c (init_exception_processing): Use std_identifier. * init.c (build_member_call): Use fake_std_node. * rtti.c (init_rtti_processing): Use std_identifier. From-SVN: r36940
2000-09-12c-common.h (genrtl_clear_out_block): Remove.Mark Mitchell1-1/+0
* c-common.h (genrtl_clear_out_block): Remove. * c-semantics.c (genrtl_clear_out_block): Remove. (genrtl_while_stmt): Don't call it. (genrtl_for_stmt): Likewise. * cp-tree.h (struct saved_scope): Remove x_function_parms. (current_function_parms): Don't define. (struct cp_language_function): Remove parms_stored. (current_function_just_assigned_this): Don't define. (current_function_parms_stored): Likewise. (static_ctors): Declare. (static_dtors): Likewise. (SF_EXPAND): Don't define. (expand_start_early_try_stmts): Remove declaration. (store_parm_decls): Likewise. * decl.c (static_ctors): Don't declare. (static_dtors): Likewise. (struct binding_level): Remove this_block. (poplevel): Remove dead code. (set_block): Likewise. (mark_binding_level): Don't mark this_block. (mark_saved_scope): Don't mark x_function_parms. (init_decl_processing): Don't add current_function_parms as a GC root. (check_function_type): Change prototype. (start_function): Remove RTL-generation code. (expand_start_early_try_stmts): Remove. (store_parm_decls): Give it internal linkage. Remove RTL-generation code. (finish_function): Remove RTL-generation code. * decl2.c (static_ctors): Fix formatting. (static_dtors): Likewise. * method.c (use_thunk): Don't call store_parm_decls. (synthesize_method): Likewise. * optimize.c (maybe_clone_body): Likewise. * parse.y (fn.def2): Likewise. (.set_base_init): Likewise. (nodecls): Likewise. * pt.c (instantiate_decl): Likewise. * rtti.c (synthesize_tinfo_fn): Likewise. * semantics.c (genrtl_try_block): Simplify. (expand_body): Use genrtl_start_function and genrtl_finish_function. (genrtl_start_function): New function. (genrtl_finish_function): Likewise. From-SVN: r36350
2000-09-11defaults.h: Provide default definitions for...Zack Weinberg1-4/+1
* defaults.h: Provide default definitions for: CHAR_TYPE_SIZE, SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, WCHAR_TYPE_SIZE, FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, LONG_DOUBLE_TYPE_SIZE, and WCHAR_UNSIGNED. * cppexp.c, dwarfout.c, dwarf2out.c, emit-rtl.c, final.c, optabs.c, profile.c, sdbout.c, tradcif.y, tree.c, ch/decl.c, ch/timing.c, cp/decl.c, cp/rtti.c, f/com.c, f/com.h, java/decl.c, java/expr.c: Include defaults.h if not already included. Don't define the above macros. * Makefile.in, ch/Makefile.in, cp/Makefile.in, f/Makefile.in: Update dependencies. From-SVN: r36307
2000-08-09rtti.c (build_dynamic_cast_1): Set "C" linkage for new abi runtime.Nathan Sidwell1-5/+1
* rtti.c (build_dynamic_cast_1): Set "C" linkage for new abi runtime. * cp/tinfo.cc (__dynamic_cast): Likewise. * cp/inc/cxxabi.h (__dynamic_cast): Likewise. From-SVN: r35588
2000-07-10cp-tree.h (char_type_p): New function.Mark Mitchell1-11/+0
* cp-tree.h (char_type_p): New function. * decl.c (init_decl_processing): Don't initialize signed_wchar_type_node or unsigned_wchar_type_node. (complete_array_type): Handle brace-enclosed string-constants. * rtti.c (emit_support_tinfos): Remove #if 0'd code. * tree.c (char_type_p): New function. * typeck2.c (digest_init): Use char_type_p. From-SVN: r34936
2000-06-30c-common.c: Include c-common.h, not c-lex.h or c-tree.h.Mark Mitchell1-5/+5
* c-common.c: Include c-common.h, not c-lex.h or c-tree.h. * c-common.h (flag_const_strings): Declare. (warn_format): Likewise. (flag_traditional): Likewise. (flag_isoc99): Likewise. (warn_parentheses): Likewise. (warn_conversion): Likewise. (C_TYPE_OBJECT_P): Likewise. (C_TYPE_INCOMPLETE_P): Likewise. (C_TYPE_FUNCTION_P): Likewise. (C_TYPE_OBJECT_OR_INCOMPLETE_P): Likewise. (C_EXP_ORIGINAL_CODE): Likewise. (build_unary_op): Likewise. (build_binary_op): Likewise. (lvalue_p): Likewise. (default_conversion): Likewise. (common_type): Likewise. * c-tree.h (C_TYPE_OBJECT_P): Remove. (C_TYPE_INCOMPLETE_P): Likewise. (C_TYPE_FUNCTION_P): Likewise. (C_TYPE_OBJECT_OR_INCOMPLETE_P): Likewise. (C_EXP_ORIGINAL_CODE): Likewise. (common_type): Likewise. (default_conversion): Likewise. (build_binary_op): Likewise. (build_unary_op): Likewise. (lvalue_p): Likewise. (flag_const_strings): Likewise. (warn_format): Likewise. (warn_conversion): Likewise. (flag_traditional): Likewise. (flag_isoc99): Likewise. (warn_parentheses): Likewise. * cp-tree.h (flag_const_strings): Remove. (warn_parentheses): Likewise. (warn_format): Likewise. (common_type): Likewise. (default_conversion): Likewise. (build_binary_op): Likewise. (cp_build_binary_op): New macro. * call.c (build_new_op): Use cp_build_binary_op instead of build_binary_op. * class.c (build_vtable_entry_ref): Likewise. * decl.c (expand_static_init): Likewise. (compute_array_index_type): Likewise. (build_enumerator): Likewise. * decl2.c (delete_sanity): Likewise. (start_static_initialization_or_destruction): Likewise. * error.c (dump_type_suffix): Likewise. * init.c (resolve_offset_ref): Likewise. (build_new): Likewise. (build_new_1): Likewise. (build_vec_delete_1): Likewise. (build_vec_init): Likewise. (build_delete): Likewise. * rtti.c (synthesize_tinfo_fn): Likewise. (synthesize_tinfo_var): Likewise. * search.c (expand_upcast_fixups): Likewise. (fixup_all_virtual_upcast_offsets): Likewise. * typeck.c (build_array_ref): Likewise. (get_member_function_from_ptrfunc): Likewise. (build_binary_op): Add parameter. (pointer_int_sum): Use cp_build_binary_op. (pointer_diff): Likewise. (build_modify_expr): Likewise. (get_delta_difference): Likewise. (build_ptrmemfunc): Likewise. From-SVN: r34796
2000-06-20* rtti.c (get_base_offset): Cope when vbase field is in a base.Nathan Sidwell1-2/+17
From-SVN: r34619
2000-06-20call.c (build_conditional_expr): Use VOID_TYPE_P.Nathan Sidwell1-4/+3
* call.c (build_conditional_expr): Use VOID_TYPE_P. * cvt.c (cp_convert_to_pointer): Likewise. (convert_to_void): Likewise. * error.c (dump_expr): Likewise. * except.c (complete_ptr_ref_or_void_ptr_p): Likewise. * init.c (build_delete): Likewise. * method.c (emit_thunk): Likewise. * optmize.c (declare_return_variable): Likewise. * rtti.c (get_tinfo_decl_dynamic): Likewise. (get_typeid): Likewise. (build_dynamic_cast_1): Likewise. * typeck.c (composite_pointer_type): Likewise. (common_type): Likewise. (build_indirect_ref): Likewise. (build_binary_op): Likewise. (build_x_compound_expr): Likewise. (check_return_expr): Likewise. * typeck2.c (add_exception_specifier): Likewise. * mangle.c (write_method_parms): Use direct comparison for end of parmlist. From-SVN: r34617
2000-06-14tree.h (TYPE_USER_ALIGN, [...]): Define.Jakub Jelinek1-0/+2
* tree.h (TYPE_USER_ALIGN, DECL_USER_ALIGN): Define. (struct tree_type, struct tree_decl): Add user_align member. * stor-layout.c (layout_decl): Set DECL_USER_ALIGN. (place_union_field): If BIGGEST_FIELD_ALIGNMENT is defined and DECL_USER_ALIGN 0, cap alignment to this value. (place_field): Likewise. (finalize_type_size): Set TYPE_USER_ALIGN. (layout_type): Likewise. (initialize_sizetypes): Likewise. * c-common.c (decl_attributes): Set TYPE_USER_ALIGN resp. DECL_USER_ALIGN to 1. * c-decl.c (duplicate_decls): Set DECL_USER_ALIGN. (xfer_tag): Set TYPE_USER_ALIGN. (finish_struct): Set DECL_USER_ALIGN resp. TYPE_USER_ALIGN. (finish_enum): Likewise. * stmt.c (expand_decl): Set DECL_USER_ALIGN. (expand_anon_union_decl): Likewise. * tree.c (make_node): Set DECL_USER_ALIGN resp. TYPE_USER_ALIGN. (build_index_type): Set TYPE_USER_ALIGN. (build_range_type): Likewise. (build_common_tree_nodes_2): Likewise. * tm.texi (BIGGEST_FIELD_ALIGNMENT): Document the changed meaning. ch/: * decl.c (init_decl_processing): Set TYPE_USER_ALIGN. (layout_enum): Set DECL_USER_ALIGN resp. TYPE_USER_ALIGN. * typeck.c (layout_chill_range_type): Set TYPE_USER_ALIGN. (apply_chill_field_layout): Set DECL_USER_ALIGN. (layout_chill_struct_type): Set TYPE_USER_ALIGN. cp/: * class.c (build_secondary_vtable): Set DECL_USER_ALIGN. (check_bitfield_decl, check_field_decl): Likewise. (build_vtbl_or_vbase_field, build_base_field): Likewise. (layout_class_type): Set DECL_USER_ALIGN resp. CLASSTYPE_USER_ALIGN. * decl.c (record_unknown_type): Set TYPE_USER_ALIGN. (xfer_tag, finish_enum): Likewise. * decl2.c (finish_builtin_type): Likewise. * init.c (init_init_processing): Likewise. * pt.c (instantiate_class_template): Likewise. * rtti.c (get_tinfo_decl, synthesize_tinfo_fn): Set DECL_USER_ALIGN. * cp-tree.h (struct lang_type): Add user_align member. (CLASSTYPE_USER_ALIGN): Define. f/: * com.c (ffecom_transform_common_): Set DECL_USER_ALIGN. (ffecom_transform_equiv_, ffecom_decl_field): Likewise. (ffecom_init_0): Set DECL_USER_ALIGN resp. TYPE_USER_ALIGN. (duplicate_decls): Set DECL_USER_ALIGN. java/: * typeck.c (build_java_array_type): Set TYPE_USER_ALIGN. * parse.y (java_complete_class): Set DECL_USER_ALIGN. * parse.c: Rebuilt. From-SVN: r34541
2000-06-09revert mangling patchJason Merrill1-13/+32
From-SVN: r34471
2000-06-08invoke.texi: Remove documentation for -fsquangle and -fname-mangling-version.Mark Mitchell1-32/+13
* invoke.texi: Remove documentation for -fsquangle and -fname-mangling-version. Remove old ABI mangling code. * cp-tree.h (cp_tree_index): Remove CPTI_TINFO_DECL_ID and CPTI_TINFO_VAR_ID. (tinfo_decl_id): Remove. (tinfo_var_id): Likewise. (name_mangling_version): Likewise. (flag_do_squangling): Likewise. (get_vtt_name): Likewise. (init_method): Likewise. (build_overload_name): Likewise. (build_static_name): Likewise. (build_decl_overload_real): Likewise. (build_overload_with_type): Likewise. (build_destructor_name): Likewise. (get_id_2): Likewise. (get_ctor_vtbl_name): Likewise. (mangle_typeinfo_fn_for_type): New function. (mangle_java_reflection_var_for_type): Likewise. * call.c (build_new_method_call): Use mangle_vtt_for_type. * class.c (get_vtable_name): Remove. (get_vtt_name): Remove. (get_vtable_decl): Use mangle_vtbl_for_type. (build_vtt): Likewise. (build_ctor_vtbl_group): Remove old ABI mangling support. * decl.c (pushtag): Likewise. (maybe_commonize_var): Use set_mangled_name_for_decl. (grokfndecl): Remove old ABI mangling support. (grokvardecl): Likewise. (grokdeclarator): Likewise. (grok_op_properties): Adjust use of DEF_OPERATOR. * decl2.c (name_mangling_version): Remove. (lang_f_options): Remove squangle. (unsupported_options): Add squangle. (lang_decode_options): Don't set flag_do_squangling. Issue a warning for -fname-mangling-version. (grokclassfn): Remove old ABI mangling support. (finish_static_data_member_decl): Likewise. (grokfield): Likewise. (grokoptypename): Likewise. (get_sentry): Likewise. * init.c (build_java_class_ref): Use mangle_java_reflection_var_for_type. * lex.c (init_operators): Adjust use of DEF_OPERATOR. (init_parse): Call init_mangle, not init_method. * mangle.c (write_special_name_constructor): Handle maybe-in-charge constructors. (write_special_name_destructor): Handle maybe-in-charge destructors. (write_expression): Tweak code to handle non-type template arguments with reference type. (mangle_typeinfo_fn_for_type): New function. (mangle_java_reflection_var_for_type): Likewise. (mangle_conv_op_name_for_type): Don't use a name that the user could type. * method.c (enum mangling_flags): Remove. (mangling_flags): Likewise. (obstack_chunk_alloc): Likewise. (obstack_chunk_free): Likewise. (OB_INIT): Likewise. (OB_PUTC): Likewise. (OB_PUTC2): Likewise. (OB_PUTS): Likewise. (OB_PUTID): Likewise. (OB_PUTCP): Likewise. (OB_FINISH): Likewise. (OB_LAST): Likewise. (btypelist): Likewise. (ktypelist): Likewise. (maxbtype): Likewise. (maxktype): Likewise. (typevec): Likewise. (maxtype): Likewise. (init_method): Likewise. (digit_buffer): Likewise. (nofold): Likewise. (start_squangling): Likewise. (end_squangling): Likewise. (icat): Likewise. (dicat): Likewise. (old_backref_index): Likewise. (flush_repeats): Likewise. (is_back_referenceable_type): Likewise. (issue_nrepeats): Likewise. (check_ktype): Likewise. (issue_ktype): Likewise. (build_overload_nested_name): Likewise. (build_underscore_int): Likewise. (build_overload_scope_ref): Likewise. (mangle_expression): Likewise. (build_overload_int): Likewise. (mangled_C9x_name): Likewise. (build_overload_value): Likewise. (build_template_template_parm_names): Likewise. (build_template_parm_names): Likewise. (build_overload_identifier): Likewise. (build_qualified_name): Likewise. (build_mangled_name_for_type_with_Gcode): Likewise. (build_mangled_name_for_type): Likewise. (build_overload_name): Likewise. (build_mangled_name): Likewise. (process_modifiers): Likewise. (check_btype): Likewise. (process_overload_item): Likewise. (build_static_name): Likewise. (build_decl_overload_real): Likewise. (set_mangled_name_for_decl): Remove old ABI mangling support. (build_typename_overload): Remove. (build_overload_with_type): Remove. (get_id_2): Remove. (get_ctor_vtbl_name): Remove. (build_destructor_name): Likewise. (set_mangled_name_for_decl): Likewise. (make_thunk): Remove old ABI mangling support. * operators.def: Likewise. * pt.c (check_explicit_specialization): Don't call set_mangled_name_for_template_decl. (lookup_template_class): Remove old ABI mangling support. (tsubst_friend_function): Update comment. (tsubst_decl): Remove old ABI mangling support. (tsubst_copy): Likewise. (set_mangled_name_for_template_decl): Remove. * rtti.c (init_rtti_processing): Use std_identifier. Don't set tinfo_decl_id or tinfo_var_id. (get_tinfo_var): Use mangle_typeinfo_for_type. (tinfo_name): Remove old ABI mangling support. (get_tinfo_decl): Likewise. (tinfo_base_init): Likewise. (create_real_tinfo_var): Use a name that the user can't type. * tinfo2.cc (BUILTIN): Adjust to use new mangling. From-SVN: r34458
2000-06-04Make-lang.in (CXX_SRCS): Add mangle.c.Alex Samuel1-7/+28
* Make-lang.in (CXX_SRCS): Add mangle.c. * Makefile.in (CXX_OBJS): Add mangle.o. (mangle.o): New rule. Co-Authored-By: Mark Mitchell <mark@codesourcery.com> From-SVN: r34394
2000-05-26cp-tree.h (CPTI_PTMD_DESC_TYPE): Rename to ...Nathan Sidwell1-15/+21
* cp-tree.h (CPTI_PTMD_DESC_TYPE): Rename to ... (CPTI_PTMD_DESC_TYPE): ... here. (ptmd_desc_type_node): Rename to ... (ptm_desc_type_node): ... here. * decl.c: Likewise. * rtti.c (ptmd_initializer): Rename to ... (ptm_initializer): ... here. (sythesize_tinfo_var): Adjust. Deal with pointer to member function. (create_tinfo_types): Adjust. From-SVN: r34190
2000-05-24cp-tree.h (lang_decl_flags): Rename mutable_flag to uninlinable and bitfield ↵Mark Mitchell1-18/+18
to tinfo_fn_p. * cp-tree.h (lang_decl_flags): Rename mutable_flag to uninlinable and bitfield to tinfo_fn_p. (DECL_TINFO_FN_P): Adjust. (SET_DECL_TINFO_FN_P): Likewise. (DECL_MUTABLE_P): Likewise. (DECL_C_BIT_FIELD): Likewise. (SET_DECL_C_BIT_FIELD): Likewise. (CLEAR_DECL_C_BIT_FIELD): Likewise. (DECL_UNINLINABLE): Likewise. * class.c (alter_access): Call retrofit_lang_decl if ncessary. (handle_using_decl): Remove assertion. (build_vtbl_or_vbase_field): Use build_decl, not build_lang_decl, to build FIELD_DECLs. (build_base_field): Likewise. (layout_class_type): Likewise. * decl.c (init_decl_processing): Likewise. (build_ptrmemfunc_type): Likewise. (grokdeclarator): Likewise. * decl2.c (grok_x_components): Likewise. * except.c (call_eh_info): Likewise. * init.c (init_init_processing): Likewise. * rtti.c (expand_class_desc): Likewise. (create_pseudo_type_info): Likewise. (get_vmi_pseudo_type_info): Likewise. (create_tinfo_types): Likewise. * ptree.c (print_lang_decl): Adjust. * typeck.c (build_component_ref): Don't check DECL_LANG_SPECIFIC before checking DECL_MUTABLE_P. From-SVN: r34125
2000-05-19Don't create a separate copy of virtual bases for the CLASSTYPE_VBASECLASSES ↵Mark Mitchell1-39/+1
list. Don't create a separate copy of virtual bases for the CLASSTYPE_VBASECLASSES list. * cp-tree.h (CLASSTYPE_VBASECLASSES): Change documentation. (BINFO_FOR_VBASE): Remove. (CANONICAL_BINFO): Adjust. (binfo_for_vbase): New function. * class.c (build_vbase_pointer_fields): Use binfo_for_vbase instead of BINFO_FOR_VBASE. (build_vbase_pointer): Likewise. (build_secondary_vtable): Likewise. (dfs_mark_primary_bases): Likewise. (mark_primary_bases): Likewise. (layout_nonempty_base_or_field): Likewise. (dfs_set_offset_for_shared_vbases): Likewise. (dfs_set_offset_for_unshared_vbases): Likewise. (layout_virtual_bases): Likewise. Adjust for changes to the CLASSTYPE_VBASECLASSES list. (dump_class_hierarchy_r): Use binfo_for_vbase instead of BINFO_FOR_VBASE. (dump_class_hierarchy): Likewise. (finish_vtbls): Likewise. (build_vtbl_initializer): Adjust for changes to the CLASSTYPE_VBASECLASSES list. (build_vbase_offset_vtbl_entries): Use binfo_for_vbase. * decl.c (finish_destructor_body): Adjust for changes to the CLASSTYPE_VBASECLASSES list. * init.c (sort_base_init): Use binfo_for_vbase. (construct_virtual_bases): Adjust for changes to the CLASSTYPE_VBASECLASSES list. (expand_member_init): Use binfo_for_vbase. (build_vbase_delete): Adjust for changes to the CLASSTYPE_VBASECLASSES list. * method.c (do_build_copy_constructor): Likewise. * rtti.c (get_base_offset): Use binfo_for_vbase. (expand_class_desc): Remove #if 0'd code. * search.c (struct vbase_info): Remove vbase_types. (get_base_distance): Use binfo_for_vbase. (lookup_field_queue_p): Use CANONICAL_BINFO. (get_shared_vbase_if_not_primary): Use binfo_for_vbase. (get_pure_virtuals): Adjust for changes to the CLASSTYPE_VBASECLASSES list. (dfs_find_vbases): Use binfo_for_vbase. (dfs_init_vbase_pointers): Likewise. (init_vbase_pointers): Don't initialize vi.vbase_types. (virtual_context): Use binfo_for_vbase. (fixup_all_virtual_upcast_offsets): Adjust for changes to the CLASSTYPE_VBASECLASSES list. (expand_indirect_vtbls_init): Simplify. (dfs_get_vbase_types): Don't replicate virtual bases. (find_vbase_instance): Use binfo_for_vbase. (binfo_for_vbase): New function. * typeck.c (get_delta_difference): Use binfo_for_vbase. From-SVN: r34040
2000-05-06rtti.c (ptmd_initializer): Set non-public, if class is incomplete.Nathan Sidwell1-1/+4
* rtti.c (ptmd_initializer): Set non-public, if class is incomplete. * inc/cxxabi.h (__dynamic_cast): Explicitly say extern "C++". (__cxa_vec_new, __cxa_vec_ctor, __cxa_vec_dtor, __cxa_vec_delete): Likewise. * tinfo.cc (__dynamic_cast): Likewise. * vec.cc (__cxa_vec_new, __cxa_vec_ctor, __cxa_vec_dtor, __cxa_vec_delete): Likewise. From-SVN: r33726
2000-04-20rtti.c (init_rtti_processing): Set tinfo_var_id in new-abi.Nathan Sidwell1-22/+106
* rtti.c (init_rtti_processing): Set tinfo_var_id in new-abi. (target_incomplete_p): New function. (tinfo_base_init): Create comdat NTBS name variable. (ptr_initializer): Add non_public parameter. Calculate it. (ptmd_initializer): Likewise. (synthesize_tinfo_var): Adjust. Emit incomplete class tinfo. (create_real_tinfo_var): Add non_public parameter. Use it. Push proxy into global namespace. * inc/cxxabi.h (__pointer_type_info::incomplete_class_mask): New enumeration. * inc/typeinfo (type_info::before, type_info::operator==): Compare __name addresses. * tinfo2.cc: Remove new-abi builtins comment. From-SVN: r33281
2000-04-11cp-tre.h (finish_function): Change prototype.Mark Mitchell1-1/+1
* cp-tre.h (finish_function): Change prototype. * decl.c (end_cleanup_fn): Adjust caller. (finish_function): Take only one parameter. * decl2.c (finish_objects): Adjust caller. (finish_static_storage_duration_function): Likewise. * method.c (emit_thunk): Likewise. * parse.y: Likewise. * parse.c: Regenerated. * pt.c (instantiate_decl): Likewise. * rtti.c (synthesize_tinfo_fn): Likewise. * semantics.c (expand_body): Likewise. * cp-tree.h (copy_decl): New function. * class.c (finish_struct_1): Use it. * lex.c (copy_decl): Define it. * pt.c (tsubst_decl): Likewise. * tree.c (copy_template_template_parm): Likewise. From-SVN: r33079
2000-04-10class.c (instantiate_type): Handle object-relative template-id.Jason Merrill1-6/+11
* class.c (instantiate_type): Handle object-relative template-id. * semantics.c (finish_expr_stmt): Call convert_to_void here. * decl.c (cplus_expand_expr_stmt): Not here. * rtti.c (build_dynamic_cast_1): Call non_lvalue. Initialize exprtype earlier. * parse.y (fn.def1): Check for defining types in return types. * decl.c (check_tag_decl): Notice extra fundamental types. Diagnose empty decls in classes, too. * decl.c (grokdeclarator): Don't override an anonymous name if no declarator was given. * cvt.c (convert_to_void): Call resolve_offset_ref. * typeck.c (build_x_function_call): Abort if we get an OFFSET_REF. * decl2.c (decl_namespace): Handle getting a type. * typeck.c (build_c_cast): Re-enable warning for cast between pointer and integer of different size. From-SVN: r33066
2000-04-10cxxabi.h (__pointer_type_info): Add restrict and incomplete flags.Nathan Sidwell1-8/+12
* inc/cxxabi.h (__pointer_type_info): Add restrict and incomplete flags. (__pointer_type_info::__pointer_catch): New virtual function. (__pointer_to_member_type_info): Derive from __pointer_type_info. Adjust. (__pointer_to_member_type_info::__do_catch): Remove. (__pointer_to_member_type_info::__is_pointer_p): Declare. (__pointer_to_member_type_info::__pointer_catch): Declare. * rtti.c (qualifier_flags): Add restrict flag. (ptmd_initializer): Reorder members. (create_tinfo_types): Expand comments. Reorder ptmd_desc_type_node members. * tinfo2.cc (__pointer_to_member_type_info::__is_pointer_p): Implement. (__pointer_type_info::__do_catch): Move specific code into __pointer_catch. Call it. (__pointer_type_info::__pointer_catch): Non-pointer-to-member specific catch checking. Fix void conversion check. (__pointer_to_member_type_info::__do_catch): Remove. (__pointer_to_member_type_info::__pointer_catch): Implement. From-SVN: r33061
2000-04-06cp-tree.h (lang_decl_flags): Rename saved_inline to deferred.Mark Mitchell1-1/+1
* cp-tree.h (lang_decl_flags): Rename saved_inline to deferred. (DECL_SAVED_INLINE): Rename to ... (DECL_DEFERRED_FN): ... this. (in_function_p): Remove declaration. (mark_inline_for_output): Rename to ... (defer_fn): ... this. * decl.c (finish_function): Adjust call to mark_inline_for_output. (in_function_p): Remove definition. * decl2.c (saved_inlines): Rename to ... (deferred_fns): ... this. (saved_inlines_used): Rename to ... (deferred_fns_used): ... this. (mark_inline_for_output): Rename to ... (defer_fn): ... this. (finish_file): Adjust accordingly. (init_decl2): Likewise. * lex.c (cons_up_default_function): Likewise. * pt.c (mark_decl_instantiated): Likewise. (instantiate_decl): Don't set DECL_DEFER_OUTPUT under any circumstances. * rtti.c (get_tinfo_decl): Adjust call to mark_inline_for_output. * semantics.c (expand_body): Defer more functions. From-SVN: r32973
2000-04-06rtti.c (dfs_class_hint_mark): New static function.Nathan Sidwell1-10/+60
* rtti.c (dfs_class_hint_mark): New static function. (dfs_class_hint_unmark): New static function. (class_hint_flags): Use them. From-SVN: r32966
2000-04-04cfns.gperf (hash, [...]): Prototype.Kaveh R. Ghazi1-1/+1
* cfns.gperf (hash, libc_name_p): Prototype. * rtti.c (build_dynamic_cast_1): Constification. * search.c (dfs_debug_unmarkedp, dfs_debug_mark): Unhide prototypes. * semantics.c (deferred_type_access_control): Prototype. From-SVN: r32909
2000-04-04Correct many new ABI issues regarding vbase and vcall offset layout.Mark Mitchell1-3/+6
Correct many new ABI issues regarding vbase and vcall offset layout. * cp-tree.h (BINFO_VTABLE): Document. (struct lang_type): Tweak formatting. (BINFO_PRIMARY_BINFO): Add to documentation. (CLASSTYPE_VSIZE): Fix typo in comment. (CLASSTYPE_VBASECLASSES): Update documentation. (BINFO_VBASE_MARKED): Remove. (SET_BINFO_VBASE_MARKED): Likewise. (CLEAR_BINFO_VBASE_MARKED): Likewise. (BINFO_FIELDS_MARKED): Remove. (SET_BINFO_FIELDS_MARKED): Likewise. (CLEAR_BINFO_FIELDS_MARKED): Likewise. (enum access_kind): New enumeration. (num_extra_vtbl_entries): Remove declaration. (size_extra_vtbl_entries): Likewise. (get_vtbl_decl_for_binfo): New function. (dfs_vbase_unmark): Remove declaration. (mark_primary_bases): Likewise. * class.c (SAME_FN): Remove. (struct vcall_offset_data_s): Move definition. (build_vbase_pointer): Use `build', not `build_binary_op', to access the vbase pointer under the new ABI. (build_vtable_entry_ref): Use get_vtbl_decl_for_binfo. (build_primary_vtable): Likewise. (dfs_mark_primary_bases): Move here from search.c. (mark_primary_bases): Likewise. (determine_primary_bases): Under the new ABI, don't make a base class a primary base just because we don't yet have any virtual functions. (layout_vtable_decl): Use get_vtbl_decl_for_binfo. (num_vfun_entries): Remove. (dfs_count_virtuals): Likewise. (num_extra_vtbl_entries): Likewise. (size_extra_vtbl_entries): Likewise. (layout_virtual_bases): Iterate in inheritance graph order under the new ABI. (finish_struct_1): Use TYPE_VFIELD, not CLASSTYPE_VSIZE, to indicate that a vfield is present. (init_class_processing): Initialize access_public_node, etc., from ak_public, etc. (get_vtbl_decl_for_binfo): New function. (dump_class_hierarchy_r): Likewise. (dump_class_hierarchy): Use it. (finish_vtbls): Build the vtbls in inheritance graph order. (dfs_finish_vtbls): Adjust call to build_vtbl_initializer. (initialize_vtable): Use get_vtbl_decl_for_binfo. (accumulate_vtbl_inits): Add comments explaining why a pre-order walk is required. (dfs_accumulate_vtbl_inits): Set BINFO_VTABLE to the location where the vptr points, even for primary vtables. (build_vtbl_initializer): Adjust handling of vbase and vcall offsets. (build_vcall_and_vbase_vtable_entries): New function. (dfs_build_vbase_offset_vtbl_entries): Remove. (build_vbase_offset_vtbl_entries): Reimplement. (dfs_build_vcall_offset_vtbl_entries): Don't include virtuals that were already handled in a primary base class vtable. (build_vcall_offset_vtbl_entries): Adjust. (build_rtti_vtbl_entries): Adjust. * decl2.c (output_vtable_inherit): Use get_vtbl_decl_for_binfo. * init.c (expand_virtual_init): Simplify. * repo.c (repo_get_id): Use get_vtbl_decl_for_binfo. * rtti.c (create_pseudo_type_info): Adjust calculation of vptr. * search.c (BINFO_ACCESS): New macro. (SET_BINFO_ACCESS): Likewise. (dfs_access_in_type): Manipulate access_kinds, not access nodes. (access_in_type): Likewise. (dfs_accessible_p): Likewise. (protected_accessible_p): Likewise. (lookup_fnfields_1): Adjust documentation. (dfs_mark_primary_bases): Move to class.c (mark_primary_bases): Likewise. (dfs_vbase_unmark): Remove. (virtual_context): Use BINFO_FOR_VBASE. (dfs_get_vbase_types): Simplify. (dfs_build_inheritance_graph_order): New function. (get_vbase_types): Use it. * tree.c (debug_binfo): Use get_vtbl_decl_for_binfo. * tinfo.cc (get_vbase_offset): New function. (__vmi_class_type_info::do_find_public_src): Use it. (__vmi_class_type_info::do_dyncast): Likewise. (__vmi_class_type_info::do_upcast): Likewise. From-SVN: r32905
2000-04-02cppinit.c (cpp_start_read): Turn off -Wtraditional if processing C++.Zack Weinberg1-4/+4
* cppinit.c (cpp_start_read): Turn off -Wtraditional if processing C++. * cpplib.c (_cpp_handle_directive): Improve warnings for traditional C and indented directives. * enquire.c, gsyslimits.h, limity.h, config/convex/fixinc.convex, fixinc/fixinc.irix, fixinc/fixinc.sco, fixinc/fixinc.wrap, fixinc/inclhack.def: Indent the # of #include_next one space. * cp/rtti.c: Un-indent #if and #endif. * cppexp.c (_cpp_parse_expr): If lex returns '#', it's a syntax error, but an error has already been printed. * cpplex.c (_cpp_parse_assertion): Give a more specific error message when called with nothing remaining on the line. (_cpp_lex_token): If _cpp_parse_assertion fails, return an OTHER token, not an ASSERTION. * cpplib.c (do_assert): When we create a 'base' node, clear its aschain pointer. * gcc.c-torture/compile/981211-1.c: Move to... * gcc.dg/cpp-as1.c: ...here. * gcc.dg/cpp-as2.c: New file. * gcc.dg/cpp-tradwarn1.c: Change warning regexps to match the compiler. From-SVN: r32870
2000-03-30rtti.c (class_hint_flags): Rename flags.Nathan Sidwell1-18/+20
* rtti.c (class_hint_flags): Rename flags. (class_initializer): Remove flags. (synthesize_tinfo_var): Combine offset and flags. Add flags for __vmi_class_type_info. (create_tinfo_types): Remove flags from __class_type_info and __si_class_type_info. Merge flags and offset from base_class_type_info. * inc/cxxabi.h (__base_class_info): Merge offset and vmi_flags. (__base_class_info::is_virtual_p): Adjust. (__base_class_info::is_public_p): Adjust. (__base_class_info::offset): New accessor. (__class_type_info::details): Remove member. (__class_type_info::__class_type_info): Lose details. (__class_type_info::detail_masks): Remove. (__si_class_type_info::__si_class_type_info): Lose details. (__vmi_class_type_info::details): New member. (__vmi_class_type_info::__vmi_class_type_info): Adjust. (__vmi_class_type_info::detail_masks): New member. * tinfo.cc (__class_type_info::do_upcast): Initialize result with unknown_details_mask. (__vmi_class_type_info::do_find_public_src): Adjust (__vmi_class_type_info::do_dyncast): Adjust. (__vmi_class_type_info::do_upcast): Set result details, if needed. Adjust. (__dynamic_cast): Temporarily #if out optimization. From-SVN: r32828
2000-03-29except.c (add_eh_table_entry): Mark type_info's as referenced.Nathan Sidwell1-7/+3
gcc: * except.c (add_eh_table_entry): Mark type_info's as referenced. gcc/cp: * rtti.c (get_tinfo_decl): Mark used. (emit_tinfo_decl): Don't optimize polymorphic type_info. Only mark as dealt with, if we output it. From-SVN: r32799
2000-03-28Put RTTI entries at negative offsets in new ABI.Mark Mitchell1-7/+32
* class.c (dfs_build_vbase_offset_vtbl_entries): Put the first vbase offset at index -3, not -1. (build_vtabe_offset_vtbl_entries): Use unmarked_vtable_pathp, not dfs_vtable_path_unmarked_real_bases_queue_p to walk bases. (dfs_build_vcall_offset_vtbl_entries): Don't use skip_rtti_stuff. (build_rtti_vtbl_entries): New function. (set_rtti_entry): Remove. (build_primary_vtable): Don't use it. (build_secondary_vtable): Likewise. (start_vtable): Remove. (first_vfun_index): New function. (set_vindex): Likewise. (add_virtual_function): Don't call start_vtable. Do call set_vindex. (set_primary_base): Rename parameter. (determine_primary_base): Likewise. (num_vfun_entries): Don't use skip_rtti_stuff. (num_extra_vtbl_entries): Include RTTI information. (build_vtbl_initializer): Use build_rtti_vtbl_entries. (skip_rtti_stuff): Remove. (dfs_modify_vtables): Don't use it. (modify_all_vtables): Don't use start_vtable. Do use set_vindex. (layout_nonempty_base_or_field): Update size handling. (create_vtable_ptr): Tweak. (layout_class_type): Adjust parameter names. (finish_struct_1): Simplify. * cp-tree.h (CLASSTYPE_VSIZE): Tweak documentation. (skip_rtti_stuff): Remove. (first_vfun_index): New function. (dfs_vtable_path_unmarked_real_bases_queue_p): Remove. (dfs_vtable_path_marked_real_bases_queue_p): Remove. (marked_vtable_pathp): Declare. (unmarked_vtable_pathp): Likewise. * error.c (dump_expr): Use first_vfun_index to calculate vtable offsets. * rtti.c (build_headof): Look for RTTI at negative offsets. (get_tinfo_decl_dynamic): Likewise. (tinfo_base_init): Don't take the address of the TINFO_VTABLE_DECL here. (create_pseudo_type_info): Do it here instead. Adjust so that vptr points at first virtual function. * search.c (marked_vtable_pathp): Make it global. (unmarked_vtable_pathp): Likewise. (dfs_vtable_path_unmarked_real_bases_queue_p): Remove. (dfs_vtable_path_marked_real_bases_queue_p): Likewise. (dfs_get_pure_virtuals): Don't use skip_rtti_stuff. (get_pure_virtuals): Likewise. (expand_upcast_fixups): Likewise. * tree.c (debug_binfo): Likewise. * tinfo.cc (__dynamic_cast): Look for vtable_prefix at appropriate negative offset. From-SVN: r32787
2000-03-25* Rework fields used to describe positions of bitfields andRichard Kenner1-20/+13
modify sizes to be unsigned and use HOST_WIDE_INT. * alias.c (reg_known_value_size): Now unsigned. * c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position. (really_start_incremental_init): Use bitsize_zero_node. (push_init_level, pop_init_level, output_init_element): Likewise. Use bitsize_unit_node and bitsize_one_node. (output_pending_init_elements, process_init_element): Likewise. * combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned. (make_extraction): Position and length HOST_WIDE_INT and unsigned HOST_WIDE_INT, respectively. (get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT. (num_sign_bit_copies): Returns unsigned. BITWIDTH now unsigned; rework arithmetic. Remove recursive call from arg to MAX. (combine_instructions, init_reg_last_arrays): NREGS now unsigned. (setup_incoming_promotions, can_combine_p, try_combine, simplify_set): REGNO now unsigned. (set_nonzero_bit_and_sign_copies): NUM now unsigned. (find_split_point, expand_compound_operation, make_extraction): LEN now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT. (make_field_assignment): Likewise. (combine_simplify_rtx): Add cast. (expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic. (force_to_mode): WIDTH now unsigned; add cast. (if_then_else_cond): SIZE now unsigned. (nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned. (extended_count): Now returns unsigned. (simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT. Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned. (simplify_comparison): MODE_WIDTH now unsigned. (update_table_tick): REGNO and ENDREGNO now unsigned; new var R. (mark_used_regs_combine): Likewise; rework arithmetic. (record_value_for_reg): REGNO, ENDREGNO, and I now unsigned. (record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise. (record_promoted_value): REGNO now unsigned. (get_last_value_validate): REGNO, ENDREGNO, and J now unsigned. (get_last_value): REGNO now unsigned. (use_crosses_set_p): REGNO and ENDREGNO now unsigned. (reg_dead_regno, reg_dead_endregno): Now unsigned. (remove_death): Arg REGNO now unsigned. (move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned. (reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO now unsigned. * convert.c (convert_to_integer): INPREC and OUTPREC now unsigned. * cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned. (struct cse_reg_info): REGNO now unsigned. (cached_regno): Now unsigned. (REGNO_QTY_VALID_P): Add cast. (make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned. (remove_invalid_regs): Likewise. (remove_invalid_subreg_refs): Likewise; arg WORD also unsigned as are variables END and I. (get_cse_reg_info, insert): Likewise. (mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned. (canon_hash): Likewise. (insert_regs, lookup_for_remove): REGNO now unsigned. (invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned. New variable RN. * dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0. * dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast. * emit-rtl.c (subreg_realpart_p): Add cast. (operand_subword): Arg I is now unsigned as is var PARTWORDS. (operand_subword_force): Arg I is now unsigned. * except.c (eh_regs): Variable I is now unsigned. * explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT. * expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT; length is unsigned HOST_WIDE_INT; likewise for internal variables. (store_split_bit_field, extract_fixed_bit_field): Likewise. (extract_split_bit_field, store_bit_field, extract_bit_field): Likewise. * expr.c (store_constructor_fields, store_constructor, store_field): Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT. (expand_assignment, expand_expr, expand_expr_unaligned): Likewise. (do_jump): Likewise. (move_by_pieces, move_by_pieces_ninsns, clear_by_pieces): MAX_SIZE is now unsigned. (emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned. (emit_group_store): Likewise. (emit_move_insn): I now unsigned. (store_constructor): Use host_integerp, tree_low_cst, and bitsize_unit_node. (get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT. Rework all calculations to use trees and new fields. * expr.h (promoted_input_arg): Regno now unsigned. (store_bit_field, extract_bit_field): Adjust types of pos and size. (mark_seen_cases): Arg is HOST_WIDE_INT. * flow.c (verify_wide_reg_1): REGNO now unsigned. * fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT; precisions and alignments are unsigned. (optimize_bit_field_compare, fold_truthop): Likewise. (int_const_binop): Adjust threshold for size_int_type_wide call. (fold_convert): Likewise. (size_int_type_wide): Make table larger and fix thinko that only had half of table used. (all_ones_mask_p, fold): Precisions are unsigned. * function.c (put_reg_info_stack): REGNO is unsigned. (instantiate_decl): Size is HOST_WIDE_INT. (instantiate_virtual_regs): I is unsigned. (assign_parms): REGNO, REGNOI, and REGNOR are unsigned. (promoted_input_arg): REGNO is unsigned. * function.h (struct function): x_max_parm_reg is now unsigned. * gcse.c (max_gcse_regno): Now unsigned. (struct null_pointer_info): min_reg and max_reg now unsigned. (lookup_set, next_set): REGNO arg now unsigned. (compute_hash_table): REGNO and I now unsigned. (handle_avail_expr): regnum_for_replacing now unsigned. (cprop_insn): REGNO now unsigned. (delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned. * ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case. * global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned. * hard-reg-set.h (reg_class_size): Now unsigned. * integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO. * jump.c (mark_modified_reg): I now unsigned; add cast. (rtx_equal_for_thread_p): Add cast. * loop.c (max_reg_before_loop): Now unsigned. (struct_movable): REGNO now unsigned. (try_copy_prop): REGNO arg unsigned. (regs_match_p): XN and YN now unsigned. (consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned. (strength_reduce): Likewise; NREGS also unsigned. (first_increment_giv, last_increment_giv unsigned): Now unsigned. * loop.h (struct iv_class): REGNO now unsigned. (max_reg_before_loop, first_increment_giv, last_increment_giv): Now unsigned. * machmode.h (mode_size, mode_unit_size): Now unsigned. (mode_for_size, smallest_mode_for_size): Pass size as unsigned. * optabs.c (expand_binop): I and NWORDS now unsigned. (expand_unop): I now unsigned. * print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET. * real.c (significand_size): Now returns unsigned. * real.h (significand_size): Likewise. * regclass.c (reg_class_size): Now unsigned. (choose_hard_reg_mode): Both operands now unsigned. (record_reg_classes): REGNO and NR now unsigned. (reg_scan): NREGS now unsigned. (reg_scan_update): old_max_regno now unsigned. (reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned. * reload.c (find_valid_class): BEST_SIZE now unsigned. (find_dummy_reload): REGNO, NWORDS, and I now unsigned. (hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned. Likewise for variable R. (refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned, as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R. (find_equiv_reg): Add casts. (regno_clobbered_p): Arg REGNO now unsigned. * reload.h (struct reload): NREGS now unsigned. (refers_to_regno_for_reload_p): Regno args are unsigned. (regno_clobbered_p): Likewise. * reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned. (compute_use_by_pseudos): REGNO now unsigned. (find_reg): I and J now unsigned, new variable K, and change loop variables accordingly; THIS_NREGS now unsigned. (alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned. (spill_hard_reg): REGNO arg now unsigned; add casts. (forget_old_reloads_1): REGNO, NR, and I now unsigned. (mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned. (clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO, END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned. (reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned. (choose_reload_regs): MAX_GROUP_SIZE now unsigned. (emit_reload_insns): REGNO now unsigned. (reload_cse_move2add): Add cast. (move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO and rework loop. * resource.c (mark_referenced_resources, mark_set_resources): New variable R; REGNO and LAST_REGNO now unsigned. (mark_target_live_regs): J and REGNO now unsigned. * rtl.c (mode_size, mode_unit_size): Now unsigned. * rtl.h (union rtunion_def): New field rtuint. (XCUINT): New macro. (ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT. (operand_subword, operand_subword_force): Word number is unsigned. (choose_hard_reg_mode): Operands are unsigned. (refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned. (find_regno_note, find_regno_fusage, replace_regs): Likewise. (regno_use_in, combine_instructions, remove_death): Likewise. (reg_scan, reg_scan_update): Likewise. (extended_count): Return is unsigned. * rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I, INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO. (reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned. (reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned. (reg_reg_last_1): FIRS and LAST now unsigned. (dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned. (dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO now unsigned. (find_regno_note, regno_use_in): Arg REGNO now unsigned. (find_regno_fusage): Likewise; also var REGNOTE now unsigned. (find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned. (replace_regs): Arg NREGS now unsigned. * sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0. * simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned. (simplify_binary_operation): Likewise. (cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and THIS_LAST now unsigned. (cselib_record_set): Add cast. * ssa.c (ssa_max_reg_num): Now unsigned. (rename_block): REGNO now unsigned. * stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT; sizes now unsigned. (all_cases_count): Just return -1 not -2. COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT. Rework tests to use trees whenever possible. Use host_integerp and tree_low_cst. (mark_seen_cases): COUNT arg now HOST_WIDE_INT; Likewise variable NEXT_NODE_OFFSET; XLO now unsigned. (check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT. * stor-layout.c (mode_for_size): SIZE arg now unsigned. (smallest_mode_for_size): Likewise. (layout_decl): Simplify handing of a specified DECL_SIZE_UNIT. KNOWN_ALIGN is now an alignment, so simplify code. Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type. (start_record_layout): Renamed from new_record_layout_info. Update to new fields. (debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far): New functions. (place_union_field): Renamed from layout_union_field. Update to use new fields in rli. (place_field): Renamed from layout_field. Major rewrite to use new fields in rli; pass alignment to layout_decl. (finalize_record_size): Rework to use new fields in rli and handle union. (compute_record_mode): Rework to simplify and to use new DECL fields. (finalize_type_size): Make rounding more consistent. (finish_union_layout): Deleted. (layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either. (layout_type, case RECORD_TYPE): Call new function names. (initialize_sizetypes): Set TYPE_IS_SIZETYPE. (set_sizetype): Set TYPE_IS_SIZETYPE earlier. (get_best_mode): UNIT is now unsigned; remove casts. * tree.c (bit_position): Compute from new fields. (byte_position, int_byte_position): New functions. (print_type_hash_statistics): Cast to remove warning. (build_range_type): Use host_integerp and tree_low_cst to try to hash. (build_index_type): Likewise; make subtype of sizetype. (build_index_2_type): Pass sizetype to build_range_type. (build_common_tree_nodes): Use size_int and bitsize_int to initialize nodes; add bitsize_{zero,one,unit}_node. * tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK. (DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise. (DECL_PACKED, DECL_BIT_FIELD): Likewise. (DECL_FIELD_BITPOS): Deleted. (DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields. (DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK. (DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise. (DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise. (DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise. (DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise. (DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise. (DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK. (DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK. (DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise. (DECL_ALIGN): Adjust to new field in union. (DECL_OFFSET_ALIGN): New field. (DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK. (DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK. (union tree_decl): Add struct for both aligns. (enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}. (bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added. (struct record_layout_info): Rework fields to have offset alignment and byte and bit position. (start_record_layout, place_field): Renamed from old names. (rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls. (byte_position, int_byte_position): Likewise. (get_inner_reference): Change types of position and length. * unroll.c (unroll_loop): New variable R; use for some loops. MAX_LOCAL_REGNUM and MAXREGNUM now unsigned. (calculate_giv_inc): Arg REGNO now unsigned. (copy_loop_body): REGNO and SRC_REGNO now unsigned. * varasm.c (assemble_variable): Clean up handling of size using host_integerp and tree_low_cst. (decode_addr_const): Use byte, not bit, position. (output_constructor): bitpos and offsets are HOST_WIDE_INT; use tree_low_cst and int_bit_position. * objc/objc-act.c (build_ivar_list_initializer): Use byte_position. * ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT. * ch/typeck.c (expand_constant_to_buffer): Use int_byte_position. (extract_constant_from_buffer): Likewise. * cp/class.c (build_vbase_pointer_fields): layout_field now place_field. (get_vfield_offset): Use byte_position. (set_rtti_entry): Set OFFSET to ssizetype zero. (get_binfo_offset_as_int): Deleted. (dfs_record_base_offsets): Use tree_low_cst. (dfs_search_base_offsets): Likewise. (layout_nonempty_base_or_field): Reflect changes in RLI format and call byte_position. (layout_empty_base): Convert offset to ssizetype. (build_base_field): use rli_size_unit_so_far. (dfs_propagate_binfo_offsets): Do computation in proper type. (layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets. (layout_class_type): Reflect changes in RLI names and fields. (finish_struct_1): Set DECL_FIELD_OFFSET. * cp/dump.c (dequeue_and_dump): Call bit_position. * cp/expr.c (cplus_expand_constant): Use byte_position. * cp/rtti.c (expand_class_desc): Use bitsize_one_node. * cp/typeck.c (build_component_addr): Use byte_position and don't special case for zero offset. * f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node. (ffecom_tree_canonize_ref_): Likewise. * java/class.c (make_field_value): Use byte_position. * java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position. (java_array_data_offset): Likewise. * java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to bzero call. From-SVN: r32742
2000-03-24decl.c (vtype_decl_p): Use TYPE_POLYMORPHIC_P.Nathan Sidwell1-0/+6
* decl.c (vtype_decl_p): Use TYPE_POLYMORPHIC_P. * rtti.c (get_tinfo_decl): Set comdat linkage on new-abi tinfo object. (emit_tinfo_decl): Only emit polymorphic tinfo's when emitting vtable. From-SVN: r32725
2000-03-21tree.h (COMPLETE_TYPE_P): New macro.Nathan Sidwell1-7/+7
gcc * tree.h (COMPLETE_TYPE_P): New macro. (COMPLETE_OR_VOID_TYPE_P): New macro. (COMPLETE_OR_UNBOUND_ARRAY_TYPE_P): New macro. * stor-layout.c (layout_type, case VOID_TYPE): Don't set TYPE_SIZE. * c-aux-info.c (gen_type): Use them. * c-common.c (c_expand_expr_stmt): Likewise. * c-decl.c (poplevel, pushdecl, start_decl, finish_decl, grokdeclarator, grokparms, finish_struct, start_function, store_parm_decls, combine_parm_decls): Likewise. * c-parse.y (cast_expr): Likewise. * c-typeck.c (require_complete_type, c_sizeof, c_sizeof_nowarn, c_size_in_bytes, c_alignof, build_component_ref, build_indirect_ref, build_array_ref, convert_arguments, build_binary_op, pointer_diff, build_unary_op, digest_init: Likewise. * calls.c (initialize_argument_information): Likewise. * convert.c (convert_to_integer): Likewise. * dbxout.c (dbxout_typedefs, dbxout_type, dbxout_symbol): Likewise. * dwarfout.c (location_or_const_value_attribute, output_enumeration_type_die, output_structure_type_die, output_union_type_die, output_type): Likewise. * expr.c (safe_from_p, expand_expr): Likewise. * function.c (assign_parms): Likewise. * sdbout.c (sdbout_symbol, sdbout_one_type): Likewise. * tree.c (build_array_type, build_function_type, build_method_type, build_offset_type, build_complex_type): Likewise. * c-parse.c, c-parse.h: Regenerated. gcc/cp * typeck.c (require_complete_type, complete_type, complete_type_or_else, c_sizeof, c_sizeof_nowarn, build_array_ref, convert_arguments, pointer_diff, build_x_unary_op, build_unary_op, build_c_cast, build_modify_expr): Use COMPLETE_TYPE_P etc. * call.c (is_complete, convert_like_real, build_new_method_call): Likewise. * class.c (build_vbase_pointer_fields, check_bases, build_base_field, finish_struct_1, pushclass): Likewise. * cvt.c (cp_convert_to_pointer, convert_to_void): Likewise. * decl.c (maybe_process_template_type_declaration, pushtag, pushdecl, redeclaration_error_message, start_decl, start_decl_1, layout_var_decl, check_initializer, cp_finish_decl, grokdeclarator, require_complete_types_for_parms, grok_op_properties, xref_tag, xref_basetypes, check_function_type): Likewise. * decl2.c (check_classfn, reparse_absdcl_as_casts): Likewise. * friend.c (do_friend): Likewise. * init.c (build_offset_ref): Likewise. * parse.y (structsp): Likewise. * pt.c (maybe_process_partial_specialization, tsubst_friend_function, instantiate_class_template, tsubst, do_type_instantiation, instantiate_pending_templates): Likewise. * repo.c (repo_get_id): Likewise. * rtti.c (build_typeid, get_typeid, build_dynamic_cast_1, synthesize_tinfo_var, emit_support_tinfos): Likewise. * search.c (lookup_fnfields_1, lookup_conversions): Likewise. * semantics.c (begin_class_definition): Likewise. * tree.c (build_cplus_method_type): Likewise. * typeck2.c (digest_init, build_functional_cast, add_exception_specifier): Likewise. * parse.h, parse.c: Regenerated. From-SVN: r32671
2000-03-21cxxabi.h: New header file.Nathan Sidwell1-19/+8
* inc/cxxabi.h: New header file. Define new-abi entry points. (__pointer_type_info::target): Rename member to ... (__pointer_type_info::type): ... here. (__base_class_info::type): Rename member to ... (__base_class_info::base): ... here. * Make-lang.in (CXX_EXTRA_HEADERS): Add cxxabi.h * cp-tree.h (CPTI_ABI): New global tree enumeration. (abi_node): New global tree node. * decl.c (abi_node): Document. (init_decl_processing): Initialize abi_node. * rtti.c (build_dynamic_cast_1): Use abi_node for new-abi. (get_vmi_pseudo_type_info): Likewise. (create_tinfo_types): Likewise. (emit_support_tinfos): Likewise. * tinfo.h (cxxabi.h): Include for new-abi. Move rtti class definitions to new header file. * tinfo.cc (abi): Use the namespace. (std): Move new abi rtti classes from here ... (__cxxabiv1): ... to here. * tinfo2.cc (cxxabi.h): Include for new-abi. Move rtti class definitions to new header file. (std): Move new abi rtti classes from here ... (__cxxabiv1): ... to here. * inc/typeinfo (__class_type_info): Move into __cxxabiv1 namespace. From-SVN: r32669
2000-03-17* Clean up usages of TREE_INT_CST_LOW.Richard Kenner1-2/+1
* c-parse.in (RESTORE_WARN_FLAGS): Use tree_low_cst. * c-parse.y, c-parse.c, objc/objc-parse.y, objc/objc-parse.c: Regenerated. * c-tree.h (min_precision): Move declaration to here. * c-typeck.c (build_binary_op): Use host_integerp and tree_low_cst. (build_unary_op, add_pending_init): Use bit_position. (pending_init_member, process_init_element): Likewise. (really_start_incremental_init, push_init_level, pop_init_level): Don't make copies of nodes or modify them in place, use consistent types when tracking positions, and use tree routines computations. (set_init_index, output_init_element): Likewise. (output_pending_init_elements, process_init_element): Likewise. * dbxout.c (dbxout_type_fields): Use bit_position, host_integerp, tree_low_cst and int_bit_position; also minor cleanup. (dbxout_type_method_1, dbxout_range_type, dbxout_type): Likewise. (print_cst_octal): Precision is unsigned. (dbxout_symbol): Ensure DECL_INITIAL is in-range and use tree_low_cst. * dwarf2out.c (ceiling): Input and output are unsigned HOST_WIDE_INT. (simple_type_align_in_bits): Result is unsigned int. Use tree_int_low_cst and host_integerp. (simple_type_size_in_bits): Result is unsigned HOST_WIDE_INT. (field_byte_offset): Result is HOST_WIDE_INT. Change types of internal variables so alignments are unsigned int, offsets are HOST_WIDE_INT and sizes are unsigned HOST_WIDE_INT. Use host_integerp, tree_low_cst, and int_bit_position. (add_bit_offset_attribute): Likewise. (add_data_member_location_attribute): Use tree_cst_low. (add_bound_info): Use host_integerp, integer_zerop, and integer_onep. (add_bit_size_attribute): Use tree_low_cst. (add_pure_or_virtual_attribute, gen_enumeration_type_die): Likewise. * dwarfout.c: Similar changes to dwarf2out.c. * expr.c (expand_expr, case ARRAY_REF): Remove redundant code. * genoutput.c (n_occurences): Return -1 for null string. (strip_whitespace): Accept null string and make into function. (scan_operands): Reflect above changes. * sdbout.c (plain_type_1): Use host_integerp and tree_low_cst. (sdbout_field_types, sdbout_one_type): Likewise; also use bit_position. * ssa.c (rename_registers): Add missing cast of arg to bzero. * tree.c (int_size_in_bytes): Check for too big to represent. (bit_position, int_bit_position, host_integerp, tree_low_cst): New fns. * tree.h (host_integerp, tree_low_cst, bit_position, int_bit_position): New declarations. (min_precision): Delete from here. * varasm.c (decode_addr_const): Use host_integerp, bit_position, and int_bit_position. * objc/objc-act.c (encode_method_prototype): Sizes are HOST_WIDE_INT. (encode_method_def): Likewise. (build_ivar_list_initializer): Use int_bit_position. (generate_shared_structures): Convert size. (encode_type, encode_complete_bitfield): Use integer_zerop. (encode_bitfield): Use tree_low_cst and int_bit_position. * ch/typeck.c (min_precision): New function. (build_chill_slice): Use host_integerp and tree_low_cst. (expand_constant_to_buffer): Likewise and also int_bit_position. LO is unsigned HOST_WIDE_INT (build_chill_array_ref_1): Make `i' be HOST_WIDE_INT; use tree_low_cst. (extract_constant_from_buffer): Sizes are now HOST_WIDE_INT. Use host_integerp and tree_low_cst. (build_chill_bin_type): Use host_integerp and tree_low_cst. (layout_chill_range_type): Use tree_int_cst_sgn, compare_tree_int, tree_low_cst, and min_precision. (apply_chill_array_layout): Cleanups for types of variables and use tree_int_cst_sgn, compare_tree_int, and tree_low_cst. (apply_chill_field_layout): Likewise. * cp/class.c (build_vbase_path): Use integer_zerop. (build_vtable_entry): Use tree_low_cst. (get_vfield_offset): Use bit_position. (dfs_modify_vtables): New variable vindex_val; `i' is HOST_WIDE_INT. Use tree_low_cst. (check_bitfield_decl): Set DECL_SIZE using convert. (build_base_field): Set DECL_SIZE and DECL_SIZE_UNIT using size_binop. (layout_virtual_bases): DSIZE is unsigned HOST_WIDE_INT. Use tree_low_cst. (finish_struct_1): Use bit_position. (dump_class_hierarchy): Use tree_low_cst. * cp/cp-tree.h (min_precision): Add declaration. * cp/decl.c (xref_tag, xref_basetypes): Use tree_low_cst. * cp/error.c (dump_type_suffix): Use host_integerp and tree_low_cst. (dump_expr): Use integer_zerop, host_integerp, and tree_low_cst. * cp/expr.c (cplus_expand_constant): Use bit_position. * cp/init.c (build_vec_init): Use host_integerp and tree_low_cst. * cp/rtti.c (get_base_offset): Use bit_position. * cp/typeck.c (build_binary_op): Use integer_zerop, compare_tree_int, host_integerp, and tree_low_cst. (pointer_int_sum): Use integer_zerop. (build_component_addr): Use bit_position. * java/class.c (make_field_value): Properly handle sizes. (get_dispatch_vector): Use tree_low_cst and host_integerp. (layout_class_method): Count using trees. * java/decl.c (push_promoted_type): Set TYPE_{MIN,MAX}_VALUE with copy_node. * java/expr.c (java_array_data_offset): Use int_bit_position. (build_newarray, build_anewarray): Use host_integerp and tree_low_cst. (build_invokevirtual): Use tree_low_cst and do computations with trees. From-SVN: r32607
2000-03-16rtti.c (build_dynamic_cast_1): Improve diagnostics.Steven Grady1-49/+77
* rtti.c (build_dynamic_cast_1): Improve diagnostics. Co-Authored-By: Jason Merrill <jason@casey.cygnus.com> From-SVN: r32599
2000-03-15tinfo2.cc (__ptr_to_member_data): Rename to ...Nathan Sidwell1-1/+1
* tinfo2.cc (__ptr_to_member_data): Rename to ... (__pointer_to_member_data): ... here. Adjust. * rtti.c (create_tinfo_types): Adjust. From-SVN: r32562
2000-03-15cp-tree.h (CPTI_REF_DESC_TYPE, [...]): Remove.Nathan Sidwell1-16/+7
* cp-tree.h (CPTI_REF_DESC_TYPE, ref_desc_type_node): Remove. * decl.c (ref_desc_type_node): Undocument. * rtti.c (ptr_ref_initializer): Rename to ... (ptr_initializer): ... here. Adjust comments. (ptmd_initializer): Fix comment thinko. (synthesize_tinfo_var): Remove REFERENCE_TYPE case. (create_tinfo_types): Remove ref_desc_type_node init. * tinfo2.cc (__reference_type_info): Remove. From-SVN: r32558
2000-03-11oopsJason Merrill1-1/+1
From-SVN: r32482
2000-03-10decl.c (push_throw_library_fn): Take the FUNCTION_TYPE.Jason Merrill1-4/+7
* decl.c (push_throw_library_fn): Take the FUNCTION_TYPE. * except.c (expand_end_eh_spec): Add the return type. * rtti.c (throw_bad_cast): Add the parmtypes. (throw_bad_typeid): Likewise. * semantics.c (expand_stmt): Only leave out rtl for unused artificials, and set DECL_IGNORED_P on them as well. * decl.c (wrapup_globals_for_namespace): Likewise. * decl.c (maybe_commonize_var): Skip all artificial decls. * pt.c (tsubst_decl): Don't copy TREE_ASM_WRITTEN. From-SVN: r32475