Commit Graph

468 Commits

Author SHA1 Message Date
Mark Mitchell ab76ca54bb c-common.c: Include c-common.h, not c-lex.h or c-tree.h.
* 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-30 00:26:03 +00:00
Nathan Sidwell c727aa5e28 cp-tree.h (SET_DECL_ARTIFICIAL): Remove.
* cp-tree.h (SET_DECL_ARTIFICIAL): Remove.
	* decl.c (create_implicit_typedef): Adjust.
	* decl2.c (build_artificial_parm): Adjust.
	* method.c (implicitly_declare_fn): Adjust.
	* pt.c (push_inline_template_parms_recursive): Adjust.
	(process_template_parm): Adjust.
	(overloaded_template_name): Adjust.
	* semantics.c (finish_template_template_parm): Adjust.

From-SVN: r34780
2000-06-29 14:03:10 +00:00
Nathan Sidwell 0404d86f34 decl2.c (handle_class_head): Bash typedefs to the type's main decl.
* decl2.c (handle_class_head): Bash typedefs to the type's main
	decl.

From-SVN: r34707
2000-06-26 11:06:39 +00:00
Mark Mitchell 31f8e4f306 cp-tree.h (BV_USE_VCALL_INDEX_P): New macro.
* cp-tree.h (BV_USE_VCALL_INDEX_P): New macro.
	(BV_GENERATE_THUNK_WITH_VTABLE_P): Likewise.
	(lang_decl_flags): Add generate_with_vtable_p.  Make vcall_offset
	a tree, not an int.
	(THUNK_GENERATE_WITH_VTABLE_P): New macro.
	(make_thunk): Change prototype.
	(emit_thunk): Rename to use_thunk.
	(mangle_thunk): Change prototype.
	* class.c (get_derived_offset): Simplify.
	(copy_virtuals): Clear BV_USE_VCALL_INDEX_P and
	BV_GENERATE_THUNK_WITH_VTABLE_P.
	(build_primary_vtable): Simplify.
	(add_virtual_function): Use BV_FN, rather than TREE_VALUE.
	(dfs_find_base): Remove.
	(update_vtable_entry_for_fn): Correct bug in finding the base
	where a virtual function was first declared.  Figure out whether
	or not to emit a vcall-thunk with the vtables in which it appears.
	Correct logic for deciding whether to use an ordinary thunk, or a
	vcall thunk.
	(finish_struct_1): Remove unnecssary code.
	(build_vtbl_initializer): Use ssize_int for the running counter of
	negative indices.
	(build_vtbl_initializer): Only use vcall thunks where necessary.
	Mark thunks as needing to be emitted with their vtables, or not.
	(build_vbase_offset_vtbl_entries): Adjust for use of ssize_int in
	indices.  Use size_binop.
	(dfs_build_vcall_offset_vtbl_entries): Don't rely on
	BINFO_PRIMARY_MARKED_P here.  Use BV_FN consistently.  Use
	size_binop.
	(build_rtti_vtbl_entries): Adjust call to build_vtable_entry.
	(build_vtable_entry): Mark thunks as needing to be emitted with
	their vtables, or not.
	* decl.c (lang_mark_tree): Mark the vcall_offset in a thunk.
	* decl2.c (mark_vtable_entries): Use use_thunk instead of
	emit_thunk.
	* dump.c (dequeue_and_dump): Remove dead code.  Dump new thunk
	information.
	* error.c (dump_expr): Use BV_FN.
	* mangle.c (mangle_thunk): Adjust now that vcall_offset is a tree,
	not an int.
	* method.c (make_thunk): Likewise.
	(emit_thunk): Rename to use_thunk.  Allow callers to decide
	whether or not to actually emit the thunk.  Adjust for changes in
	representation of vcall offsets.
	* search.c (dfs_get_pure_virtuals): Use BV_FN.
	* semantics.c (emit_associated_thunks): New function.
	(expand_body): Use it.
	* ir.texi: Adjust decriptions of thunks.

From-SVN: r34656
2000-06-23 01:14:40 +00:00
Jason Merrill 655dc6eebf pt.c (tsubst_decl, [...]): Clear DECL_SAVED_TREE.
* pt.c (tsubst_decl, case FUNCTION_DECL): Clear DECL_SAVED_TREE.
        (tsubst_friend_function): Copy it here.

        * decl.c (grok_op_properties): Fix typo.

        * decl2.c (delete_sanity): Clarify warning, avoid failure on
        deleting void*.

        * pt.c (check_explicit_specialization): Clarify error.

        * decl.c (pushdecl): Also pull out one of the FUNCTION_DECLs from
        an old OVERLOAD when we're declaring a non-function.
        (pushdecl, destroy_local_var): Check for error_mark_node.
        (warn_extern_redeclared_static): Also bail early if
        we're a CONST_DECL.
        (push_overloaded_decl): Ignore an old error_mark_node.

From-SVN: r34652
2000-06-22 16:54:48 -04:00
Jakub Jelinek 11cf4d1831 tree.h (TYPE_USER_ALIGN, [...]): Define.
* 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-14 07:30:09 +02:00
Kaveh R. Ghazi 5ac9118ef9 Warning fixes:
* bb-reorder.c (build_scope_forest): Initialize variable
	`curr_scope'.

	* calls.c (expand_call): Likewise for variables
	`save_pending_stack_adjust' and `save_stack_pointer_delta'.

	* i386.c (function_arg_advance, function_arg): Cast to avoid
	signed/unsigned warnings.

	* i386.h (MEMORY_MOVE_COST): Likewise.

	* ifcvt.c (cond_exec_process_if_block): Initialize variables
	`else_start' and `else_end'.

	* libgcc2.h (__eh_alloc, __eh_free): Prototype.

	* regrename.c (rr_replace_reg): Initialize variable `dest_subregno'.

ch:
	* Makefile.in (EXPR_H): New dependency variable.
	(actions.o, expr.o): Use EXPR_H.
	(lang.o): Depend on RTL_H and EXPR_H.

	* lang.c: Include rtl.h and expr.h.
	(lang_get_alias_set): Mark parameter with ATTRIBUTE_UNUSED.

cp:
	* decl2.c (compare_options): Don't needlessly cast away const-ness.

f:
	* com.c (lang_get_alias_set): Mark parameter with ATTRIBUTE_UNUSED.

java:
	* decl.c (create_primitive_vtable): Prototype.

	* jcf-write.c (generate_bytecode_insns): Initialize variable
	`saved_context'.

	* lang.c (lang_get_alias_set): Mark parameter with ATTRIBUTE_UNUSED.

From-SVN: r34490
2000-06-11 04:29:49 +00:00
Jason Merrill 669ec2b4f0 revert mangling patch
From-SVN: r34471
2000-06-09 12:26:24 -04:00
Mark Mitchell 657c130a99 invoke.texi: Remove documentation for -fsquangle and -fname-mangling-version.
* 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-08 17:34:33 +00:00
Mark Mitchell 5b2abab835 c-common.h (c_language_kind): New type.
* c-common.h (c_language_kind): New type.
	(c_language): New variab.e
	* c-common.c (lang_get_alias_set): Don't put structures in
	non-zero alias sets in C++.
	* c-decl.c (c_language): Define it.
	* c-lex.c (doing_objc_thang): Remove.
	* c-tree.h (doing_objc_thang): Make it a macro.
	* objc/objc-act.c (lang_decode_option): Set c_language, not
	doing_objc_thang.

	* decl2.c (c_language): Define.

From-SVN: r34439
2000-06-06 21:54:54 +00:00
Gabriel Dos Reis 764dbbf2dd diagnostic.c (output_maximum_width): Remove.
2000-06-06  Gabriel Dos Reis  <gdr@codesourcery.com>

        * diagnostic.c (output_maximum_width): Remove.
        (doing_line_wrapping): Tweak.
        (diagnostic_buffer): New object.
        (global_output_buffer): New object.
        (output_destroy_prefix): New function.
        (default_initialize_buffer): Likewise.
        (reshape_diagnostic_buffer): Likewise.
        (initialize_diagnostics): Likewise.
        (output_clear): Tweak.
        (line_wrapper_printf): Adjust call to init_output_buffer.
        (vline_wrapper_message_with_location): Likewise.  Use
        output_destroy_prefix.
        (v_message_with_decl): Likewise.

        * diagnostic.h (struct output_buffer): Constify prefix.
        (init_output_buffer, output_get_prefix): Constify.
        (diagnostic_message_length_per_line): Likewise.
        (reshape_diagnostic_buffer): Declare.
        (default_initialize_buffer): Declare.
        (initialize_diagnostics): Declare.
        (diagnostic_buffer): Declare new obbject.

        * toplev.c: #include diagnostic.h
        (display_help): Document diagnostic formatting options.
        (decode_f_option): Handle diagnostic formatting options.
        (main): Setup initialization for diagnostic messages outputter.

        * toplev.h (set_message_length): Remove.

        * Makefile.in (toplev.o): Depends upon diagnostic.h

        * invoke.texi : Document diagnostics formatting options.

cp/
2000-06-06  Gabriel Dos Reis  <gdr@codesourcery.com>

        * lex.c (lang_init_options): Tweak.

        * decl2.c: Remove #inclusion of diagnostic.h
        (lang_decode_option): Move diagnostic formatting options to
        toplevel.

        * lang-options.h: Remove documentation for diagnostic options.

        * Makefile.in (lex.o): Depends upon diagnostic.h

From-SVN: r34435
2000-06-06 20:11:40 +00:00
Jason Merrill 3ae18eaf85 search.c (maybe_suppress_debug_info): Don't check CLASSTYPE_INTERFACE_ONLY if CLASSTYPE_INTERFACE_KNOWN isn't set.
* search.c (maybe_suppress_debug_info): Don't check
        CLASSTYPE_INTERFACE_ONLY if CLASSTYPE_INTERFACE_KNOWN isn't set.

        * pt.c (mark_decl_instantiated): Do SET_DECL_EXPLICIT_INSTANTIATION
        here if extern_p.

        Remember instantiation context in deferred instantiations.
        * cp-tree.h (struct tinst_level): Remove.
        (TINST_DECL, TINST_LINE, TINST_FILE): New macros.
        * pt.c (current_tinst_level): Now a tree.
        (print_template_context, push_tinst_level, pop_tinst_level,
        tinst_for_decl): Adjust.
        (reopen_tinst_level): New fn.
        (init_pt): Register current_tinst_level as a root.
        (add_pending_template): Put current_tinst_level in TREE_PURPOSE
        of the pending templates list.
        (instantiate_pending_templates): Adjust.  Call reopen_tinst_level.
        * lex.c (extract_interface_info): Adjust.
        * decl2.c (warn_if_unknown_interface): Adjust.

From-SVN: r34415
2000-06-05 20:12:40 -04:00
Alex Samuel 1f6e1acc0f Make-lang.in (CXX_SRCS): Add mangle.c.
* 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-06-04 21:12:27 +00:00
Mark Mitchell f9a7ae04e9 cp-tree.h (TMPL_ARGS_LEVEL): Clarify comment.
* cp-tree.h (TMPL_ARGS_LEVEL): Clarify comment.
	(INNERMOST_TEMPLATE_ARGS): New macro.
	(innermost_args): Remove.
	(get_innermost_template_args): New function.
	* decl2.c (arg_assoc_class): Use INNERMOST_TEMPLATE_ARGS.
	* error.c (dump_function_decl): Be caution when using
	most_general_template.
	* method.c (build_template_parm_names):  Use
	INNERMOST_TEMPLATE_ARGS.
	* pt.c (add_to_template_args): Tidy comment
	(get_innermost_template_args): New function.
	(check_explicit_specialization): Clear DECL_INITIAL for a new
	specialization.
	(process_partial_specialization): Use INNERMOST_TEMPLATE_ARGS.
	Tidy.
	(push_template_decl): Always register specializations of the most
	general template.
	(convert_template_argument): Use INNERMOST_TEMPLATE_ARGS.
	(coerce_template_parms): Likewise.
	(lookup_template_class): Likewise.
	(innermost_args): Remove.
	(tsubst_decl): Use INNERMOST_TEMPLATE_ARGS.
	(tsubst_decl): Handle tricky specializations.  Use
	get_innermost_template_args.
	(instantiate_template): Simplify handling of partial
	instantiations.
	(get_class_bindings): Use INNERMOST_TEMPLATE_ARGS.
	(most_general_template): Reimplement, in a more straightforward
	manner.
	(regenerate_decl_from_template): Tweak formatting.  Use
	TMPL_ARGS_DEPTH for clarity.
	(set_mangled_name_for_template_decl): Use INNERMOST_ARGS.

	* dump.c (dequeue_and_dump): Dump information about thunks.

From-SVN: r34384
2000-06-03 21:42:49 +00:00
Richard Henderson f3798d124f decl2.c (unsupported_options): Fix typo, make const.
* decl2.c (unsupported_options): Fix typo, make const.
        (lang_decode_option): Fix bsearch argument order.

From-SVN: r34334
2000-06-01 02:40:07 -07:00
Mark Mitchell 2228d450a9 invoke.texi: Remove documentation for -fguiding-decls.
* invoke.texi: Remove documentation for -fguiding-decls.

	Remove guiding declaration support.
	* cp/cp-tree.h (flag_dump_translation_unit): Make it const.
	(flag_guiding_decls): Remove.
	* call.c (build_user_type_conversion_1): Remove support for
	guiding decls.
	(build_new_function_call): Likewise.
	(build_new_op): Likewise.
	(build_new_method_call): Likewise.
	* decl.c (start_function): Likewise.
	* friend.c (is_friend): Likewise.
	(do_friend): Likewise.
	* decl2.c ((flag_dump_translation_unit): Make it const.
	(flag_guiding_decls): Remove.
	(unsupported_options): New variable
	(compare_options): New function.
	(lang_decode_option): Use them.

From-SVN: r34306
2000-05-31 19:27:12 +00:00
Gabriel Dos Reis 6f5ef761df toplev.h (skip_leading_substring): New macro.
2000-05-28  Gabriel Dos Reis  <gdr@codesourcery.com>

        * toplev.h (skip_leading_substring): New macro.
        * toplev.c (decode_f_option): Use skip_leading_substring instead
        of strncmp.
        (decode_W_option): Likewise.

cp/

2000-05-28  Gabriel Dos Reis  <gdr@codesourcery.com>

        * decl2.c (lang_decode_option): Use skip_leading_substring instead
        of plain strncmp.

From-SVN: r34240
2000-05-28 21:22:12 +00:00
Alex Samuel 596ea4e574 cp-tree.h (ansi_opname): Make it a macro.
2000-05-27  Alex Samuel    <samuel@codesourcery.com>
	    Mark Mitchell  <mark@codesourcery.com>

	* cp-tree.h (ansi_opname): Make it a macro.
	(ansi_assopname): Likewise.
	(struct lang_decl_flags): Add assignment_operator_p.
	(struct lang_decl): Add operator_code.
	(DECL_VTT_PARM): Adjust.
	(DECL_OVERLOADED_OPERATOR_P): Return the operator_code for an
	overloaded operator.
	(SET_OVERLOADED_OPERATOR_CODE): New macro.
	(DECL_ASSIGNMENT_OPERATOR_P): New macro.
	(DECL_ARRAY_DELETE_OPERATOR_P): Adjust.
	(opname_tab): Remove.
	(assignop_tab): Likewise.
	(operator_name_info_t): New type.
	(operator_name_info): New variable.
	(assignment_operator_name_info): Likewise.
	(build_cp_library_fn): Remove declaration.
	(push_cp_library_fn): Likewise.
	(operator_name_string): Likewise.
	(build_decl_overload): Likewise.
	* call.c (print_z_candidates): Simplify.
	(build_object_call): Adjust usage of ansi_opname.  Use
	DECL_OVERLOADED_OPERATOR_P.
	(op_error): Adjust operator name lookup.
	(build_conditional_expr): Adjust usage of ansi_opname.
	(build_new_op): Likewise.
	(build_op_delete_call): Likewise.
	(build_over_call): Likewise.
	(joust): Use DECL_OVERLOADED_OPERATOR_P.
	* decl.c (duplicate_decls): Copy operator_code.
	(init_decl_processing): Adjust parameters to push_cp_library_fn.
	(builtin_function): Adjust parameters to build_library_fn_1.
	(build_library_fn_1): Accept an overloaded operator code.
	(build_library_fn): Pass ERROR_MARK.
	(build_cp_library_fn): Accept an overloaded operator code.
	(push_cp_library_fn): Likewise.
	(grokfndecl): Tweak.
	(grokdeclarator): Simplify code to compute names of overloaded
	operators.  Adjust use of ansi_opname.
	(ambi_op_p): Work on tree_codes, not identifiers.
	(unary_op_p): Likewise.
	(grok_op_properties): Likewise.
	(start_function): Use DECL_OVERLOADED_OPERATOR_P.
	(lang_mark_tree): Don't try to mark the operator_code.
	* decl2.c (grok_function_init): Use DECL_OVERLOADED_OPERATOR_P.
	* error.c (dump_decl): Remove special handling for operator
	names.
	(dump_function_name): Likewise.
	(dump_expr): Adjust name lookup of operators.
	(op_to_string): Simplify.
	(assop_to_string): Likewise.
	* init.c (build_new_1): Adjust use of ansi_opname.
	* lex.c (opname_tab): Remove.
	(assignop_tab): Likewise.
	(ansi_opname): Likewise.
	(ansi_assopname): Likewise.
	(operator_name_string): Likewise.
	(reinit_lang_specific): Likewise.
	(operator_name_info): New variable.
	(assignment_operator_name_info): Likewise.
	(init_operators): New function.
	(init_parse): Use it.
	(do_identifier): Adjust use of ansi_opname.
	* method.c (mangle_expression): Don't use ansi_opname for
	mangling.
	(build_decl_overload_real): Use DECL_OVERLOADED_OPERATOR_P.
	(build_decl_overload): Remove.
	(build_typename_overload): Use OPERATOR_TYPENAME_FORMAT directly.
	(do_build_assign_ref): Adjust use of ansi_opname.
	(synthesize_method): Likewise.
	(implicitly_declare_fn): Likewise.
	* operators.def: New file.
	* parse.y (operator): Adjust use of ansi_opname.
	* pt.c (tsubst_decl): Use IDENTIFIER_OPNAME_P.
	(set_mangled_name_for_template_decl): Don't play games with
	current_namespace.
	(special_function_p): Adjust use of ansi_opname.
	* typeck.c (check_return_expr): Likewise.
	* Make-lang.in (cc1plus): Depend on operators.def.
	* Makefile.in (lex.o): Likewise.
	(decl.o): Likewise.

Co-Authored-By: Mark Mitchell <mark@codesourcery.com>

From-SVN: r34223
2000-05-28 02:58:19 +00:00
Mark Mitchell cab8bde98e decl2.c (grokclassfn): Set DECL_LANGUAGE here.
* decl2.c (grokclassfn): Set DECL_LANGUAGE here.
	* method.c (implicitly_declare_fn): Not here.

From-SVN: r34194
2000-05-26 16:54:18 +00:00
Mark Mitchell 3ec6bad360 Finish implementation of VTTs.
* cp-tree.h (cp_tree_index): Add CPTI_VTT_PARM_TYPE and
	CPTI_VTT_PARM_IDENTIFIER.
	(vtt_parm_identifier): New macro.
	(vtt_parm_type): Likewise.
	(BINFO_SUBVTT_INDEX): Likewise.
	(BINFO_VPTR_INDEX): Likewise.
	(struct lang_decl): Add vtt_parm.
	(DECL_VTT_PARM): New macro.
	(DECL_USE_VTT_PARM): Likewise.
	(DECL_NEEDS_VTT_PARM_P): Likewise.
	(get_vtt_name): Declare.
	(build_artifical_parm): Likewise.
	(fixup_all_virtual_upcast_offsets): Likewise.
	(expand_indirect_vtbls_init): Remove.
	* call.c (build_new_method_call): Pass the vtt to subobject
	constructors and destructors.
	* class.c (get_vtt_name): Give it external linkage.
	(build_clone): Handle the magic VTT parameters for clones.
	(clone_function_decl): Fix typo in comment.
	(build_vtt): Keep track of the indices in the VTTs where various
	entities are stored.
	(build_vtt_inits): Likewise.
	(dfs_build_vtt_inits): Likewise.
	(build_ctor_vtbl_group): Tweak type of construction vtables.
	(dfs_accumulate_vtbl_inits): Build vtables for all bases, even
	primary bases, when building construction vtables.
	* decl.c (duplicate_decls): Handle DECL_VTT_PARM.
	(initialize_predefined_identifiers): Add vtt_parm_identifier.
	(init_decl_processing): Initialize vtt_parm_type.
	(grokfndecl): Use DECL_OVERLOADED_OPERATOR_P.
	(lang_mark_tree): Make vtt_parm.
	* decl2.c (build_artificial_parm): New function.
	(maybe_retrofit_in_chrg): Use it.  Add VTT parameters.
	(grokclassfn): Use build_artificial_parm.
	* init.c (initialize_vtbl_ptrs): Call
	fixup_all_virtual_upcast_offsets directly.
	(perform_member_init): Use the complete subobject destructor for
	member cleanups.
	(build_vtbl_address): New function.
	(expand_virtual_init): Handle VTTs.
	* optimize (maybe_clone_body): Likewise.
	* search.c (fixup_all_virtual_upcast_offsets): Give it external
	linkage.
	(expand_indirect_vtbls_init): Remove.
	* semantics.c (setup_vtbl_ptr): Fix typos in comment.
	* tree.c (make_binfo): Make them bigger.

From-SVN: r34177
2000-05-25 23:27:18 +00:00
Mark Mitchell 86f45d2c8a cp-tree.h (build_delete): Change prototype.
* cp-tree.h (build_delete): Change prototype.
	(build_vec_delete): Likewise.
	* call.c (build_scoped_method_call): Use special_function_kind
	values to indicate the kind of destruction to be done.
	(build_method_call): Likewise.
	* decl.c (finish_destructor_body): Likewise.
	(maybe_build_cleanup_1): Likewise.  Rename to ...
	(maybe_build_cleanup): ... this.
	* decl2.c (delete_sanity): Use special_function_kind
	values to indicate the kind of destruction to be done.
	(build_cleanup): Likewise.
	* init.c (perform_member_init): Likewise.
	(build_vec_delete_1): Likewise.
	(build_dtor_call): Simplify.
	(build_delete): Use special_function_kind
	values to indicate the kind of destruction to be done.
	(build_vbase_delete): Likewise.
	(build_vec_delete): Likewise.

From-SVN: r34147
2000-05-24 22:56:54 +00:00
Mark Mitchell 721c3b4275 cp-tree.h (lang_decl_flags): Rename mutable_flag to uninlinable and bitfield 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-24 06:15:04 +00:00
Mark Mitchell 212e70482f decl2.c (maybe_retrofit_in_chrg): Don't create in-charge parameters for template functions.
* decl2.c (maybe_retrofit_in_chrg): Don't create in-charge
	parameters for template functions.
	* pt.c (tsubst_decl): Make sure we call maybe_retrofit_in_chrg for
	destructors as well as constructors.

From-SVN: r34120
2000-05-24 04:34:38 +00:00
Martin v. Löwis dd4fae800f decl2.c (qualified_lookup_using_namespace): Look through namespace aliases.
* decl2.c (qualified_lookup_using_namespace): Look through
        namespace aliases.

        * decl.c (push_using_decl): Return the old decl on namespace level.

From-SVN: r34073
2000-05-22 07:23:26 +00:00
Mark Mitchell ff9f1a5d55 decl2.c (finish_anon_union): Generalize error messages to handle anonymous structures.
* decl2.c (finish_anon_union): Generalize error messages to handle
	anonymous structures.
	* init.c (perform_member_init): Remove `name' parameter.
	(build_field_list): New function.
	(sort_member_init): Handle anonymous union initialization order
	correctly.  Check for multiple initializations of the same union.
	(emit_base_init): Don't look up fields by name here.
	(expand_member_init): Record the result of name lookup for future
	reference.
	* typeck.c (build_component_ref): Fix formatting.

From-SVN: r33963
2000-05-17 18:46:32 +00:00
Andrew Cagney 078721e1a2 Add options -Wunused-variable, -Wunused-function, -Wunused-label,
-Wunused-parameter.  Retain existing -Wunused behavour.  Document.

From-SVN: r33953
2000-05-17 08:15:29 +00:00
Gabriel Dos Reis 72482e9290 decl2.c (lang_decode_option): Fix thinko.
2000-05-15  Gabriel Dos Reis  <gdr@codesourcery.com>

        * decl2.c (lang_decode_option): Fix thinko.

From-SVN: r33909
2000-05-15 13:06:24 +00:00
Gabriel Dos Reis 856b62442f diagnostic.h (DIAGNOSTICS_SHOW_PREFIX_ONCE): New macro.
2000-05-13  Gabriel Dos Reis <gdr@codesourcery.com>

        * diagnostic.h (DIAGNOSTICS_SHOW_PREFIX_ONCE): New macro.
        (DIAGNOSTICS_SHOW_PREFIX_NEVER): Likewise.
        (DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE): Likewise.
        (struct output_buffer: emitted_prefix_p, prefixing_rule): New
        fields.
        (set_message_prefixing_rule): Declare.

        * diagnostic.c: (current_prefixing_rule): New variable.
        (set_message_prefixing_rule): Define.
        (output_set_prefix): Adjust buffer->emitted_prefix_p.
        (init_output_buffer): Adjust Initialization.
        (output_emit_prefix): Rewrite.  Take prefixing rules into account.

cp/

2000-05-13  Gabriel Dos Reis <gdr@codesourcery.com>

        * lex.c: #include diagnostic.h.
        (lang_init_options): Set default prefixing rules.

        * lang-options.h: Add -fdiagnostics-show-location=.

        * decl2.c: #include diagnostic.h.
        (lang_decode_option): Handle -fdiagnostics-show-location=.

From-SVN: r33890
2000-05-14 08:44:48 +00:00
Zack Weinberg 3b304f5b7d top level:
* Makefile.in (WARN_CFLAGS): Add -Wwrite-strings.
	(tree.o): Depend on output.h.

	* c-decl.c (pending_invalid_xref_file,
	current_function_prototype_file): Constify.
	(pushdecl): Constify a local char *.
	(define_label): Constify filename parameter.
	* c-lex.c (init_parse): Constify parameter and return value.
	* c-typeck.c (c_expand_asm_operands): Constify filename parameter.
	* c-tree.h: Update prototypes.
	* c-parse.in: Constify filename member of %union, and if_stmt_file.
	* c-parse.y, c-parse.c, c-parse.h, objc/objc-parse.y,
	objc/objc-parse.c: Regenerate.

	* dwarfout.c (dwarfout_init): Constify main_input_filename parameter.
	* dwarfout.h: Update prototypes.
	* expr.c (expand_expr): Constify a local char *.
	* flags.h: Constify main_input_filename.
	* function.c (expand_function_end): Constify filename parameter.
	* genrecog.c (make_insn_sequence): Use a character array for
	c_test_pos.
	(main): Remove unused variables.
	* input.h: Constify input_filename, main_input_filename, and
	file_stack.name.  Update prototypes.
	* output.h: Declare first_global_object_name and
	weak_global_object_name here, as const char *.
	* stmt.c (expand_asm_operands): Constify filename parameter.
	* toplev.c (compile_file, push_srcloc, debug_start_source_file):
	Constify filename parameter.
	(input_filename, main_input_filename): Constify.
	* toplev.h: Update prototypes.
	* tree.c: Include output.h.  Don't declare
	first_global_object_name or weak_global_object_name.  Clean up string
	bashing in get_file_function_name_long.
	* tree.h (struct tree_decl): Constify filename member.
	(input_filename): Constify.
	Update prototypes.
	* varasm.c (first_global_object_name, weak_global_object_name):
	Constify.
	(assemble_start_function, assemble_variable): Clean up string bashing.

	* gcc.c: Constify all spec-related strings initialized,
	transitively, from string constants.  Constify all strings
	and string variables related to multilibs.
	(set_spec, read_specs): Cast argument to free to PTR.
	(used_arg): Do not modify multilib_matches.  Use strncmp plus
	length comparison to compare multilib switches.
	* genmultilib: Constify everything declared in multilib.h.

ch:
	* ch-tree.h: Update prototypes.  Remove prototypes for
	functions declared elsewhere.
	* decl.c (define_label): Constify filename parameter.
	* grant.c (globalize_decl, set_default_grant_file): Constify
	local char * variables.  Don't declare
	first_global_object_name or asm_out_file.
	* lang.c (chill_real_input_filename): Constify.
	* lex.c (init_parse): Constify parameter and return value.
	* parse.c: Don't declare input_filename.
	(ch_expand_asm_operands): Constify filename parameter.
	(parse_multi_dimension_case_action): Constify local char *.
	* satisfy.c (safe_satisfy_decl): Constify local char *.

cp:
	* cp-tree.h: Constify tree_srcloc.filename, tinst_level.file,
	and pending_inline.filename.  Update prototypes.
	* decl.c (define_label): Constify filename parameter.
	* decl2.c (warn_if_unknown_interface): Constify local char *.
	* input.c Constify input_source.filename. Don't declare
	input_filename or lineno.  Constify filename parameter to feed_input.
	* lex.c (init_parse): Constify parameter and return value.
	(cp_pragma_interface, cp_pragma_implementation): Constify
	filename argument.
	(reinit_parse_for_method, reinit_parse_for_block,
	reinit_parse_for_expr, feed_defarg, handle_cp_pragma):
	Constify local char *.
	* pt.c: Don't declare lineno or input_filename.
	(print_template_context, tsubst_friend_function, tsubst_decl,
	tsubst, instantiate_decl): Constify local char *.
	* semantics.c (expand_body): Constify local char *.
	* tree.c (build_srcloc): Constify filename parameter.
	* typeck.c (c_expand_asm_operands): Constify filename
	parameter.

f:
	* com.c (ffecom_subscript_check_): Constify array_name
	parameter. Clean up string bashing.
	(ffecom_arrayref_, ffecom_char_args_x_): Constify array_name
	parameter.
	(ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_,
	ffecom_sym_transform_, ffecom_sym_transform_assign_): Constify
	local char *.
	(init_parse): Constify parameter and return value.
	* lex.c: Include dwarfout.h instead of prototyping dwarfout_*
	functions here.
	(ffelex_file_pop_, ffelex_file_push_): Constify filename parameter.
	(ffelex_hash_, ffelex_include_): Constify local char *.
	* std.c (ffestd_exec_end): Constify local char *.
	* where.c (ffewhere_file_new): Constify filename parameter.
	* where.h: Update prototypes.

java:
	* check_init.c (check_init): Constify local char *.
	* class.c (push_class): Constify local char *.
	* java_tree.h: Update prototypes.
	* jcf-io.c (open_class): Constify filename parameter and
	return value.
	(find_class): Remove redundant string copy.  Cast return from
	open_class.
	* jcf-parse.c (read_class, parse_class_file, yyparse):
	Constify local char *.
	* jcf-write.c (generate_bytecode_insns, generate_classfile):
	Constify local char *.
	* jcf.h (JCF): Constify filename and classname.
	(JCF_FINISH): Cast args to FREE to char * when appropriate.
	* lang.c (init_parse): Constify parameter and return value.
	* lex.c (java_get_line_col): Constify filename parameter.
	* parse.h: Constify parser_ctxt.filename.  Update prototypes.
	* parse.y (java_parser_context_suspend,
	issue_warning_error_from_context, safe_layout_class): Constify
	local char *.
	* parse.c: Regenerate.

From-SVN: r33804
2000-05-09 19:56:01 +00:00
Mark Mitchell 872f37f912 cp-tree.h (special_function_kind): Add various kinds of destructors.
* cp-tree.h (special_function_kind): Add various kinds of
	destructors.
	(special_function_p): New function.
	* class.c (overrides): Don't let one kind of destructor override
	another.
	* decl2.c (mark_used): Use DECL_NON_THUNK_FUNCTION_P when deciding
	whether or not to instantiate a template.
	* tree.c (special_function_p): Define.

From-SVN: r33668
2000-05-04 14:54:18 +00:00
Mark Mitchell eb68cb5821 cp-tree.def (THUNK_DECL): Remove.
* cp-tree.def (THUNK_DECL): Remove.
	* cp-tree.h (DECL_THUNK_P): New macro.
	(DECL_NON_THUNK_FUNCTION_P): Likewise.
	(DECL_EXTERN_C_FUNCTION_P): Likewise.
	(SET_DECL_THUNK_P): Likewise.
	(DELTA_FROM_VTABLE_ENTRY): Use DECL_THUNK_P.
	(FNADDR_FROM_VTABLE_ENTRY): Likewise.
	(DECL_MAIN_P): Use DECL_EXTERN_C_FUNCTION_P.
	* decl.c (decls_match): Use DECL_EXTERN_C_P.
	(duplicate_decls): Likewise.
	(pushdecl): Likewise.  Adjust thunk handling.
	(grokfndecl): Use DECL_EXTERN_C_P.
	* decl2.c (mark_vtable_entries): Use DECL_THUNK_P.
	* dump.c (dequeue_and_dump): Remove THUNK_DECL handling.
	* except.c (nothrow_libfn_p): Use DECL_EXTERN_C_P.
	* expr.c (cplus_expand_expr): Remove THUNK_DECL handling.
	* method.c (make_thunk): Use SET_DECL_THUNK_P.  Set
	DECL_NO_STATIC_CHAIN.
	(emit_thunk): Don't play games with TREE_CODE on thunks.  Don't
	set DECL_DESTRUCTOR_P or DECL_CONSTRUCTOR_P on a thunk.
	* search.c (covariant_return_p): Remove THUNK_DECL handling.
	* ir.texi: Update.

From-SVN: r33647
2000-05-03 22:25:21 +00:00
Jason Merrill 88774c2cc6 spelling tweak
From-SVN: r33622
2000-05-02 21:35:11 -04:00
Mark Mitchell 4c0aad2c08 * decl2.c (finish_file): Fix typo in comment.
From-SVN: r33559
2000-05-01 01:43:24 +00:00
Alex Samuel 2a9a326b17 Makefile.in (OBJS): Add timevar.o.
hangeLog:

	* Makefile.in (OBJS): Add timevar.o.
	(toplev.o): Depend on timevar.h.
	(ggc-simple.o): Likewise.
	(ggc-page.o): Likewise.
	(timevar.o): New rule.
	(timevar.h): New rule.

	* timevar.h: New file.
	* timevar.c: Likewise.
	* timevar.def: Likewise.

	* toplev.h (gc_time, parse_time, varconst_time): Remove.
	* toplev.c: Use timevar_push and timevar_pop instead of TIMEVAR
	throughout.
	(TIMEVAR): Remove macro.
	(gc_time, parse_time, varconst_time, integration_time, jump_time,
	cse_time, gcse_time, loop_time, cse2_time, branch_prob_time,
	flow_time, combine_time, regmove_time, sched_time,
	local_alloc_time, global_alloc_time, flow2_time, peephole2_time,
	sched2_time, dbr_sched_time, reorder_blocks_time,
	rename_registers_time, shorten_branch_time, stack_reg_time,
	to_ssa_time, from_ssa_time, final_time, symout_time, dump_time,
	all_time): Remove.
	(compile_file): Don't initialize time variables.  Call
	init_timevar and start TV_TOTAL timer.  Call timevar_print instead
	of many calls to print_time.
	(rest_of_compilation): Add timing for reload_cse_regs.
	(get_run_time): Removed to timevar.c.
	(print_time): Likewise.
	(get_run_time): Implement using TV_TOTAL time variable.
	(print_time): Get total run time from get_run_time.
	* ggc-page.c (ggc_collect): Push and pop TV_GC instead of
	computing elapsed time explicitly.
	* ggc-simple.c (ggc_collect): Likewise.
	(gc_time): Remove declaration.


cp/ChangeLog:

	* lex.c (my_get_run_time): Remove.
	(init_filename_times): Use get_run_time instead of my_get_run_time.
	(check_newline): Likewise.
	(dump_time_statistics): Likewise.
	* decl2.c (finish_file): Push and pop timevar TV_VARCONST instead
	of computing elapsed time explicitly.

From-SVN: r33496
2000-04-28 00:59:40 +00:00
Mark Mitchell fc611ce0f5 cp-tree.h (TREE_READONLY_DECL_P): Use DECL_P.
* cp-tree.h (TREE_READONLY_DECL_P): Use DECL_P.
	* init.c (decl_constant_value): Check TREE_READONLY_DECL_P.
	* call.c (convert_like_real): Don't test TREE_READONLY_DECL_P
	before calling decl_constant_value.
	* class.c (check_bitfield_decl): Likewise.
	* cvt.c (ocp_convert): Likewise.
	(convert): Likewise.
	* decl.c (compute_array_index_type): Likewise.
	(build_enumerator): Likewise.
	* decl2.c (check_cp_case_value): Likewise.
	* pt.c (convert_nontype_argument): Likewise.
	(tsubst): Likewise.
	* typeck.c (decay_conversion): Likewise.
	(build_compound_expr): Likewise.
	(build_reinterpret_cast): Likewise.
	(build_c_cast): Likewise.
	(convert_for_assignment): Likewise.

From-SVN: r33446
2000-04-26 15:43:50 +00:00
Zack Weinberg ac09f4822b decl2.c (finish_file): Remove double setup for accounting compile time.
* decl2.c (finish_file): Remove double setup for accounting
	compile time.

From-SVN: r33386
2000-04-24 18:42:22 +00:00
Jason Merrill 6e9dcc25c1 typeck.c (build_x_function_call): Resolve an OFFSET_REF.
* typeck.c (build_x_function_call): Resolve an OFFSET_REF.

        * call.c (joust): Exit early if we get the same function, too.

        * decl2.c (key_method): Return NULL_TREE for template classes.
        (import_export_class): Don't need to check for template classes.

From-SVN: r33273
2000-04-20 01:53:58 -04:00
Mark Mitchell 0d9eb3ba29 cp-tree.h (lang_decl_flags): Remove const_memfunc and volatile_memfunc.
* cp-tree.h (lang_decl_flags): Remove const_memfunc and
	volatile_memfunc.  Add destructor_attr.  Adjust dummy.
	(DECL_DESTRUCTOR_P): Use destructor_attr.
	(DECL_CONST_MEMFUNC_P): Reimplement.
	(DECL_VOLATILE_MEMFUNC_P): Remove.
	* class.c (finish_struct_methods): Use CLASSTYPE_DESTRUCTORS.
	(overrides): Use DECL_DESTRUCTOR_P.
	(check_for_override): Likewise.
	* decl.c (start_function): Likewise.
	* decl2.c (grokfclassfn): Likewise.
	(check_classfn): Likewise.
	(grok_function_init): Likewise.

From-SVN: r33235
2000-04-18 20:21:39 +00:00
Mark Mitchell 009e98457a decl2.c (grokfield): Issue error on illegal data member declaration.
* decl2.c (grokfield): Issue error on illegal data member
	declaration.

From-SVN: r33220
2000-04-18 01:30:21 +00:00
Richard Kenner b9bfacf01c Makefile.in (ggc-page.o): Now includes toplev.h.
* Makefile.in (ggc-page.o): Now includes toplev.h.
	* ggc-page.c (toplev.h): Now included.
	(gc_time): Remove declaration.
	(ggc_collect): TIME now long.
	* toplev.c (parse_time, varasm_time, gc_time): Still global; all
	others static.
	* toplev.h (gc_time, parse_time, gc_time): New declarations.
	* cp/decl2.c (parse_time, varconst_time): Delete declarations.
	(finish_file): Delete LINENO declaration.
	START_TIME and THIS_TIME now long.

From-SVN: r33169
2000-04-15 15:54:26 -04:00
Mark Mitchell db9b217498 cp-tree.h (cp_tree_index): Add CPTI_DTOR_IDENTIFIER.
* cp-tree.h (cp_tree_index): Add CPTI_DTOR_IDENTIFIER.
	(complete_dtor_identifier): New macro.
	(CLASSTYPE_FIRST_CONVERSION): Remove.
	(CLASSTYPE_CONSTRUCTOR_SLOT): New macro.
	(CLASSTYPE_DESTRUCTOR_SLOT): Likewise.
	(CLASSTYPE_FIRST_CONVERSION_SLOT): Likewise.
	(CLASSTYPE_CONSTRUCTORS): Likewise.
	(CLASSTYPE_DESTRUCTORS): Likewise.
	(lang_decl): Add cloned_function.
	(DECL_COMPLETE_CONSTRUCTOR_P): New macro.
	(DECL_BASE_CONSTRUCTOR_P): Likewise.
	(DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P): Likewise.
	(DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P): Likewise.
	(DECL_CLONED_FUNCTION_P): Likewise.
	(DECL_CLONED_FUNCTION): Likewise.
	(clone_function_decl): Declare.
	(maybe_clone_body): Likewise.
	* call.c (build_user_type_conversion_1): Call complete object
	constructors in the new ABI.
	(build_new_method_call): Don't add in-charge parameters under the
	new ABI.
	* class.c (add_method): Use DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P,
	DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P, CLASSTYPE_CONSTRUCTOR_SLOT, and
	CLASSTYPE_DESTRUCTOR_SLOT.
	(build_clone): New function.
	(clone_function_decl): Likewise.
	(clone_constructors_and_destructors): Likewise.
	(check_bases_and_members): Use it.
	* decl.c (iniitialize_predefined_identifiers): Initialize
	complete_dtor_identifier.
	(finish_function): Don't add extra code to a clone.
	(lang_mark_tree): Mark cloned_function.
	* decl2.c (mark_used): Don't bother trying to instantiate things
	we synthesized.
	* dump.c (dequeue_and_dump): Don't dump CP_DECL_CONTEXT twice.
	* method.c (set_mangled_name_for_decl): Don't treat clones as
	constructors.
	(synthesize_method): Sythesize cloned functions, not the clones.
	* optimize.c (inline_data): Update comment on ret_label.
	(remap_block): Don't assume DECL_INITIAL exists.
	(copy_body_r): Allow ret_label to be NULL.
	(maybe_clone_body): Define.
	* pt.c (tsubst_decl): Handle clones.
	(instantiate_clone): New function.
	(instantiate_template): Use it.
	(set_mangled_name_for_template_decl): Don't treat clones as
	constructors.
	* search.c (lookup_fnfields_1): Use CLASSTYPE_CONSTRUCTOR_SLOT,
	CLASSTYPE_DESTRUCTOR_SLOT, and CLASSTYPE_FIRST_CONVERSION_SLOT.
	* semantics.c (expand_body): Clone function bodies as necessary.

From-SVN: r33084
2000-04-11 20:16:36 +00:00
Mark Mitchell 454fa7a7db cp-tree.h (lang_decl_flags): Rename constructor_for_vbase_attr to has_in_charge_parm_p.
* cp-tree.h (lang_decl_flags): Rename constructor_for_vbase_attr
	to has_in_charge_parm_p.
	(DECL_CONSTRUCTOR_FOR_VBASE_P): Rename to ...
	(DECL_HAS_IN_CHARGE_PARM_P): ... this.
	(DECL_COPY_CONSTRUCTOR_P): New macro.
	* call.c (add_function_candidate): Use DECL_HAS_IN_CHARGE_PARM_P.
	(build_user_type_conversion_1): Likewise.
	(convert_like_real): Likewise.
	(build_over_call): Likeiwse.  Use DECL_COPY_CONSTRUCTOR_P.
	* decl.c (grokdeclarator): Use DECL_HAS_IN_CHARGE_PARM_P.
	(copy_args_p): Likewise.
	(grok_ctor_properties): Likewise.
	(start_function): Likewise.
	* decl2.c (maybe_retrofit_in_charge): Likewise.  Set it.
	* error.c (dump_function_decl): Use DECL_HAS_IN_CHARGE_PARM_P.
	* init.c (emit_base_init): Use DECL_COPY_CONSTRUCTOR_P.
	* method.c (do_build_copy_constructor): Use
	DECL_HAS_IN_CHARGE_PARM_P.
	(synthesize_method): Likewise.
	* pt.c (instantiate_template): Remove goto.
	* tree.c (build_cplus_method_type): Remove mention of obstacks in
	comment.

From-SVN: r33080
2000-04-11 16:56:14 +00:00
Mark Mitchell 0acf7199cc cp-tre.h (finish_function): Change prototype.
* 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-11 16:27:42 +00:00
Jason Merrill 2bdb0643b3 class.c (instantiate_type): Handle object-relative template-id.
* 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-10 20:38:39 -04:00
Martin v. Löwis 775afb2516 invoke.texi (-ansi): Remove -foperator-names from list of implied options.
* invoke.texi (-ansi): Remove -foperator-names from list of
	implied options. Do not call it ANSI C++.
	(-foperator-names): Document as -fno-operator-names.
	* cp/decl2.c (flag_operator_names): Default to 1.
	(lang_decode_option): Do not set it for -ansi.

From-SVN: r33051
2000-04-10 07:48:15 +00:00
Mark Mitchell 144af36dbe cp-tree.h (struct lang_decl): Remove main_decl_variant.
* cp-tree.h (struct lang_decl): Remove main_decl_variant.
	(DECL_MAIN_VARIANT): Remove.
	* decl.c (duplicate_decls): Don't set it.
	(start_function): Likewise.
	(lang_mark_tree): Don't mark it.
	* decl2.c (defer_fn): Don't use it.
	* lex.c (retrofit_lang_decl): Don't set it.
	* pt.c (tsubst_decl): Likewise.
	* ptree.c (print_lang_decl): Don't print it.
	* typeck.c (mark_addressable): Don't use it.

From-SVN: r33048
2000-04-10 06:53:57 +00:00
Mark Mitchell 56e770bfd6 cp-tree.h (lang_decl_flags): Rename saved_inline to deferred.
* 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-06 16:30:45 +00:00
Benjamin Kosnik d312ec72ba decl2.c: Make flag_honor_std dependant on ENABLE_STD_NAMESPACE.
2000-04-05  Benjamin Kosnik  <bkoz@cygnus.com>

        * decl2.c: Make flag_honor_std dependant on ENABLE_STD_NAMESPACE.

From-SVN: r32961
2000-04-06 06:44:42 +00:00
Mark Mitchell 16d53b6439 cp-tree.h (instantiate_decl): Change prototype.
* cp-tree.h (instantiate_decl): Change prototype.
	* decl2.c (mark_used): Adjust call.
	* optimize.c (inlinable_function_p): Adjust handling of templates.
	* pt.c (do_decl_instantiation): Adjust call to instantiate_decl.
	(do_type_instantiation): Likewise.
	(instantiate_decl): Defer more templates.
	(instantiate_pending_templates): Adjust logic to handle inline
	friend functions.

From-SVN: r32959
2000-04-06 03:12:19 +00:00
Mark Mitchell bedda2da7f final.c (final): Use xcalloc to allocate line_note_exists.
* final.c (final): Use xcalloc to allocate line_note_exists.
	* function.c (free_after_compilation): Free the temp_slots.
	(assign_stack_temp_for_type): Use xmalloc to allocate temp_slots.
	(combine_temp_slot): Free temp_slots when they get combined.
	(purge_addressof): Fix typo in comment.
	* stmt.c (mark_goto_fixup): Mark the fixup itself.
	(expand_fixup): Allocate the fixup with ggc_alloc_obj.

	* ggc.h: Include varray.h.
	(ggc_pending_trees): Declare.
	(ggc_mark_tree_children): Remove declaration.
	(ggc_mark_tree): Just push unmarked trees on ggc_pending_trees.
	* ggc-common.c (ggc_pending_trees): New variable.
	(ggc_mark_roots): Call ggc_mark_trees.
	(ggc_mark_tree_children): Rename to ggc_mark_trees.  Process all
	the ggc_pending_trees.
	* Makefile.in (GGC_H): New variable.  Use it throughout in place
	of ggc.h.

	* Makefile.in (GGC_H): New variable.  Use it throughout in place
	of ggc.h.

	* call.c: Don't include obstack.h.  Include ggc.h.
	(obstack_chunk_alloc): Don't define.
	(obstack_chunk_free): Likewise.
	(add_candidate): Allocate the z_candidate with ggc_alloc_obj.
	* decl.c (push_switch): Use xmalloc to allocate the cp_switch.
	(pop_switch): Free it.

	* decl2.c (grokclassfn): Set TREE_READONLY for PARM_DECLs.

	* dump.c (dequeue_and_dump): Don't try to print the bit_position
	if we don't have a DECL_FIELD_OFFSET.

	* Makefile.in (GGC_H): Add varray.h.

From-SVN: r32956
2000-04-06 00:51:25 +00:00