Commit Graph

850 Commits

Author SHA1 Message Date
Gabriel Dos Reis c4f731746a Convert diagnostics to use quoting flag q 9/n
Convert diagnostics to use quoting flag q 9/n
        * typeck.c (build_x_unary_op, convert_member_func_to_ptr,
        get_delta_difference):  Use new quotation style.
        * repo.c (reopen_repo_file_for_write): Likewise.
        * pt.c (do_type_instantiation): Likewise.
        * parser.c (cp_parser_diagnose_invalid_type_name):
        * name-lookup.c (push_overloaded_decl, set_decl_namespace):
        * error.c (cp_print_error_function,
        print_instantiation_full_context): Likewise.
        * decl.c (define_label, grok_reference_init,
        maybe_deduce_size_from_array_init, revert_static_member_fn):
        * decl2.c (check_classfn): Likewise.
        * class.c (add_method, check_field_decls, layout_class_type,
        resolve_address_of_overloaded_function): Likewise.
        * call.c (build_x_va_arg, build_over_call): Likewise.

From-SVN: r89938
2004-11-01 09:47:59 +00:00
Giovanni Bajo 9596e0648d re PR c++/17743 (dependent expressions in attributes)
PR c++/17743
	* decl2.c (grokfield): Apply attributes also to TYPE_DECLs.

	PR c++/17743
	* g++.dg/ext/attrib17.C: New test.

From-SVN: r89164
2004-10-17 04:39:46 +00:00
Frank Ch. Eigler ccab73c3b7 toplev.c (compile_file): Call mudflap_finish_file from here ...
2004-10-13  Frank Ch. Eigler  <fche@redhat.com>

	* toplev.c (compile_file): Call mudflap_finish_file from here ...
	* c-decl.c (c_write_global_declarations): ... instead of here ...
	* cp/decl.c (cp_finish_file): ... and here.
	* tree-mudflap.c (mudflap_enqueue_decl): Reword a warning message.

From-SVN: r88995
2004-10-13 18:18:18 +00:00
Mark Mitchell 06c00c701b re PR c++/17929 (ICE with qualified name in template specialization)
PR c++/17929
	* decl2.c (finish_anon_union): Robustify.

From-SVN: r88886
2004-10-11 16:59:23 +00:00
Mark Mitchell c7222c0224 cp-tree.h (ICS_USER_FLAG): Remove comment about obsolete flag.
* cp-tree.h (ICS_USER_FLAG): Remove comment about obsolete flag.
	(DECL_MEMBER_TEMPLATE_P): New macro.
	(is_member_template): Remove.
	(class_method_index_for_fn): New function.
	* pt.c (build_over_call): Use DECL_MEMBER_TEMPLATE_P.
	* class.c (finish_struct_methods): Remove out-of-date comment.
	* decl.c (copy_fn_p): Use DECL_MBMER_TEMPLATE_P.
	* decl2.c (check_classfn): Use DECL_MEMBER_TEMPLATE_P and
	class_method_index_for_fn.
	* pt.c (is_member_template): Remove.
	(is_member_template_class): Likewise.
	(optimize_specialization_lookup_p): New function.
	(retrieve_specialization): Optimize lookups for members that are
	not member templates.
	(register_specialization): Adjust accordingly.
	(build_template_decl): Add member_template_p parameter.  Set
	DECL_MEMBER_TEMPLATE_P.
	(process_partial_specialization): Adjust call to
	retrieve_specialization.
	(push_template_decl_real): Determine whether the template is a
	member template.
	(lookup_template_class): Use retrieve_specialization.
	(tsubst_decl): Adjust call to retrieve_specialization.
	(tsubst_exception_specification): New function.
	(tsubst): Use it.
	(tsubst_copy): Use DECL_MEMBER_TEMPLATE_P.
	(instantiate_template): Adjust call to retrieve_specialization.
	(regenerate_decl_from_template): Do not actually generate a new
	DECL.
	(instantiate_decl): Adjust call to retrieve_specialization.
	(class_method_index_for_fn): New method.

From-SVN: r88697
2004-10-07 17:48:36 +00:00
Gabriel Dos Reis 2d01edd760 Convert diagnostics to use quoting flag q 3/n
cp/
        Convert diagnostics to use quoting flag q 3/n
        * decl.c (pop_label, duplicate_decls,
        redeclaration_error_message,
        redeclaration_error_message, lookup_label, check_goto,
        make_typename_type, make_unbound_class_template,
        fixup_anonymous_aggr, check_tag_decl, start_decl,
        start_decl_1,
        grok_reference_init, layout_var_decl, maybe_commonize_var,
        check_for_uninitialized_const_var, reshape_init_array,
        reshape_init, check_initializer, cp_finish_decl,
        member_function_or_else, bad_specifiers, grokfndecl,
        grokvardecl,
        check_static_variable_definition, compute_array_index_type,
        create_array_type_for_decl,
        check_special_function_return_type,
        grokdeclarator, check_default_argument, grokparms,
        grok_ctor_properties, grok_op_properties,
        check_elaborated_type_specifier, xref_tag, finish_enum,
        build_enumerator, check_function_type,
        start_preparsed_function,
        store_parm_decls): Use quoting formats.
        * decl2.c (grok_array_decl, delete_sanity,
        check_member_template,
        check_java_method, check_classfn,
        finish_static_data_member_decl,
        grokfield, grokbitfield, grok_function_init,
        build_anon_union_vars, coerce_new_type, coerce_delete_type,
        check_default_args): Likewise.
        * parser.c (cp_parser_decl_specifier_seq): Likewise.

testsuite/
        * g++.dg/template/local1.C: Adjust quoting marks in
        testing for diagnostics.
        * g++.dg/tls/diag-2.C: Likewise.
        * g++.dg/other/error8.C: Likewise.

From-SVN: r88478
2004-10-04 06:04:43 +00:00
Nathan Sidwell 942149531d cp-tree.h (unemitted_tinfo_decls): Make a VEC(tree).
* cp-tree.h (unemitted_tinfo_decls): Make a VEC(tree).
	* decl2.c (cp_finish_file): Adjust tinfo decl emission loop.
	* rtti.c (unemitted_tinfo_decls): Make a VEC(tree).
	(init_rtti_processing): Initialize it to something realistic.
	(get_tinfo_decl): Adjust pushing the new decl.

From-SVN: r87872
2004-09-22 18:12:10 +00:00
Nathan Sidwell 5775a06aa6 cp-tree.h (struct lang_type_header): Remove uses_multiple_inheritance field.
* cp-tree.h (struct lang_type_header): Remove
	uses_multiple_inheritance field.
	(TYPE_USES_MULTIPLE_INHERITANCE): Remove.
	(TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P): Remove.
	(TYPE_USES_VIRTUAL_BASECLASSES): Remove.
	(DECL_NEEDS_VTT_PARM_P): Use CLASSTYPE_VBASECLASSES.
	(TYPE_CONTAINS_VPTR_P): Likewise.
	* call.c (add_template_candidate_real): Use
	CLASSTYPE_VBASECLASSES.
	(build_special_member_call): Likewise.
	* class.c (finish_struct_bits): Remove
	TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P & TYPE_USES_VIRTUAL_BASECLASSES
	bookkeeping.
	(check_bases_and_members): Use TYPE_CONTAINS_VPTR_P.
	(create_vtable_ptr): Remove TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P
	bookkeeping.
	(build_vtt_inits): Use CLASSTYPE_VBASECLASSES.
	(accumulate_vtbl_inits, build_vbase_offset_vtbl_entries):
	Likewise.
	* decl.c (xref_basetypes): Remove TYPE_USES_MULTIPLE_INHERITANCE,
	TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES
	bookkeeping.
	(cxx_maybe_build_cleanup): Use CLASSTYPE_VBASECLASSES.
	* decl2.c (maybe_retrofit_in_chrg): Likewise.
	* init.c (expand_member, push_base_cleanups): Likewise.
	* pt.c (instantiate_class_template): Remove
	TYPE_USES_MULTIPLE_INHERITANCE,
	TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES
	bookkeeping.
	* ptree.c (cxx_print_type): Remove TYPE_USES_MULTIPLE_INHERITANCE
	check.
	* typeck2.c (process_init_constructor): Replace some sorrys with
	asserts.

From-SVN: r87808
2004-09-21 15:39:00 +00:00
Mark Mitchell 5bd916325a decl2.c (determine_visibility): Allow class visibility directives to override targetm.cxx.export_class_data.
* decl2.c (determine_visibility): Allow class visibility
	directives to override targetm.cxx.export_class_data.

[[Split portion of a mixed commit.]]

From-SVN: r87735.2
2004-09-19 23:18:19 +00:00
Zack Weinberg 5d709b0013 c-common.h (struct c_fileinfo): Comment moved here from cp-tree.h.
* c-common.h (struct c_fileinfo): Comment moved here from cp-tree.h.
	(extract_interface_info): Delete prototype.
	* c-decl.c (extract_interface_info): Delete stub.
	* c-lex.c (get_fileinfo): Initialize file_info_tree here, if
	it's not already been done ...
	(init_c_lex): ... not here.
	(fe_file_change): Don't call extract_interface_info.
cp:
	* cp-tree.h (interface_only, interface_unknown): Delete declarations;
	comment explaining them moved to c-common.h.
	* lex.c (interface_only, interface_unknown, extract_interface_info):
	Delete definitions.
	(cxx_finish): Don't reset interface_unknown.
	(handle_pragma_interface): Don't set interface_only and
	interface_unknown; just the like-named fields in finfo.
	(handle_pragma_implementation): Adjust comment.
	* decl2.c (cp_finish_file): Don't reset interface_only and
	interface_unknown.
	* method.c (synthesize_method): Don't reset interface_unknown or
	call extract_interface_info.
	* pt.c (pop_tinst_level): Don't call extract_interface_info.
	* decl.c (start_cleanup_fn): Don't save or restore interface_only
	and interface_unknown.
	(make_rtl_for_nonlocal_decl): Call get_fileinfo on input_filename
	and use the result instead of the interface_only/interface_unknown
	globals.
	(start_preparsed_function): Likewise.
	* lex.c (cxx_make_type): Likewise.
	* semantics.c (begin_class_definition): Likewise.
	(expand_body): Don't call extract_interface_info.

From-SVN: r87329
2004-09-10 23:56:31 +00:00
Kazu Hirata 77880ae492 class.c, [...]: Fix comment typos.
* class.c, cp-tree.h, decl.c, decl2.c, mangle.c,
	name-lookup.h, parser.c, search.c, semantics.c, typeck2.c: Fix
	comment typos.

From-SVN: r87292
2004-09-10 11:12:15 +00:00
Zack Weinberg 15072eb129 defaults.h (MULTIPLE_SYMBOL_SPACES): Provide default.
* defaults.h (MULTIPLE_SYMBOL_SPACES): Provide default.
	* config/arm/pecoff.h, config/i386/beos-elf.h
	* config/i386/cygming.h, config/i386/i386-interix.h:
	Define MULTIPLE_SYMBOL_SPACES to 1, not nothing.  Remove
	comment cloned from manual.
	* doc/tm.texi: Update description of MULTIPLE_SYMBOL_SPACES.
cp:
	* decl2.c (import_export_class)
	* lex.c (handle_pragma_interface):
	Test MULTIPLE_SYMBOL_SPACES with if, not #ifdef.

From-SVN: r87243
2004-09-09 17:11:18 +00:00
Paul Brook 96f629573d decl2.c (determine_visibility): Only check data visibility for VAR_DECLS.
* decl2.c (determine_visibility): Only check data visibility
	for VAR_DECLS.

[[Split portion of a mixed commit.]]

From-SVN: r86983.2
2004-09-02 19:32:57 +00:00
Mark Mitchell 505970fc33 target-def.h (TARGET_CXX): Add TARGET_CXX_EXPORT_CLASS_DATA.
* target-def.h (TARGET_CXX): Add TARGET_CXX_EXPORT_CLASS_DATA.
	* target.h (cxx): Add export_class_data.
	* config/arm/arm.c (arm_cxx_export_class_data): New function.
	(TARGET_CXX_EXPORT_CLASS_DATA): Use it.
	* testsuite/g++.dg/ext/visibility/arm1.C: New test.

	* cp-tree.h (DECL_CONSTRUCTION_VTABLE_P): New macro.
	* class.c (build_ctor_vtbl_group): Set DECL_CONSTRUCTION_VTABLE_P.
	* decl2.c (determine_visibility): Honor
	TARGET_CXX_EXPORT_CLASS_DATA.

	* g++.dg/ext/visibility/arm1.C: New test.

From-SVN: r86867
2004-09-01 03:45:30 +00:00
Mark Mitchell af28769744 hooks.c (hook_bool_void_true): New function.
* hooks.c (hook_bool_void_true): New function.
	* hooks.h (hook_bool_void_true): Declare.
	* target-def.h (TARGET_CXX): Add
	TARGET_CXX_KEY_METHOD_MAY_BE_INLINE.
	* target.h (struct cxx): Add key_method_may_be_inline.
	* config/arm/arm.c (arm_cxx_key_method_may_be_inline): New
	function.
	(TARGET_CXX_KEY_METHOD_MAY_BE_INLINE): New macro.
	* config/arm/bpabi.h: Use __THUMB_INTERWORK__ instead of
	__THUMB_INTERWORK.

 	* class.c (key_method): Rename to ...
	(determine_key_method): ... this.
	(finish_struct_1): Adjust accordingly.
	* cp-tree.h (key_method): Declare.
	* decl2.c (maybe_emit_vtables): Determine the key method here if
	it has not already been done.

	* g++.dg/abi/key1.C: New test.

From-SVN: r86843
2004-08-31 20:29:28 +00:00
Ziemowit Laski 11bb4b2798 Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-objcp-common.o.
2004-08-31  Ziemowit Laski  <zlaski@apple.com>

        * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-objcp-common.o.
        (cp/cp-lang.o): Depend on debug.h, gtype-cp.h and cp/cp-objcp-common.h.
        (cp/cp-decl.c): Do not depend on gtype-cp.h.
        (cp/cp-objcp-common.o): New target.
        * cp-lang.c: Include debug.h, cp-objcp-common.h and gtype-cp.h.
        (cxx_get_alias_set, cxx_warn_unused_global_decl, cp_expr_size,
        cp_tree_size, cp_var_mod_type_p, cxx_initialize_diagnostics): Move
        prototypes and definitions to cp-objcp-common.h and cp-objcp-common.c,
        respectively.
        (LANG_HOOKS_TREE_SIZE, LANG_HOOKS_FINISH,
        LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_INIT_OPTIONS,
        LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION,
        LANG_HOOKS_HANDLE_FILENAME, LANG_HOOKS_MISSING_ARGUMENT,
        LANG_HOOKS_POST_OPTIONS, LANG_HOOKS_GET_ALIAS_SET,
        LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_EXPAND_EXPR,
        LANG_HOOKS_EXPAND_DECL, LANG_HOOKS_PARSE_FILE,
        LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, LANG_HOOKS_TRUTHVALUE_CONVERSION,
        LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, LANG_HOOKS_MARK_ADDRESSABLE,
        LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
        LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
        LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_PRINT_ERROR_FUNCTION,
        LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, LANG_HOOKS_WRITE_GLOBALS,
        LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL,
        LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P,
        LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE,
        LANG_HOOKS_ATTRIBUTE_TABLE, LANG_HOOKS_TREE_INLINING_WALK_SUBTREES,
        LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN,
        LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS,
        LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P,
        LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P,
        LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P,
        LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN,
        LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN, LANG_HOOKS_EXPR_SIZE,
        LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR,
        LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_MAKE_TYPE,
        LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE,
        LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
        LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, LANG_HOOKS_INCOMPLETE_TYPE_ERROR,
        LANG_HOOKS_TYPE_PROMOTES_TO, LANG_HOOKS_REGISTER_BUILTIN_TYPE,
        LANG_HOOKS_GIMPLIFY_EXPR, LANG_HOOKS_FOLD_OBJ_TYPE_REF): Move
        hooks to cp-objcp-common.h.
        (finish_file): New function.
        * cp-objcp-common.c: New file.
        * cp-objcp-common.h: New file.
        * cp-tree.h (cp_finish_file): New prototype.
        * decl.c: Do not include gtype-cp.h.
        * decl2.c (finish_file): Rename to cp_finish_file.

From-SVN: r86837
2004-08-31 18:51:08 +00:00
Nathan Sidwell 8dc2b10365 call.c (check_dtor_name): Replace abort with gcc_assert or gcc_unreachable.
* call.c (check_dtor_name): Replace abort with gcc_assert or
	gcc_unreachable.
	(build_call, add_builtin_candidate, build_new_op,
	convert_like_real, build_over_call, in_charge_arg_for_name,
	source_type, joust): Likewise.
	* class.c (build_simple_base_path, get_vcall_index,
	finish_struct_1, instantiate_type, get_enclosing_class,
	add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise.
	* cp-gimplify.c (cp_genericize): Likewise.
	* cp-lang.c (cp_expr_size, cp_tree_size): Likewise.
	* cvt.c (cp_convert_to_pointer, ocp_convert): Likewise.
	* decl.c (poplevel, make_unbound_class_template, reshape_init,
	check_special_function_return_type, grokdeclarator,
	grok_op_properties, tag_name, xref_tag, start_preparsed_function,
	finish_function): Likewise.
	* decl2.c (grokfield, maybe_emit_vtables):Likewise.
	* error.c (dump_global_iord, dump_decl, dump_template_decl,
	language_to_string): Likewise.
	* except.c (choose_personality_routine): Likewise.
	* friend.c (do_friend): Likewise.
	* g++spec.c (lang_specific_driver): Likewise.
	* init.c (build_zero_init, expand_default_init, build_new_1,
	build_vec_delete_1, build_vec_init, build_dtor_call): Likewise.
	* lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise.
	* mangle.c (add_substitution, write_unscoped_name,
	write_template_prefix, write_identifier,
	write_special_name_destructor, write_type, write_builtin_type,
	write_expression, write_template_param,
	write_java_integer_type_codes): Likewise.
	* method.c (implicitly_declare_fn): Likewise.

From-SVN: r86778
2004-08-30 15:28:48 +00:00
Jason Merrill 40aac94801 re PR c++/13684 (local static object variable constructed once but ctors and dtors called multiple times on same memory when called in multiple threads)
PR c++/13684
        * cp/decl.c (expand_static_init): Use thread-safety API.
        (register_dtor_fn): Return the call, don't expand it.
        * cp/tree.c (add_stmt_to_compound): New fn.
        (stabilize_call): Use it.
        * gimplify.c (gimplify_cleanup_point_expr): Handle CLEANUP_EH_ONLY.
        (gimple_push_cleanup): Add eh_only parm.
        (gimplify_target_expr): Pass it.
        * c.opt (-fno-threadsafe-statics): New option.
        * c-opts.c (c_common_handle_option): Handle it.
        * c-common.h (flag_threadsafe_statics): Declare it.
        * c-common.c (flag_threadsafe_statics): Record it.
        * doc/invoke.texi: Document it.
        * tsystem.h (_GNU_SOURCE): Define.
        * gthr-posix.h (__gthread_recursive_mutex_t): New typedef.
        (__GTHREAD_RECURSIVE_MUTEX_INIT): New macro.
        (__GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION): New macro.
        (__gthread_recursive_mutex_init_function): New fn.
        (__gthread_recursive_mutex_lock): New fn.
        (__gthread_recursive_mutex_trylock): New fn.
        (__gthread_recursive_mutex_unlock): New fn.
        * gthr-solaris.h, gthr-single.h, gthr-dce.h: Likewise.
        * gthr-win32.h, gthr-vxworks.h: Likewise.
        * gthr.h: Document.

        * libsupc++/guard.cc (static_mutex): Internal class implementing a
        recursive mutex which controls initialization of local statics.
        (__gnu_cxx::recursive_init): New exception class.
        (__cxa_guard_acquire): Deal with locking and recursion detection.
        (acquire_1, __cxa_guard_abort, __cxa_guard_release): Likewise.

From-SVN: r86687
2004-08-27 22:33:54 -04:00
Nathan Sidwell 50bc768da1 call.c (validate_conversion_obstack): Replace my_friendly_assert with gcc_assert or gcc_unreachable.
* call.c (validate_conversion_obstack): Replace
	my_friendly_assert with gcc_assert or gcc_unreachable.
	(direct_reference_binding, merge_conversion_sequences,
	build_user_type_conversion_1, perform_overload_resolution,
	build_op_delete_call, enforce_access, call_builtin_trap,
	build_over_call, build_special_member_call, build_new_method_call,
	initialize_reference): Likewise.
	* class.c (build_base_path, build_primary_vtable, alter_access,
	check_bases, update_vtable_entry_for_fn, layout_empty_base,
	clone_function_decl, adjust_clone_args,
	type_requires_array_cookie, include_empty_classes,
	finish_struct_1, resolve_address_of_overloaded_function,
	instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits,
	dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group,
	accumulate_vtbl_inits, build_vtbl_initializer,
	build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise.
	* cvt.c (build_up_reference, convert_to_reference): Likewise.
	* decl.c (poplevel, duplicate_decls, make_typename_type,
	cxx_init_decl_processing, reshape_init, check_initializer,
	make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl,
	expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type,
	grokdeclarator, copy_fn_p, grok_op_properties, xref_tag,
	xref_basetypes, start_preparsed_function, save_function_data,
	finish_function, finish_method, maybe_register_incomplete_var,
	complete_vars): Likewise.
	* decl2.c (grok_array_decl, check_member_template,
	check_classfn, finish_static_data_member_decl, coerce_new_type,
	coerce_delete_type, import_export_class, decl_needed_p,
	determine_visibility, import_export_decl, build_cleanup,
	start_static_initialization_or_destructi, do_static_destruction,
	prune_vars_needing_no_initialization,
	build_offset_ref_call_from_tree): Likewise.
	* error.c (dump_decl, dump_expr): Likewise.
	* init.c (finish_init_stmts, build_zero_init,
	expand_virtual_init, expand_default_init, expand_aggr_init_1,
	build_offset_ref, build_new_1, build_delete, build_vbase_delete):
	Likewise.
	* mangle.c (write_method_parms, write_template_args,
	write_expression, write_template_arg): Likewise.
	* method.c (make_thunk, finish_thunk, use_thunk): Likewise.
	* name-lookup.c (pop_binding, begin_scope, leave_scope,
	resume_scope, push_using_decl, validate_nonmember_using_decl,
	is_ancestor, poplevel_class, set_inherited_value_binding_p,
	push_class_level_binding, do_class_using_decl, push_namespace,
	pop_namespace, add_using_namespace, ambiguous_decl,
	lookup_namespace_name, lookup_type_current_level,
	maybe_process_template_type_declaration): Likewise.
	* parser.c (cp_lexer_peek_nth_token,
	cp_parser_parse_and_diagnose_invalid_typ,
	cp_parser_translation_unit, cp_parser_template_id,
	cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise.
	* pt.c (push_access_scope, finish_member_template_decl,
	push_inline_template_parms_recursive, add_outermost_template_args,
	get_innermost_template_args, begin_explicit_instantiation,
	end_explicit_instantiation, retrieve_specialization,
	is_specialization_of, is_specialization_of_friend,
	register_specialization, check_explicit_specialization,
	comp_template_parms, process_template_parm,
	process_partial_specialization, convert_nontype_argument,
	coerce_template_template_parms, coerce_template_parms,
	mangle_class_name_for_template, lookup_template_function,
	lookup_template_class, instantiate_class_template, tsubst_decl,
	tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy,
	instantiate_template, fn_type_unification, type_unification_real,
	get_template_base, regenerate_decl_from_template,
	template_for_substitution, instantiate_decl,
	get_mostly_instantiated_function_type, dependent_scope_ref_p,
	value_dependent_expression_p, resolve_typename_type): Likewise.
	* repo.c (repo_emit_p): Likewise.
	* rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init,
	create_tinfo_types, emit_tinfo_decl): Likewise.
	* search.c (lookup_base_r, lookup_base, lookup_field_1,
	dfs_access_in_type, build_baselink, lookup_member,
	adjust_result_of_qualified_name_lookup, copied_binfo): Likewise.
	* semantics.c (perform_or_defer_access_check,
	finish_non_static_data_member, finish_stmt_expr_expr,
	finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr,
	finish_template_template_parm, finish_member_declaration,
	emit_associated_thunks): Likewise.
	* tree.c (build_target_expr_with_type, force_target_expr,
	copy_binfo, get_first_fn, cp_tree_equal): Likewise.
	* typeck.c (type_after_usual_arithmetic_conversions, comptypes,
	cxx_sizeof_or_alignof_type, perform_integral_promotions,
	build_class_member_access_expr, finish_class_member_access_expr,
	build_ptrmemfunc_access_expr, build_unary_op,
	unary_complex_lvalue, cxx_mark_addressable, build_modify_expr,
	build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr
	* typeck2.c (complete_type_check_abstract,
	abstract_virtuals_error, process_init_constructor,
	add_exception_specifier): Likewise.

From-SVN: r86669
2004-08-27 17:59:33 +00:00
Nathan Sidwell 7d60be94d6 tree.h (build_int_cst): New, sign extended constant.
* tree.h  (build_int_cst): New, sign extended constant.
	(build_int_cstu): New, zero extended constant.
	(build_int_cst_wide): Renamed from build_int_cst.
	* tree.c (build_int_cst, build_int_cstu): New.
	(build_int_cst_wide): Renamed from build_int_cst.
	(make_vector_type, build_common_tree_nodes,
	build_common_tree_nodes_2): Adjust build_int_cst calls.
	* builtins.c (expand_builtin_prefetch, expand_builtin_strstr,
	expand_builtin_strpbrk, expand_builtin_fputs,
	build_string_literal, expand_builtin_printf,
	expand_builtin_sprintf, fold_builtin_classify_type,
	fold_builtin_lround, fold_builtin_bitop, fold_builtin_isascii,
	fold_builtin_toascii, fold_builtin_isdigit,
	simplify_builtin_strstr, simplify_builtin_strpbrk,
	fold_builtin_fputs, simplify_builtin_sprintf): Likewise.
	* c-common.c (start_fname_decls, fix_string_type, shorten_compare,
	DEF_ATTR_INT): Likewise.
	* c-decl.c (complete_array_type, check_bitfield_type_and_width):
	Likewise.
	* c-lex.c (interpret_integer, lex_charconst): Likewise.
	* c-parse.in (primary) <TYPES_COMPATIBLE_P> Likewise.
	* c-pretty-print.c (pp_c_integer_constant): Likewise.
	* c-typeck.c (really_start_incremental_init, push_init_level,
	set_nonincremental_init_from_string): Likewise.
	* calls.c (load_register_parameters): Likewise.
	convert.c (convert_to_pointer): Likewise.
	coverage.c (coverage_counter_alloc, tree_coverage_counter_ref,
	build_fn_info_type, build_fn_info_value, build_ctr_info_value,
	build_gcov_info): Likewise.
	* except.c (init_eh, assign_filter_values): Likewise.
	* expmed.c (store_fixed_bit_field, extract_bit_field,
	extract_fixed_bit_field, extract_split_bit_field, expand_shift,
	expand_mult_const, expand_mult_highpart_adjust, extract_high_half,
	expand_sdiv_pow2, expand_divmod, make_tree): Likewise.
	* expr.c (convert_move, emit_group_load, emit_group_store,
	expand_assignment, store_constructor, store_field,
	expand_expr_real_1, reduce_to_bit_field_precision): Likewise.
	fold-const.c (force_fit_type, int_const_binop, fold_convert_const,
	invert_truthvalue, optimize_bit_field_compare,
	decode_field_reference, all_ones_mask_p, constant_boolean_node,
	fold_div_compare, fold, fold_read_from_constant_string,
	fold_negate_const, fold_abs_const, fold_not_const, round_up,
	round_down): Likewise.
	* function.c (assign_parm_setup_block): Likewise.
	* stmt.c (shift_return_value, expand_case, estimate_case_costs):
	Likewise.
	* stor-layout.c (layout_type, initialize_sizetypes,
	set_min_and_max_values_for_integral_type): Likewise.
	* tree-chrec.c (chrec_fold_multiply_poly_poly,
	reset_evolution_in_loop): Likewise.
	* tree-chrec.h (build_polynomial_chrec): Likewise.
	* tree-complex.c (build_replicated_const): Likewise.
	* tree-eh.c (honor_protect_cleanup_actions,
	lower_try_finally_onedest, lower_try_finally_copy,
	lower_try_finally_switch): Likewise.
	* tree-mudflap.c (mf_build_string, mx_register_decls,
	mudflap_register_call, mudflap_enqueue_constant): Likewise.
	* tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise.
	* tree-pretty-print.c (dump_generic_node): Likewise.
	* tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref):
	Likewise.
	* tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise.
	* tree-ssa-loop-niter.c (number_of_iterations_cond,
	loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type):
	Likewise.
	* tree-ssa-loop-ivcanon.c (create_canonical_iv,
	canonicalize_loop_induction_variables): Likewise.
	* tree-vectorizer.c (vect_create_index_for_array_ref,
	vect_transform_loop_bound, vect_compute_data_ref_alignment):
	Likewise.

	* config/alpha/alpha.c (alpha_initialize_trampoline, alpha_va_start,
	alpha_gimplify_va_arg_1): Likewise.
	* config/arm/arm.c (arm_get_cookie_size): Likewise.
	* config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise.
	* config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise.
	* config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise.
	* config/mips/mips.c (mips_build_builtin_va_list, mips_va_start,
	mips_gimplify_va_arg_expr): Likewise.
	* config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise.
	* config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg,
	add_compiler_branch_island): Likewise.
	* config/s390/s390.c (s390_va_start): Likewise.
	* config/sh/sh.c (sh_va_start): Likewise.
	* config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start):
	Likewise.
	* config/xtensa/xtensa.c (xtensa_va_start,
	xtensa_gimplify_va_arg_expr): Likewise.

	* objc/objc-act.c (build_objc_string_object,
	build_objc_symtab_template, init_def_list, init_objc_symtab,
	init_module_descriptor, generate_static_references,
	build_selector_translation_table, get_proto_encoding,
	build_typed_selector_reference, build_selector_reference,
	build_next_objc_exception_stuff,
	build_method_prototype_list_template, generate_descriptor_table,
	generate_protocols, build_protocol_initializer,
	build_ivar_list_template, build_method_list_template,
	build_ivar_list_initializer, generate_ivars_list,
	generate_dispatch_table, generate_protocol_list,
	build_category_initializer, build_shared_structure_initializer,
	generate_shared_structures, handle_impent,
	generate_objc_image_info): Likewise.

2004-04-25  Paolo Bonzini  <bonzini@gnu.org>

	* cfglayout.c (duplicate_insn_chain): Remove references to
	NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT.
	* cfgloop.h (struct loop): Remove fields vtop, cont and cont_dominator.
	* cfgrtl.c (rtl_delete_block): Remove handling of NOTE_INSN_LOOP_CONT.
	* final.c (final_scan_insn): Remove references to NOTE_INSN_LOOP_VTOP
	and NOTE_INSN_LOOP_CONT.
	* insn-notes.def (NOTE_INSN_LOOP_VTOP, NOTE_INSN_LOOP_CONT): Remove.
	* jump.c (squeeze_notes): Remove references to NOTE_INSN_LOOP_VTOP
	and NOTE_INSN_LOOP_CONT.
	* loop.c (scan_loops, find_and_verify_loops, for_each_insn_in_loop,
	check_dbra_loop, loop_dump_aux): Remove references to removed notes
	and fields.
	* reorg.c (mostly_true_jump): Do not rely on NOTE_INSN_LOOP_VTOPs.
	* unroll.c (unroll_loop, copy_loop_body, loop_iterations): Remove
	references to removed notes and fields.
	(subtract_reg_term, ujump_to_loop_cont): Remove.

From-SVN: r86544
2004-08-25 09:52:54 +00:00
Kriang Lerdsuwanakij 35046a541c re PR c++/6749 (infinite loop with inheritance of abstract classes)
PR c++/6749
	* pt.c (instantiate_pending_templates): Add int parameter.  Don't
	return anything.
	* cp-tree.h (instantiate_pending_templates): Adjust prototype.
	* decl2.c (finish_file): Adjust call to
	instantiate_pending_templates.

	* g++.dg/template/vtable2.C: New test.

From-SVN: r86054
2004-08-16 14:29:27 +00:00
Nathan Sidwell 4a90aeeb51 tree.h (build_int_cst): New.
.:	* tree.h (build_int_cst): New.
	(build_int_2): Remove.
	* tree.c (build_int_2): Remove.
	(build_int_cst): New.
	(make_vector_type, build_common_tree_nodes,
	build_common_tree_nodes_2): Use build_int_cst.
	* builtins.c (expand_builtin_prefetch, expand_builtin_strstr,
	expand_builtin_strpbrk, expand_builtin_fputs,
	build_string_literal, expand_builtin_printf,
	expand_builtin_sprintf, fold_builtin_lround, fold_builtin_bitop,
	fold_builtin_bitop, fold_builtin_isascii, fold_builtin_toascii,
	fold_builtin_isdigit, simplify_builtin_strstr,
	simplify_builtin_strpbrk, fold_builtin_fputs,
	simplify_builtin_sprintf): Use build_int_cst.
	* c-common.c (start_fname_decls, fix_string_type,
	c_common_nodes_and_builtins, c_init_attributes,
	shorten_compare): Likewise.
	* c-decl.c (complete_array_type,
	check_bitfield_type_and_width): Likewise.
	* c-lex.c (interpret_integer, lex_charconst): Likewise.
	* c-parse.in (primary): <TYPES_COMPATIBLE_P> Likewise.
	* c-pretty-print.c (pp_c_integer_constant): Likewise.
	* c-typeck.c (really_start_incremental_init, push_init_level,
	set_nonincremental_init_from_string): Likewise.
	* calls.c (load_register_parameters): Likewise.
	* convert.c (convert_to_pointer): Likewise.
	* coverage.c (coverage_counter_alloc, tree_coverage_counter_ref,
	build_fn_info_type, build_ctr_info_value, build_gcov_info):
	Likewise.
	* except.c (init_eh, assign_filter_values, assign_filter_values):
	Likewise.
	* expmed.c (store_fixed_bit_field, extract_bit_field,
	extract_fixed_bit_field, extract_split_bit_field, expand_shift,
	expand_mult_const, expand_mult_highpart_adjust, extract_high_half,
	expand_sdiv_pow2, expand_divmod, make_tree): Likewise.
	* expr.c (convert_move, emit_group_load, emit_group_store,
	expand_assignment, store_constructor, store_field,
	expand_expr_real_1, reduce_to_bit_field_precision): Likewise.
	* fold-const.c (force_fit_type, int_const_binop, fold_convert_const,
	invert_truthvalue, optimize_bit_field_compare,
	decode_field_reference, all_ones_mask_p, constant_boolean_node,
	fold_div_compare, fold, fold_read_from_constant_string,
	fold_negate_const, fold_abs_const, fold_not_const): Likewise.
	* function.c (assign_parm_setup_block): Likewise.
	* stmt.c (shift_return_value, expand_end_case_type,
	estimate_case_costs): Likewise.
	* stor-layout.c (layout_type, initialize_sizetypes,
	set_min_and_max_values_for_integral_type): Likewise.
	* tree-chrec.c (chrec_fold_multiply_poly_poly,
	reset_evolution_in_loop): Likewise.
	* tree-chrec.h (build_polynomial_chrec): Likewise.
	* tree-complex.c (build_replicated_const): Likewise.
	* tree-eh.c (honor_protect_cleanup_actions,
	lower_try_finally_onedest, lower_try_finally_copy,
	lower_try_finally_switch): Likewise.
	* tree-mudflap.c (mf_build_string, mx_register_decls,
	mudflap_register_call, mudflap_enqueue_constant): Likewise.
	* tree-nested.c (get_trampoline_type, get_nl_goto_field): Likewise.
	* tree-pretty-print.c (dump_generic_node): Likewise.
	* tree-ssa-ccp.c (widen_bitfield, maybe_fold_offset_to_array_ref):
	Likewise.
	* tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Likewise.
	* tree-ssa-loop-niter.c (number_of_iterations_cond,
	loop_niter_by_eval, upper_bound_in_type, lower_bound_in_type):
	Likewise.

	* config/alpha/alpha.c (alpha_initialize_trampoline,
	alpha_va_start, alpha_gimplify_va_arg_1): Use build_int_cst.
	* config/arm/arm.c (arm_get_cookie_size): Likewise.
	* config/c4x/c4x.c (c4x_gimplify_va_arg_expr): Likewise.
	* config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise.
	* config/i860/i860.c (i860_va_start): Likewise.
	* config/ia64/ia64.c (ia64_gimplify_va_arg): Likewise.
	* config/mips/mips.c (mips_build_builtin_va_list, mips_va_start,
	mips_gimplify_va_arg_expr): Likewise.
	* config/pa/pa.c (hppa_gimplify_va_arg_expr): Likewise.
	* config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg,
	add_compiler_branch_island): Likewise.
	* config/s390/s390.c (s390_va_start): Likewise.
	* config/sh/sh.c (sh_va_start): Likewise.
	* config/stormy16/stormy16.c (xstormy16_expand_builtin_va_start):
	Likewise.
	* config/xtensa/xtensa.c (xtensa_va_start,
	xtensa_gimplify_va_arg_expr): Likewise.

	* objc/objc-act.c (build_objc_string_object,
	build_objc_symtab_template, init_def_list, init_objc_symtab,
	init_module_descriptor, generate_static_references,
	build_selector_translation_table, get_proto_encoding,
	build_typed_selector_reference, build_selector_reference,
	build_next_objc_exception_stuff,
	build_method_prototype_list_template, generate_descriptor_table,
	generate_protocols, build_protocol_initializer,
	build_ivar_list_template, build_method_list_template,
	build_ivar_list_initializer, generate_ivars_list,
	generate_dispatch_table, generate_protocol_list,
	build_category_initializer, build_shared_structure_initializer,
	generate_shared_structures, handle_impent,
	generate_objc_image_info): Use build_int_cst.
ada:
	* cuintp.c (UI_To_gnu): Use build_int_cst..
	* trans.c (Exception_Handler_to_gnu_sjlj, gnat_to_gnu): Likewise.
	* utils.c (init_gigi_decls): Likewise.
	* utils2.c (build_call_raise): Likewise.
cp:
	* call.c (convert_class_to_reference,
	build_user_type_conversion_1, convert_like_real,
	build_java_interface_fn_ref, build_special_member_call): Use
	build_int_cst.
	* class.c (build_vtbl_initializer): Likewise.
	* cp-gimplify.c (cp_gimplify_expr): Likewise.
	* cvt.c (cp_convert_to_pointer): Likewise.
	* decl.c (cxx_init_decl_processing, complete_array_type): Likewise.
	* decl2.c (start_static_initialization_or_destruction,
	generate_ctor_or_dtor_function): Likewise.
	* except.c (build_throw): Likewise.
	* lex.c (cxx_init): Likewise.
	* mangle.c (write_integer_cst): Likewise.
	* rtti.c (build_headof, get_tinfo_decl_dynamic,
	build_dynamic_cast_1, ptr_initializer, ptm_initializer,
	get_pseudo_ti_init): Likewise.
	* search.c (get_dynamic_cast_base_type): Likewise.
	* tree.c (build_shared_int_cst): Likewise.
fortran:
	* trans-array.c (gfc_trans_array_constructor_value): Use
	build_int_cst.
	* trans-const.c (gfc_build_string_const,
	gfc_init_constants, gfc_conv_mpz_to_tree,
	gfc_conv_constant_to_tree): Likewise.
	* trans-decl.c (gfc_get_symbol_decl): Likewise.
	* trans-intrinsic.c (gfc_conv_intrinsic_ibits,
	gfc_conv_intrinsic_len, prepare_arg_info): Likewise.
	* trans-io.c (add_case, set_error_locus, build_dt,
	transfer_expr): Likewise.
	* trans-stmt.c (gfc_trans_label_assign, gfc_trans_pause,
	gfc_trans_stop, gfc_trans_character_select): Likewise.
	* trans-types.c (gfc_init_types, gfc_get_dtype): Likewise.
	* trans.c (gfc_trans_runtime_check): Likewise.
java:
	* boehm.c (get_boehm_type_descriptor): Use build_int_cst.
	* class.c (build_utf8_ref, build_static_field_ref,
	make_field_value, make_method_value, get_dispatch_table,
	make_class_data, emit_symbol_table, emit_catch_table): Likewise.
	* constants.c (get_tag_node,  build_ref_from_constant_pool,
	build_constants_constructor): Likewise.
	* decl.c (java_init_decl_processing): Likewise.
	* expr.c (build_java_array_length_access, build_newarray,
	expand_java_multianewarray, expand_java_pushc, expand_iinc,
	build_java_binop, build_field_ref, expand_java_add_case,
	expand_java_call, build_known_method_ref, build_invokevirtual,
	build_invokeinterface, build_jni_stub): Likewise.
	* java-gimplify.c (java_gimplify_new_array_init): Likewise.
	* jcf-parse.c (get_constant): Likewise.
	* lex.c (do_java_lex): Likewise.
	* parse.y (patch_binop, patch_unaryop, patch_cast,
	build_null_of_type, patch_newarray): Likewise.
	* resource.c (compile_resource_data): Likewise.
	* typeck.c (build_prim_array_type): Likewise.

From-SVN: r86022
2004-08-15 15:45:33 +00:00
Mark Mitchell b2ca370228 tree.c (handle_dll_attribute): Move here from i383/winnt.c.
* tree.c (handle_dll_attribute): Move here from i383/winnt.c.
	Replace use of DECL_INLINE with DECL_DECLARED_INLINE_P.  Set
	DECL_VISIBLITY.  Test TARGET_DLLIMPORT_DECL_ATTRIBUTES with #if.
	* tree.h (handle_dll_attribute): Declare.  Test
	TARGET_DLLIMPORT_DECL_ATTRIBUTES with #if.
	* c-common.h (c_determine_visibility): Declare.
	* c-common.c (c_determine_visibility): New function.
	* c-decl.c (finish_decl): Use it.
	(finish_function): Likewise.
	* defaults.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define it to
	zero, by default.  Use #if, not	#ifdef, to test it.
	* config/arm/arm.c (arm_attribute_table): Use
	handle_dll_attribute.  Test TARGET_DLLIMPORT_DECL_ATTRIBUTES with
	#if.
	* config/arm/pe.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define to 1.
	* config/i386/cygming.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define
	to 1.
	* config/i386/i386-protos.h (ix86_handle_dll_attribute): Remove.
	* config/i386/i386.c (ix86_attribute_table): Use
	handle_dll_attribute for dllimport/dllexport.  Test
	TARGET_DLLIMPORT_DECL_ATTRIBUTES with #if.
	* config/i386/winnt.c (ix86_handle_dll_attribute): Remove.
	* config/mcore/mcore.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define
	it to 1.
	* config/mcore/mcore.c (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Test it
	with #if.
	* config/sh/symbian-pre.h (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Define
	it to 1.
	* doc/extend.texi (dllexport): Clarify and correct documentation.
	(dllimport): Likewise.
	* doc/tm.texi (TARGET_DLLIMPORT_DECL_ATTRIBUTES): Mention
	handle_dll_attribute.

	* decl.c (start_preparsed_function): Move determine_visibility
	call.
	* decl2.c (determine_visibility): Incorporate dllexport testing.

	* g++.dg/ext/visibility/assign1.C: Use scan-hidden and
	dg-require-visiblity.
	* g++.dg/ext/visibility/fvisibility-inlines-hidden.C: Likewise.
	* g++.dg/ext/visibility/fvisibility.C: Likewise.
	* g++.dg/ext/visibility/memfuncts.C: Likewise.
	* g++.dg/ext/visibility/new1.C: Likewise.
	* g++.dg/ext/visibility/pragma.C: Likewise.
	* g++.dg/ext/visibility/staticmemfuncts.C: Likewise.
	* g++.dg/ext/visibility/virtual.C: Likewise.
	* g++/dg/ext/visibility/visibility-1.C: Likewise.
	* g++/dg/ext/visibility/visibility-2.C: Likewise.
	* g++/dg/ext/visibility/visibility-3.C: Likewise.
	* g++/dg/ext/visibility/visibility-4.C: Likewise.
	* g++/dg/ext/visibility/visibility-5.C: Likewise.
	* g++/dg/ext/visibility/visibility-6.C: Likewise.
	* g++/dg/ext/visibility/visibility-7.C: Likewise.
	* g++/dg/ext/visibility/visibility-8.C: New test.
	* gcc.c-torture/compile/dll.x: Remove.
	* gcc.dg/dll-2.c: Use dg-require-dll
	* gcc.dg/visibility-10.c: New test.
	* lib/gcc-dg.exp (dg-require-dll): Add Symbian to list of targets
	supporting DLLs.
	* testsuite/lib/scanasm.exp (scan_hidden): New function.
	(scan_not_hidden): Likewise.

From-SVN: r85621
2004-08-06 02:03:29 +00:00
Geoffrey Keating 0e6df31e19 re PR c/14516 (-fleading-underscore does not work correctly for file static variables)
2004-08-04  Geoffrey Keating  <geoffk@apple.com>

	PR 14516
	* c-common.c (c_expand_decl): Don't special-case static VAR_DECLs.
	* c-common.h (make_rtl_for_local_static): Delete.
	* c-decl.c (shadow_tag_warned): Clean up comment.
	(finish_decl): Clean up spacing.  Use set_user_assembler_name when
	appropriate.  Don't pass asmspec to rest_of_decl_compilation.
	* c-semantics.c (make_rtl_for_local_static): Delete.
	* expr.c (init_block_move_fn): Use set_user_assembler_name.
	(init_block_clear_fn): Likewise.
	* passes.c (rest_of_decl_compilation): Remove asmspec parameter,
	expect it to be in DECL_ASSEMBLER_NAME.  Update callers in many files.
	* toplev.h (rest_of_decl_compilation): Remove asmspec parameter.
	* tree.h (make_decl_rtl): Remove second parameter.
	(set_user_assembler_name): New.
	* varasm.c (set_user_assembler_name): New.
	(make_decl_rtl): Remove second parameter.  Update callers in many
	files.

Index: cp/ChangeLog
2004-08-04  Geoffrey Keating  <geoffk@apple.com>

	* decl.c (make_rtl_for_nonlocal_decl): Set DECL_ASSEMBLER_NAME rather
	than passing it as a parameter to rest_of_decl_compilation.
	* decl2.c (grokfield): Use set_user_assembler_name.

From-SVN: r85593
2004-08-05 05:52:01 +00:00
Mark Mitchell 73a8adb62e class.c (build_vtable): Do not set DECL_VISIBILITY here.
* class.c (build_vtable): Do not set DECL_VISIBILITY here.
	(check_field_decls): Or here.
	(check_methods): Or here.
	(initialize_array): Don't mess with DECL_CONTEXT.
	* cp-tree.h (start_decl): Adjust prototype.
	(determine_visibility): New function.
	* decl.c (duplicate_decls): Remove checks for hidden "operator
	new".
	(build_library_fn_1): Give all library functions default
	visibility.
	(start_decl): Add pop_scope_p parameter.  Tidy.
	(cp_finish_decl): Do not pop scopes here.  Call
	determine_visibility for variable definitions.
	(start_preparsed_function): Call determine_visibility.
	* decl2.c (determine_visibility): New function.
	* method.c (use_thunk): Fix formatting.
	* parser.c (cp_parser_condition): Adjust calls to start_decl.
	(cp_parser_init_declarator): Likewise.
	* pt.c (instantiate_decl): Always call pop_nested_class.
	* rtti.c (get_tinfo_decl): Do not set DECL_VISIBILITY.
	(tinfo_base_init): Likewise.

	* g++.dg/ext/visibility/assign1.C: New test.
	* g++.dg/ext/visibility/new1.C: Likewise.

From-SVN: r85543
2004-08-04 05:27:52 +00:00
Mark Mitchell 4684cd27fc c-common.h (lang_post_pch_load): New variable.
* c-common.h (lang_post_pch_load): New variable.
	* c-pch.c (lang_post_pch_load): Define it.
	(c_common_read_pch): Use it.
	* cgraphunit.c (record_call_1): Give the front end a chance to
	record additional needed entities when a variable is marked as
	needed.
	* tlink.c (recompile_files): Robustify.
	(scan_linker_output): If a symbol is assigned to a file,
	but after recompilation is not present there, issue an error
	message.

	* cp-tree.h (IDENTIFIER_REPO_CHOSEN): Define.
	(lang_decl_flags): Narrow the width of "languages".  Add
	repo_available_p.
	(DECL_NEEDED_P): Remove.
	(FOR_EACH_CLONE): New macro.
	(DECL_REPO_AVAILABLE_P): Likewise.
	(DECL_TINFO_P): Likewise.
	(set_linkage_according_to_type): Declare.
	(import_export_vtable): Remove.
	(import_export_tinfo): Likewise.
	(mark_needed): New function.
	(decl_needed_p): Likewise.
	(note_vauge_linkage_fn): Likewise.
	(init_repo): Change prototype.
	(repo_template_used): Remove.
	(repo_template_instantiated): Likewise.
	(repo_emit_p): New function.
	(repo_export_class_p): Likewise.
	(no_linkage_check): Change prototype.
	* class.c (set_linkage_according_to_type): New function.
	(build_vtable): Use it.  Do not call import_export_vtable.  Set
	DECL_IGNORED_P if appropriate.
	* decl.c (duplicate_decls): Preserve DECL_REPO_AVAILABLE_P.
	(make_rtL_for_nonlocal_decls): Check for template instantiations
	explicitly.
	(grokfndecl): Adjust call to no_linkage_check.
	(set_linkage_for_static_data_member): New function.
	(grokvardecl): Use it.  Adjust call to no_linkage_check.
	(grokdeclarator): Use set_linkage_for_static_data_member.
	* decl2.c (note_vague_linkage_fn): New function.
	(note_vague_linkage_var): Likewise.
	(finish_static_data_member_decl): Use it.
	(import_export_vtable): Remove.
	(import_export_class): Use repo_export_class_p.
	(var_finalized_p): Simplify.
	(maybe_emit_vtables): Simplify.
	(mark_needed): New function.
	(decl_needed_p): Likewise.
	(import_export_decl): Add documentation and consistency checks.
	Use repo_emit_p.  Handle virtual tables and RTTI information
	here.
	(import_export_tinfo): Remove.
	(write_out_vars): Call import_export_decl.
	(cxx_callgraph_analyze_expr): Ensure that all vtables are emitted
	whenever one is.
	(finish_file): Use decl_needed_p.  Do not call import_export_decl
	for undefined static data members.  Do not warn about undefined
	inlines when using a repository.
	(mark_used): Use note_vague_linkage_fn.  Always defer template
	instantiations.
	* lex.c (cxx_init): Adjust call to init_repo.  Always set
	flag_unit_at_a-time.
	* method.c (synthesize_method): Remove unncessary
	import_export_decl call.
	(implicitly_declare_fn): Use set_linkage_according_to_type.
	* optimize.c (maybe_clone_body): Use FOR_EACH_CLONE.
	* pt.c (instantiate_class_template): Don't redundantly add classes
	to keyed_classes.  Don't call repo_template_used.
	(tsubst_decl): Set DECL_INTERFACE_KNOWN for instantiations of
	templates with internal linkage.
	(check_instantiated_args): Adjust call to no_linkage_check.
	(instantiate_template): Use FOR_EACH_CLONE.
	(mark_definable): New function.
	(mark_decl_instantiated): Use it.
	(do_decl_instantiation): Adjust tests for explicit instantiation
	after "extern template".
	(instantiate_class_member): Do not use repo_template_instantiated.
	(do_type_instantiation): Simplify.
	(instantiate_decl): Use mark_definable.  Check repo_emit_p.
	Simplify.
	* repo.c (repo_get_id): Remove.
	(original_repo): Remove.
	(IDENTIFIER_REPO_USED): Remove.
	(IDENTIFIER_REPO_CHOSEN): Remove.
	Remove all #if 0'd code.
	(repo_template_used): Remove.
	(repo_template_instantiated): Remove.
	(temporary_obstack_initialized_p): New variable.
	(init_repo): Register with lang_post_pch_load.  Avoid creating
	identifiers unnecessarily.  Don't use original_repo.  Close the
	file here.
	(reopen_repo_file_for_write): Not here.
	(finish_repo): Always write out a new repository file.
	(repo_emit_p): New function.
	(repo_export_class_p): Likewise.
	* rtti.c (get_tinfo_decl): Use set_linkage_according_to_type.
	(involves_incomplete_p): New function.
	(tinfo_base_init): Use it.
	(ptr_initializer): Remove non_public_ptr parameter.
	(ptm_initializer): Likewise.
	(get_pseudo_ti_init): Likewise.
	(unemitted_tinfo_decl_p): Remove.
	(emit_tinfo_decl): Use import_export_decl.
	* semantics.c (expand_body): Move updates of static_ctors and
	static_dtors to ...
	(expand_or_defer_fn): ... here.
	* tree.c (no_linkage_check): Add relaxed_p parameter.

	* g++.dg/abi/inline1.C: New test.
	* g++.dg/abi/local1-a.cc: Likewise.
	* g++.dg/abi/local1.C: Likewise.
	* g++.dg/abi/mangle11.C: Tweak location of warnings.
	* g++.dg/abi/mangle12.C: Likewise.
	* g++.dg/abi/mangle17.C: Likewise.
	* g++.dg/abi/mangle20-2.C: Likewise.
	* g++.dg/opt/interface1.C: Likewise.
	* g++.dg/opt/interface1.h: Likewise.
	* g++.dg/opt/interface1-a.cc: New test.
	* g++.dg/parse/repo1.C: New test.
	* g++.dg/template/repo1.C: Likewise.
	* g++.dg/warn/Winline-1.C: Likewise.
	* lib/gcc-dg.exp (gcc-dg-test-1): Fix -frepo handling.

From-SVN: r85309
2004-07-29 17:59:31 +00:00
Steven Bosscher 31ec7d2ff7 c-common.c (c_common_truthvalue_conversion): Don't warn if TREE_NO_WARNING is set.
* c-common.c (c_common_truthvalue_conversion): Don't warn if
	TREE_NO_WARNING is set.

cp/
	* cp-tree.h (C_SET_EXP_ORIGINAL_CODE): Remove.
	* decl2.c (grokfield): Don't check current_class_depth via
	unused TREE_COMPLEXITY.
	* semantics.c (finish_parenthesized_expr): Set TREE_NO_WARNING
	to avoid the missing parentheses warning.
	Don't set C_SET_EXP_ORIGINAL_CODE.

Co-Authored-By: Joseph Myers <jsm@polyomino.org.uk>

From-SVN: r84903
2004-07-18 23:57:31 +00:00
Mark Mitchell 508a1c9c6d class.c (finish_struct_methods): Remove unncessary code.
* class.c (finish_struct_methods): Remove unncessary code.
	(add_implicitly_declared_members): Create declarations for default
	constructors and copy constructors lazily.
	* cp-tree.h (lang_type_class): Remove lazy_default_ctor and
	lazy_copy_ctor.
	(CLASSTYPE_LAZY_DEFAULT_CTOR): New macro.
	(CLASSTYPE_LAZY_COPY_CTOR): Likewise.
	* decl2.c (check_classfn): Robustify.
	(locate_dtor): Handle empty CLASSTYPE_METHOD_VEC.
	(locate_ctor): Handle lazy default constructors.
	(locate_copy): Handle lazy copy constructors.
	(implicitly_declare_fn): Make sure we're looking at the
	TYPE_MAIN_VARIANT for a class before creating functions.  Don't
	set TYPE_HAS_CONSTRUCTOR.
	(lazily_declare_fn): New function.
	* name-lookup.c (constructor_name_full): Simplify.
	* search.c (lookup_fnfields_1): Lazily create methods, as
	necessary.
	(lookup_for_overrides): Handle empty CLASSTYPE_METHOD_VEC.

From-SVN: r84851
2004-07-17 07:31:08 +00:00
Mark Mitchell aaaa46d2b0 vec.h (VEC_address): New function.
* vec.h (VEC_address): New function.

	* cp-tree.h (lang_type_class): Remove has_real_assign_ref and
	has_abstract_assign_ref.  Make methods a VEC(tree) *.
	(TYPE_HAS_CONST_ASSIGN_REF): Add documentation.
	(CLASSTYPE_CONSTRUCTORS): Adjust for changes to CLASSTYPE_METHOD_VEC.
	(CLASSTYPE_DESTRUCTORS): Likewise.
	(TYPE_HAS_REAL_ASSIGN_REF): Remove.
	(TYPE_HAS_ABSTRACT_ASSIGN_REF): Likewise.
	(add_method): Change prototoype.
	* class.c (add_method): Remove error_p parameter.  Adjust for
	changes to CLASSTYPE_METHOD_VEC.
	(handle_using_decl): Adjust call to add_method.
	(maybe_warn_about_overly_private_class): Adjust for
	changes to CLASSTYPE_METHOD_VEC.
	(resort_type_method_vec): Likewise.
	(finish_struct_methods): Likewise.
	(check_for_override): Likewise.
	(warn_hidden): Likewise.
	(add_implicitly_declared_members): Defer creation of assignment
	operators.  Adjust call to add_method.
	(clone_function_decl): Adjust call to add_method.
	(check_bases_and_members): Don't set TYPE_HAS_REAL_ASSIGN_REF.
	(finish_struct_1): Use CLASSTYPE_DESTRUCTORS.
	* decl.c (grok_special_member_properties): Don't set
	TYPE_HAS_ABSTRACT_ASSIGN_REF.
	* decl2.c (check_classfn): Adjust for
	changes to CLASSTYPE_METHOD_VEC.
	* method.c (locate_dtor): Use CLASSTYPE_DESTRUCTORS.
	(locate_ctor): Use CLASSTYPE_CONSTRUCTORS.
	(locate_copy): Adjust for changes to CLASSTYPE_METHOD_VEC.
	(implicitly_declare_fn): Set DECL_SOURCE_LOCATION.  Do not call
	cp_finish_decl.
	* pt.c (check_explicit_specialization): Adjust for
	changes to CLASSTYPE_METHOD_VEC.
	(instantiate_class_template): Do not set
	TYPE_HAS_ABSTRACT_ASSIGN_REF.
	* ptree.c (cxx_print_type): Don't try to print
	CLASSTYPE_METHOD_VEC.
	* rtti.c (emit_support_tinfos): Use CLASSTYPE_DESTRUCTORS.
	* search.c (lookup_field_r): Adjust for
	changes to CLASSTYPE_METHOD_VEC.
	(lookup_fnfields): Likewise.
	(lookup_conversion_operator): Likewise.
	(lookup_fnfields_1): Likewise.  Create assignment operators
	lazily.
	(look_for_overrides_here): Adjust for
	changes to CLASSTYPE_METHOD_VEC.
	(add_conversions): Likewise.
	* semantics.c (finish_member_declaration): Adjust call to add_method.

From-SVN: r84796
2004-07-16 01:15:43 +00:00
Mike Stump 30bf22a0ee decl2.c (import_export_class): Never export/import vtables with inline key functions.
* decl2.c (import_export_class): Never export/import vtables
        with inline key functions.

From-SVN: r84493
2004-07-11 05:13:12 +00:00
Nick Clifton d59c7b4bdc target.h (struct gcc_target): Add new field to struct cxx: import_export_class.
* target.h (struct gcc_target): Add new field to struct cxx: import_export_class.
* target-def.h (TARGET_CXX): Initialise the new field.
  (TARGET_CXX_IMPORT_EXPORT_CLASS): Provide a default value for the new field.
* doc/tm.texi: Document the new target hook.
* decl2.c (import_export_class): Invoke the import_export_class field in the
  gcc_target structure if it is not empty.

From-SVN: r83964
2004-07-01 08:47:16 +00:00
Per Bothner 93409b8c45 Conditionally compile support for --enable-mapped_location.
* decl.c (pop_label):  Handle (imperfectly) USE_MAPPED_LOCATION case.
	* decl2.c:  If USE_MAPPED_LOCATION, don't do some line number
	adjustments - which I don't understand.
	* error.c (dump_decl):  Rename "<interrnal>" to "<built-in>".
	* error.c:  Use LOCATION_FILE and EXPR_LOCATION macros.
	(print_instantiation_partial_context):  Use expand_location.
	* decl.c (duplicate_decl):  Use new DECL_IS_BUILTIN macro.
	* name-lookup.c:  Likewise.
	* lex.c (cxx_init):  Likewise.  Also use BUILTINS_LOCATION.
	* name-lookup.c:  Use input_line macro.
	* parser.c (cp_lexer_get_preprocessor_token):  Use UNKNOWN_LOCATION.
	(cp_parser_statement):  Rename locaal variable statement_locus to
	statement_location and use SET_EXPR_LOCATION macro.
	* pt.c:  Handle USE_MAPPED_LOCATION case.  Use new macros.
	* tree.c (cp_walk_subtrees):  Likewise.

From-SVN: r83923
2004-06-30 11:23:35 -07:00
Mark Mitchell 3c01e5dffb cp-tree.h (cp_cv_quals): New type.
* cp-tree.h (cp_cv_quals): New type.
	(cp_declarator): Use it instead of "tree" as appropriate.
	(grok_method_quals): Adjust prototype.
	(grokclassfn): Likewise.
	(do_friend): Likewise.
	* decl.c (grokfndecl): Use cp_cv_quals, not tree.
	(grokdeclarator): Likewise.
	* decl2.c (grok_method_quals): Likewise.
	(grokclassfn): Likewise.
	* friend.c (do_friend): Likewise.
	* method.c (implicitly_declare_fn): Adjust call to grokclassfn.
	* parser.c (make_call_declarator): Use cp_cv_quals, not tree.
	(make_pointer_declarator): Likewise.
	(make_reference_declarator): Likewise.
	(make_ptrmem_declarator): Likewise.
	(cp_parser_ptr_operator): Likewise.
	(cp_parser_cv_qualifier_seq_opt): Likewise.
	(cp_parser_cv_qualifier_opt): Remove.
	(cp_parser_new_declarator_opt): Adjust call to
	cp_parser_ptr_operator.
	(cp_parser_conversion_declaration_opt): Likewise.
	(cp_parser_declarator): Use cp_cv_quals, not tree.
	(cp_parser_direct_declarator): Likewise.

From-SVN: r83729
2004-06-27 03:03:55 +00:00
Richard Kenner 350fae6628 c-common.c (c_safe_from_p, [...]): Deleted.
2004-06-26  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

        * c-common.c (c_safe_from_p, c_walk_subtrees): Deleted.
        * c-common.def (DECL_STMT): Remove.
        * c-common.h (DECL_STMT_DECL): Deleted.
        (COMPOUNT_LITERAL_EXPR_DECL): Use DECL_EXPR_DECL.
        (c_safe_from_p, c_walk_subtrees): Deleted.
        * c-decl.c, c-parse.in, c-pretty-print.c: DECL_STMT now DECL_EXPR.
        * c-dump.c (c_dump_tree, case DECL_STMT): Deleted.
        * c-gimplify.c (gimplify_decl_stmt): Deleted.
        (gimplify_compound_literal_expr): Use DECL_EXPR_DECL
        and gimplify_and_add.
        (c_gimplify_expr, case DECL_EXPR): New case.
        (c_gimplify_expr, case DECL_STMT): Deleted.
        * c-lang.c (LANG_HOOKS_SAFE_FROM_P): Likewise.
        (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES): Likewise.
        * expr.c (safe_from_p, case 's'): New case.
        * gimplify.c (gimplify_decl_expr): New function.
        (gimplify_expr, case DECL_EXPR): New case.
        * tree-inline.c (walk_tree): Walk into all fields of a type and
        decl only if they are in a DECL_EXPR.
        (mark_local_for_remap_r): Minor code cleanup.
        * tree-outof-ssa.c (discover_nonconstant_array_refs_r): Add else.
        * tree.c (has_cleanups, case DECL_EXPR): New case.
        * tree.def (DECL_EXPR): New code.
        * tree.h (DECL_EXPR_DECL): New macro.

        * objc/objc-lang.c (LANG_HOOKS_SAFE_FROM_P): Deleted.

From-SVN: r83721
2004-06-26 17:11:23 -04:00
Jan Hubicka e9e4d4ee5b re PR c++/14865 (No instantiation of VTT at -O1)
PR C++/14865
	* decl2.c (maybe_emit_vtables):  Always import_export_vtable for the
	reachability analysis.

From-SVN: r83707
2004-06-26 10:23:05 +00:00
Paul Brook 4185ae5397 target-def.h (TARGET_CXX_GUARD_TYPE, [...]): Define.
gcc/
	* target-def.h (TARGET_CXX_GUARD_TYPE, TARGET_CXX_GUARD_MASK_BIT,
	TARGET_CXX): Define.
	(TARGET_INITIALIZER): Use TARGET_CXX.
	* target.h (struct gcc_target): Add struct cxx.
	* targhooks.h (default_cxx_guard_type): Add prototype.
	* targhooks.c (default_cxx_guard_type): New function.
	* config/arm/arm.c (TARGET_CXX_GUARD_TYPE, TARGET_CXX_GUARD_MASK_BIT):
	Define.
	(arm_cxx_guard_type, arm_cxx_guard_mask_bit): New functions.
	* doc/tm.texi: Document TARGET_CXX_GUARD_TYPE and
	TARGET_CXX_GUARD_MASK_BIT.
gcc/cp/
	* decl2.c (get_guard): Call targetm.cxx.guard_type.
	(get_guard_bits, get_guard_cond): Call targetm.cxx.guard_mask_bit.
libstdc++/
	* libsupc++/cxxabi.h: Define __ARM_EABI__
	(__guard): Use it.
	* libsupc++/guard.h (__cxa_guard_acquire, __cxa_guard_release): Ditto.

From-SVN: r83660
2004-06-25 17:15:46 +00:00
Mark Mitchell 62d1db179e Make-lang.in (cp/lex.o): Do not depend on cp/lex.h.
* Make-lang.in (cp/lex.o): Do not depend on cp/lex.h.
	(cp/decl.o): Likewise.
	(cp/decl2.o): Likewise.
	(cp/pt.o): Likewise.
	(cp/semantics.o): Likewise.
	* config-lang.in (gtfiles): Do not reference cp/lex.h.
	* class.c: Do not include lex.h.
	(add_implicitly_declared_members): Do not use
	adding_implicit_members.
	(check_bases_and_members): Do not talk about grok_x_components.
	* cp/cp-tree.h (adding_implicit_members): Remove.
	(cp_storage_class): New type.
	(cp_decl_spec): Likewise.
	(cp_decl_specifier_seq): Likewise.
	(cp_parameter_declarator): Use it for the decl_specifiers field.
	(check_tag_decl): Adjust prototype.
	(shadow_tag): Likewise.
	(groktypename): Likewise.
	(start_decl): Likewise.
	(start_function): Likewise.
	(start_method): Likewise.
	(grok_x_components): Remove.
	(grokfield): Adjust prototype.
	(grokbitfield): Likewise.
	(finish_member_class_template): Remove.
	* decl.c: Do not include lex.h.
	(adding_implicit_members): Do not define.
	(check_tag_decl): Do not use trees to represent decl-specifiers.
	(shadow_tag): Likewise.
	(groktypename): Likewise.
	(start_decl): Likewise.
	(grokvardecl): Likewise.
	(grokdeclarator): Likewise.
	(grokparms): Likewise.
	(start_function): Likewise.
	(start_method): Likewise.
	* decl.h (grokdeclarator): Adjust prototype.
	* decl2.c: Do not include lex.h.
	(grok_x_components): Remove.
	(grokfield): Do not use trees to represent decl-specifiers.
	(grokbitfield): Likewise.
	* lex.c: Do not include lex.h.
	* lex.h: Remove.
	* parser.c: Include target.h.
	(clear_decl_specs): New function.
	(cp_parser_translation_unit): Do not use trees to represent
	decl-specifiers.
	(cp_parser_postfix_expression): Likewise.
	(cp_parser_new_type_id): Likewise.
	(cp_parser_condition): Likewise.
	(cp_parser_simple_declaration): Likewise.
	(cp_parser_decl_specifier_seq): Likewise.
	(cp_parser_function_specifier_opt): Likewise.
	(cp_parser_conversion_type_id): Likewise.
	(cp_parser_template_parameter): Likewise.
	(cp_parser_explicit_instantiation): Likewise.
	(cp_parser_type_specifier): Likewise.
	(cp_parser_simple_type_specifier): Likewise.
	(cp_parser_init_declarator): Likewise.
	(cp_parser_type_id): Likewise.
	(cp_parser_type_specifier_seq): Likewise.
	(cp_parser_parameter_declaration): Likewise.
	(cp_parser_member_declaration): Likewise.
	(cp_parser_exception_declaration): Likewise.
	(cp_parser_function_definition_from_specifiers_and_declarator):
	Likewise.
	(cp_parser_single_declaration): Likewise.
	(cp_parser_save_member_function_body): Likewise.
	(cp_parser_friend_p): Likewise.
	(cp_parser_set_storage_class): New function.
	(cp_parser_set_decl_spec_type): Likewise.
	* pt.c: Do not include lex.h.
	* semantics.c: Likewise.
	(finish_member_class_template): Remove.

From-SVN: r83584
2004-06-24 06:48:44 +00:00
Mark Mitchell 058b15c1dc cp-tree.def (NEW_EXPR): Add a fourth slot.
* cp-tree.def (NEW_EXPR): Add a fourth slot.
	* cp-tree.h (PARMLIST_ELLIPSIS_P): Remove.
	(TREE_PARMLIST): Likewise.
	(CALL_DECLARATOR_PARMS): Likewise.
	(CALL_DECLARATOR_QUALS): Likewise.
	(CALL_DECLARATOR_EXCEPTION_SPEC): Likewise.
	(cp_declarator_kind): New type.
	(cp_parameter_declarator): Likewise.
	(cp_declarator): Likewise.
	(cp_error_declarator): Likewise.
	(no_parameters): Likewise.
	(groktypename): Change prototype.
	(start_decl): Likewise.
	(start_handler_parms): Likewise.
	(get_scope_of_declarator): Likewise.
	(start_function): Likewise.
	(start_preparsed_function): New function.
	(start_function): Change prototype.
	(start_method): Likewise.
	(grokfield): Likewise.
	(grokbitfield): Likewise.
	(build_new): Likewise.
	(make_pointer_declarator): Remove.
	(make_reference_declarator): Likewise.
	(make_call_declarator): Likewise.
	(set_quals_and_spec): Likewise.
	(process_template_parm): Change prototype.
	(begin_function_definition): Remove.
	(finish_parmlist): Remove.
	* decl.c (groktypename): Do not use trees to represent
	declarators.
	(start_decl): Likewise.
	(start_handler_parms): Remove.
	(get_scope_of_declarator): Reimplement.
	(grokdeclarator): Do not use trees to represent	declarators.
	(grokparms): Likewise.
	(start_function): Likewise.
	(start_method): Likewise.
	(build_void_list_mode): Do not use TREE_PARMLIST.
	* decl.h (grokdeclarator): Change prototype.
	* decl2.c (grok_method_quals): Robustify.
	(grok_x_components): Do not use trees to represent declarators.
	(grokfield): Likewise.
	(grokbitfield): Likewise.
	(start_objects): Build FUNCTION_DECLs, not declarators.
	(start_static_storage_duration_function): Likewise.
	* init.c (build_new): Simplify.
	* lex.c (make_pointer_declarator): Remove.
	(make_reference_declarator): Likewise.
	(make_call_declarator): Likewise.
	(set_quals_and_spec): Likewise.
	* method.c (use_thunk): Use start_preparsed_function.
	(synthesize_method): Likewise.
	(implicitly_declare_fn): Build FUNCTION_DECLs, not declarators.
	* optimize.c (maybe_clone_body): Use start_preparsed_function.
	* parser.c (cp_error_declarator): New variable.
	(declarator_obstack): Likewise.
	(alloc_declarator): New function.
	(make_declarator): Likewise.
	(make_id_declarator): Likewise.
	(make_pointer_declarator): Likewise.
	(make_reference_declarator): Likewise.
	(make_ptrmem_declarator): Likewise.
	(make_call_declarator): Likewise.
	(make_array_declarator): Likewise.
	(no_parameters): New variable.
	(make_parameter_declarator): Likewise.
	(cp_parser_check_for_definition_in_return_type): Do not use trees
	to represent declarators.
	(cp_parser_translation_unit): Likewise.
	(cp_parser_new_expression): Likewise.
	(cp_parser_new_type_id): Likewise.
	(cp_parser_new_declarator_opt): Likewise.
	(cp_parser_direct_new_declarator): Likewise.
	(cp_parser_condition): Likewise.
	(cp_parser_declaration_statement): Likewise.
	(cp_parser_declaration): Likewise.
	(cp_parser_conversion_type_id): Likewise.
	(cp_parser_conversion_declarator_opt): Likewise.
	(cp_parser_template_parameter_list): Likewise.
	(cp_parser_template_parameter): Likewise.
	(cp_parser_explicit_instantiation): Likewise.
	(cp_parser_init_declarator): Likewise.
	(cp_parser_declarator): Likewise.
	(cp_parser_direct_declarator): Likewise.
	(cp_parser_type_id): Likewise.
	(cp_parser_parameter_declaration_clause): Likewise.
	(cp_parser_parameter_declaration_list): Likewise.
	(cp_parser_parameter_declaration): Likewise.
	(cp_parser_member_declaration): Likewise.
	(cp_parser_exception_declaration): Likewise.
	(cp_parser_check_declarator_template_parameters): Likewise.
	(cp_parser_function_definition_from_specifiers_and_declarator):
	Likewise.
	(cp_parser_save_member_function_body): Likewise.
	* pt.c (process_template_parm): Add is_non_type parameter.
	(convert_template_argument): Adjust call to groktypename.
	(tsubst_call_declarator_parms): Remove use of TREE_PARMLIST.
	(tsubst): Do not expect declarators.
	(tsubst_copy_and_build): Adjust NEW_EXPR case to handle additional
	argument.
	(instantiate_decl): Use start_preparsed_function.
	* semantics.c (begin_function_definition): Remove.
	(finish_parmlist): Remove.
	* cp-mudflap.c (mflang_flush_calls): Build FUNCTION_DECLs, not
	declarators.

From-SVN: r83482
2004-06-22 07:18:38 +00:00
Richard Kenner 44de5aeb00 alias.c (adjust_offset_for_component_ref): Use component_ref_field_offset.
* alias.c (adjust_offset_for_component_ref): Use
	component_ref_field_offset.
	* c-decl.c (build_array_declarator): Add news args for ARRAY_REF.
	* c-gimplify.c (gimplify_expr_stmt): Use alloc_stmt_list.
	(gimplify_decl_stmt): Call gimplify_type_sizes for type.
	For decl, call gimplify_one_sizepos and use statement list.
	(gimplify_compound_literal_expr): New arg PRE_P.
	Add statement to PRE_P list and return DECL.
	(c_gimplify_expr, case COMPOUND_LITERAL_EXPR): Add arg to
	gimplify_compound_literal_expr.
	* c-tree.h (getdecls): Deleted.
	* c-typeck.c (build_component_ref): Add operand for COMPONENT_REF.
	(build_array_ref): Add two operands for ARRAY_REF.
	(build_unary_op): Set TREE_INVARIANT and TREE_CONSTANT for
	COMPOUND_LITERAL_EXPR.
	* coverage.c (tree_coverage_counter_ref): Add new operands
	for ARRAY_REF.
	* emit-rtl.c (component_ref_for_mem_expr): Add new operand
	for COMPONENT_REF.
	(set_mem_attributes_minus_bitpos): Use array_ref_low_bound
	and array_ref_element_size.
	(widen_memory_access):Use component_ref_field_offset.
	* explow.c (update_nonlocal_goto_save_area): Add two operands
	for ARRAY_REF.
	* expr.c (array_ref_element_size, array_ref_low_bound): New functions.
	(component_ref_field_offset): Likewise.
	(get_inner_reference): Use them.
	(expand_expr_real_1, case ARRAY_REF): Use array_ref_low_bound.
	* fold-const.c (fold, case EQ_EXPR): Properly handle DECL_SIZE.
	(fold_read_from_constant_string): Use array_ref_low_bound.
	Verify that result is a character type.
	(build_fold_indirect_ref): Add two operands for ARRAY_REF.
	* function.c (expand_function_start): Likewise.
	* gimple-low.c (expand_var_p): Delete duplicated line.
	* gimplify.c: Add static decls for local functions.
	(cgraph.h): Now included.
	(create_tmp_var): Remove check for ARRAY_TYPE.
	(copy_if_shared_r): Look at bounds and sizes of types.
	(build_and_jump): Return alloc_stmt_list instead of build_empty_stmt.
	(gimplify_exit_expr, shortcut_cond_expr): Likewise.
	(gimplify_save_expr, gimple_push_cleanup): Likewise.
	(gimplify_init_constructor): Likewise.
	WANT_VALUE now bool.
	If empty list with no result wanted, return GS_UNHANDLED.
	Add additional operands for ARRAY_REF and COMPONENT_REF.
	(canonicalize_component_ref): Convert to &array[L].
	(gimplify_array_ref_to_plus): Use array_ref_element_size and
	array_ref_lower_bound.
	(build_addr_expr_with_type, build_addr_expr): New functions.
	(gimplify_compound_lval): WANT_LVALUE now bool.
	Major rework to allow handle_component_p and initialize and
	gimplify new operands for ARRAY_REF, ARRAY_RANGE_REF, and
	COMPONENT_REF.
	(gimplify_array_ref): Deleted.
	(gimplify_self_mod_expr): WANT_VALUE now bool.
	(gimplify_modify_expr): Gimplify to_p and from_p later.
	Factor out code into gimplify_modify_expr_rhs and call twice.
	Move variable-size code earlier and handle PLACEHOLDER_EXPR.
	(gimplify_modify_expr_rhs, gimplify_variable_sized_compare): New fns.
	(gimplify_addr_expr, case VIEW_CONVERT_EXPR): New case.
	(gimplify_expr, case ARRAY_REF): Delete special case.
	Instead handle like COMPONENT_REF; also do ARRAY_RANGE_REF,
	IMAGPART, and REALPART the same way.
	(gimplify_expr, case VIEW_CONVERT_EXPR): New case.
	(gimplify_expr): Call gimplify_variable_sized_compare if applicable.
	Call alloc_stmt_list instead of build_empty_stmt.
	Deal with _REF that's volatile.
	(gimplify_type_sizes, gimplify_one_sizepos): New functions.
	(unshare_body, unvisit_body): New functions.
	(gimplify_body): Call them.
	* stmt.c (expand_stack_alloc): Don't expand TYPE_MAX_VALUE.
	* stor-layout.c (get_pending_sizes): Don't change SAVE_EXPR_CONTEXT.
	* tree-alias-common.c (get_alias_var): Also skip ARRAY_RANGE_REF.
	* tree-cfg.c (tree_node_can_be_shared): Treat ARRAY_RANGE_REF
	like ARRAY_REF.
	(verify_expr, case ADDR_EXPR): Use handled_component_p.
	* tree-dfa.c (get_virtual_var): Likewise.
	* tree-dump.c (dequeue_and_dump, case COMPONENT_REF, ARRAY_REF):
	New cases to dump new operands; likewise for ARRAY_RANGE_REF.
	* tree-eh.c (tree_could_trap, case ARRAY_RANGE_REF): Like ARRAY_REF.
	* tree-gimple.c (is_gimple_addr_expr_arg): Add ARRAY_RANGE_REF
	and INDIRECT_REF.
	(get_base_address): Use handled_component_p.
	* tree-gimple.h (gimplify_type_sizes, gimplify_one_sizepos): New.
	* tree-line.c (walk_tree): Walk more things for types and decls.
	* tree-mudflap.c (mf_build_check_statement_for): Add new operands
	for ARRAY_REF and COMPONENT_REF.
	(mx_xform_derefs_1): Clean up usage of decl sizes.
	* tree-nested.c (build_addr): Use handled_component_p.
	(walk_stmts, case CATCH_EXPR): Add missing "break".
	(get_static_chain, get_frame_field): Add new operand for COMPONENT_REF.
	(finalize_nesting_tree_1): Likewise.
	(convert_nonlocal_reference, case ARRAY_RANGE_REF): Like ARRAY_REF
	and process additional operands.
	(convert_local_reference): Likewise.
	* tree-outof-ssa.c (discover_nonconstant_array_refs_r): Treat
	ARRAY_RANGE_REF similarly to ARRAY_REF.
	* tree-pretty-print.c (dump_generic_node, case QUAL_UNION_TYPE): Handle
	like RECORD_TYPE.
	(dump_generic_node, case COMPONENT_REF): Print offset operand.
	(dump_generic_node, case ARRAY_RANGE_REF): Treat like ARRAY_REF
	and print lower bound and element size for both.
	(op_prio, case ARRAY_RANGE_REF): Like ARRAY_REF.
	* tree-sra.c (csc_build_component_ref): Add new operand.
	(scalarize_call_expr): Use get_base_address.
	* tree-ssa-ccp.c (widen_bitfield): Clean up size handling.
	(maybe_fold_offset_to_array_ref): Rework to handle input having an
	ARRAY_REF, refine handling of lower bound, and add new operands
	for ARRAY_REF.
	(maybe_fold_to_component_ref): Add new operand for COMPONENT_REF.
	(maybe_fold_stmt_indirect): Only fold *&B to B if types match.
	(maybe_fold_stmt_addition): Only handle constant lower bound.
	* tree-ssa-operands.c (get_expr_operands): Minor rearrangements.
	Treat ARRAY_REF and ARRAY_RANGE_REF the same; look at extra operands.
	Look at new offset operand of COMPONENT_REF.
	* tree-ssa.c (set_is_used): Use handled_component_p.
	* tree.c (substitute_in_expr, case COMPONENT_REF): Add new operand.
	(stabilize_reference, case COMPONENT_REF): Likewise.
	(stabilize_reference, case ARRAY_RANGE_REF, ARRAY_REF): Similarly.
	(recompute_tree_invariant_for_addr_expr): Completely rework to
	be more precise.  Also set TREE_SIDE_EFFECTS.
	(build1_stat, case ARRAY_EXPR): Don't handle TREE_SIDE_EFFECTS here.
	(build2_stat, build3_stat, build4_stat): For references,
	propagate TREE_THIS_VOLATILE.
	(get_unwidened): Add new operand for COMPONENT_REF.
	(get_narrower): Likewise; use host_integerp for DECL_SIZE.
	* tree.def (COMPONENT_REF): Add new operand.
	(ARRAY_REF, ARRAY_RANGE_REF): Add two new operands.
	* tree.h (array_ref_element_size, array_ref_low_bound): New decls.
	(component_ref_field_offset): Likewise.
	* config/alpha/alpha.c (alpha_va_start): Add new op for COMPONENT_REF.
	(alpha_gimplify_va_arg): Likewise.
	* config/i386/i386.c (ix86_va_start, ix86_gimplify_va_arg): Likewise.
	* config/i860/i860.c (i860_va_start, i860_va_arg): Likewise.
	* config/iq2000/iq2000.c (iq2000_va_arg): Likewise.
	* config/mips/mips.c (mips_va_start, mips_va_arg): Likewise.
	* config/rs6000/rs6000.c (rs6000_va_start, rs6000_gimplify_va_arg):
	Likewise.
	* config/s390/s390.c (s390_va_start, s390_gimplify_va_arg): Likewise.
	* config/sh/sh.c (sh_va_start, sh_va_arg): Likewise.
	* config/stormy16/stormy16.c (xstormy1_expand_builin_va_start):
	Likewise.
	(xstormy16_expand_builtin_va_arg): Likewise.
	* config/xtensa/xtensa.c (xtensa_va_start, xtensa_va_arg): Likewise.

	* cp/call.c (build_vfield_ref): Add new operand for COMPONENT_REF.
	(build_new_method_call): Likewise.
	* cp/decl.c (local_variable_p_walkfn): Don't walk into types.
	* cp/decl2.c (grok_array_decl): Add new operands for ARRAY_REF.
	(build_anon_union_vars): Add new operand for COMPONENT_REF.
	* cp/init.c (buld_new): Add new operand for ARRAY_REF.
	* cp/method.c (do_build_copy_constructor): New op for COMPONENT_REF.
	(do_build_assign_ref): Likewise.
	* cp/parser.c (cp_parser_direct_new_declarator): Add new operands
	for ARRAY_REF.
	(cp_parser_direct_declarator): Likewise.
	* cp/pt.c (tsubst): Likewise.
	(tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand
 	for COMPONENT_REF.
	* cp/semantics.c (finish_non_static_data_member): Add new operand
	for COMPONENT_REF.
	* cp/typeck.c (build_class_member_access_expr): Likewise.
	(build_class_member_access_expr, finish_class_member_access_expr):
	Likewise.
	(build_ptrmemfunc_access_expr): Likewise.
	(build_array_ref): Add new operands for ARRAY_REF.
	* cp/typeck2.c (split_nonconstant_init_1): Likewise; COMPONENT_REF too.
	* cp/tree.c (count_trees_r, no_linkage_helper): Don't walk in types.

	* fortran/f95-lang.c (LANG_HOOKS_GIMPLE_BEFORE_INLINING): Deleted.
	* fortran/trans-array.c (gfc_conv_descriptor_data): Add operand
	for COMPONENT_REF.
	(gfc_conv_descriptor_offset, gfc_conv_descriptor_dtype): Likewise.
	(gfc_conv_descriptor_dimension, gfc_conv_descriptor_stride): Likewise.
	(gfc_conv_descriptor_lbound, gfc_conv_descriptor_ubound): Likewise.
	* fortran/trans-common.c (create_common): Likewise.
	* fortran/trans-expr.c (gfc_conv_component_ref): Likewise.
	* fortran/trans-io.c (set_parameter_value): Likewise.
	(set_parameter_ref, set_string, set_flag, io_result): Likewise.
	(transfer_expr): Likewise.
	* fortran/trans-decl.c (gfc_trans_auto_character_variable):
	Set up to get DECL_SIZE and DECL_SIZE_UNIT gimplified.
	(gfc_simplify_function): New function.
	(gfc_generate_function-code): Properly handle nested functions.
	* fortran/trans.c (gfc_build_array_ref): Add two new operands
	for ARRAY_REF.

	* java/class.c (build_class_ref): Add new operand for COMPONENT_REF.
	(build_static_field_ref): Likewise and add new operands for ARRAY_REF.
	* java/constants.c (build_ref_from_constant_pool): Likewise.
	* java/expr.c (build_java_array_length_access): Likewise.
	(build_get_class, build_field_ref, build_known_method_ref): Likewise.
	(invoke_build_dtable, build_invokevirtual): Likewise.
	(build_invokeinterface, java_expand_expr): Likewise.
	(emit_init_test_initialization): Likewise.
	* java/java-gimplify.c (java_gimplify_new_array_init): Likewise.
	* java/parse.y (make_qualifed_name, build_array_ref): Likewise.

	* objc/ojbc-act.c (generate_static_references): Add additional
	operands to ARRAY_REF.
	(generate_strings, build_method_prototype_list_template): Likewise.
	(generate_protocol_list): Likewise.

From-SVN: r83474
2004-06-21 23:07:05 -04:00
Geoffrey Keating 2f0c006e5f class.c (build_clone): Don't call defer_fn, let mark_used do it.
* class.c (build_clone): Don't call defer_fn, let mark_used do it.
	* cp-tree.h (defer_fn): Delete.
	* decl2.c (defer_fn): Delete.
	(finish_file): Simplify deferred_fns loops; check that
	only used inline functions get into deferred_fns.
	(mark_used): Inline previous contents of defer_fn.

From-SVN: r83310
2004-06-17 21:11:38 +00:00
Richard Henderson 325c369115 c-common.c (lang_gimplify_stmt): Remove next_p argument.
* c-common.c (lang_gimplify_stmt): Remove next_p argument.
	(if_elt, if_stack, if_stack_space, c_expand_start_cond, c_finish_then,
	c_expand_end_cond, c_expand_start_else, c_finish_else, c_begin_if_stmt,
	c_begin_while_stmt, c_finish_while_stmt_cond): Move to c-typeck.c.
	(finish_fname_decls, fname_decl): Use statement_lists.
	(c_expand_expr_stmt): Don't set last_expr_type.
	(c_type_hash): Fix indentation.
	(c_safe_from_p): Don't follow TREE_CHAIN.
	(c_tree_chain_matters_p): Remove.
	* c-common.def (SCOPE_STMT): Remove.
	(CLEANUP_STMT): Redefine to contain its own body.
	* c-common.h (struct stmt_tree_s): Remove x_last_stmt,
	x_last_expr_type, x_last_expr_filename, x_scope_stmt_stack.
	Add x_cur_stmt_list.
	(last_tree, last_expr_type, last_expr_filename, RECHAIN_STMTS): Remove.
	(cur_stmt_list): New.
	(STATEMENT_LIST_STMT_EXPR): New.
	(SCOPE_BEGIN_P, SCOPE_END_P, SCOPE_STMT_BLOCK, SCOPE_NULLIFIED_P,
	SCOPE_NO_CLEANUPS_P, SCOPE_PARTIAL_P, NEW_FOR_SCOPE_P): Remove.
	(CLEANUP_BODY): New.
	(CLEANUP_DECL): Move to operand 2.
	(c_common_stmt_codes): Remove SCOPE_STMT.
	(COMPOUND_STMT_NO_SCOPE, COMPOUND_STMT_BODY_BLOCK): Remove.
	* c-decl.c (c_scope_stmt_stack, current_scope_stmt_stack): Remove.
	(c_push_function_context, c_pop_function_context): Don't save it.
	(finish_decl): Set TREE_USED on the decl for a cleanup.
	Use push_cleanup.
	(store_parm_decls): Use statement lists.
	(finish_function): Remove compstmt rule workaround.  Use statement
	lists.  Call finish_fname_decls after finalizing the body.
	(c_begin_compound_stmt): Move to c-typeck.c.
	* c-dump.c (c_dump_tree): Remove SCOPE_STMT.
	* c-gimplify.c (gimplify_cleanup_stmt, gimplify_cleanup_stmts): New.
	(c_genericize): Invoke them.
	(c_gimplify_stmt): Don't look through TREE_CHAIN.  Kill SCOPE_STMT.
	(c_build_bind_expr): Export.
	(gimplify_block, gimplify_cleanup): Remove.
	(gimplify_condition): Use gimplify_stmt.
	(gimplify_for_stmt): Remove FOR_INIT_STMT chaining hack.
	(gimplify_if_stmt): Remove recursion hack.
	(c_gimplify_expr): Remove STMT_EXPR handling.
	(stmt_expr_last_stmt, gimplify_stmt_expr): Remove.
	(is_last_stmt_of_scope): Remove.
	* c-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove.
	* c-mudflap.c (mflang_flush_calls): Use c_begin_compound_stmt,
	c_end_compound_stmt.
	* c-objc-common.c (build_cdtor): Likewise.
	* c-parse.in (primary): Use c_finish_stmt_expr.
	(push_scope, pop_scope): Remove.
	(c99_block_start, compstmt_start): Use c_begin_compound_stmt.
	(c99_block_end, compstmt): Use c_end_compound_stmt.
	(c99_block_lineno_labeled_stmt): Likewise.
	(compstmt_primary_start): Use c_begin_stmt_expr.
	(simple_if, select_or_iter_stmt): Update calls to stmt builders.
	(do_stmt_start): Fill in body directly.
	(lineno_stmt): Avoid setting lineno on constants.
	* c-pretty-print.c (pp_c_statement): Handle STATEMENT_LIST.
	Remove SCOPE_STMT.
	* c-semantics.c (begin_stmt_tree): Remove.
	(push_stmt_list, re_push_stmt_list, pop_stmt_list): New.
	(add_stmt): Use statement lists.
	(add_scope_stmt, finish_stmt_tree): Remove.
	(push_cleanup): New.
	* c-tree.h: Move some decls from c-common.h.
	* c-typeck.c (c_tree_expr_nonnegative_p): Simplify for statement lists.
	(do_case, c_finish_case): Likewise.
	(c_finish_then): Take body for then as argument.
	(c_finish_else): Similarly.
	(c_begin_for_stmt, c_finish_for_stmt_init, c_finish_for_stmt_cond,
	c_finish_for_stmt_incr, c_finish_for_stmt): New.
	(c_begin_stmt_expr, c_finish_stmt_expr): New.
	(c_begin_compound_stmt): Do scope management.
	(c_end_compound_stmt): New.
	* fold-const.c (tree_expr_nonnegative_p): Fix BIND_EXPR.
	* gimplify.c (voidify_wrapper_expr): Accept temporary argument.
	Look through exception handling constructs.
	(gimplify_bind_expr): Accept temporary argument.
	(gimplify_target_expr): Special case BIND_EXPR bodies.
	(gimplify_expr): Handle fallback == fb_none like a statement.
	* langhooks-def.h (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Kill.
	* langhooks.c (lhd_tree_inlining_tree_chain_matters_p): Remove.
	* langhooks.h (tree_chain_matters_p): Remove.
	* stub-objc.c (objc_clear_super_receiver): New.
	* tree-gimple.h (voidify_wrapper_expr): Update decl.
	(append_to_statement_list, append_to_statement_list_force): Move
	to tree-iterator.h.
	* tree-inline.c (expand_call_inline): Update call.
	(clone_body): Use statement lists.
	(walk_tree): Don't check tree_chain_matters_p.
	(copy_tree_r): Likewise.
	* tree-iterator.c (alloc_stmt_list): Clear lang bits.
	(tsi_link_before, tsi_link_after): Set TREE_SIDE_EFFECTS properly.
	* tree-iterator.h (append_to_statement_list,
	append_to_statement_list_force): Moved from tree-gimple.h.
	* tree-pretty-print.c (dump_generic_node): Clean up TARGET_EXPR dump.
	* objc/objc-act.c (build_module_descriptor): Use c_begin_compound_stmt.
	(objc_enter_block): Likewise.
	(objc_exit_block): Use c_end_compound_stmt.
	(objc_build_try_enter_fragment): Add #error and comment for
	rewriting for OBJCPLUS.
	(objc_build_extract_fragment, objc_build_try_epilogue,
	objc_build_catch_stmt, objc_build_finally_prologue,
	objc_build_finally_epilogue): Update for C statement builders.
	* objc/objc-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P):
	Remove.
cp/
	* call.c (initialize_reference): Don't build CLEANUP_STMT here.
	* cp-gimplify.c (cp_gimplify_stmt): Remove next_p argument.
	(genericize_try_block): Use gimplify_stmt.
	(genericize_catch_block, genericize_eh_spec_block): Likewise.
	(cp_gimplify_init_expr): Remove STMT_EXPR special case.
	(gimplify_must_not_throw_expr): Update voidify_wrapper_expr call.
	* cp-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove.
	(cp_tree_chain_matters_p): Remove.
	* cp-tree.h (COMPOUND_STMT_TRY_BLOCK): New.
	(COMPOUND_STMT_BODY_BLOCK): New.
	(STATEMENT_LIST_NO_SCOPE, STATEMENT_LIST_TRY_BLOCK): New.
	(EXPR_STMT_STMT_EXPR_RESULT): New.
	(building_stmt_tree): Check cur_stmt_list.
	(tf_stmt_expr_cmpd, tf_stmt_expr_body): Remove.
	(BCS_NO_SCOPE, BCS_TRY_BLOCK, BCS_FN_BODY): New.
	* decl.c (poplevel): Use pop_stmt_list for minding cleanups.
	(cp_finish_decl): Use push_cleanup.
	(start_function, finish_function): Use statement lists.
	(finish_stmt): Do nothing.
	* except.c (begin_eh_spec_block): Use statement lists.
	(check_handlers_1, check_handlers): Likewise.
	* init.c (construct_virtual_base): Don't add extra compound stmts.
	(build_vec_init): Likewise.
	* name-lookup.c (maybe_push_cleanup_level): Use statement lists.
	* name-lookup.h (struct cp_binding_level): Add statement_list.
	* parser.c (cp_parser_statement): Take the STMT_EXPR node, not a bool.
	(cp_parser_labeled_statement, cp_parser_expression_statement,
	cp_parser_statement_seq_opt): Likewise.
	(cp_parser_compound_statement): Likewise.  Take bool for try block.
	(cp_parser_selection_statement): Tidy if processing.
	(cp_parser_already_scoped_statement): Rewrite to do what it says.
	* pt.c (tsubst_copy): Move STMT_EXPR to tsubst_expr.
	(tsubst_expr): Rewrite STMT_EXPR processing.  Handle STATEMENT_LIST.
	Mind COMPOUND_STMT_TRY_BLOCK, EXPR_STMT_STMT_EXPR_RESULT.
	* semantics.c (do_poplevel, do_pushlevel): Use statement lists.
	(finish_cond): New, rewritten from FINISH_COND.
	(simplify_loop_decl_cond): New.
	(finish_expr_stmt): Avoid nested EXPR_STMTs.
	(begin_if_stmt, finish_if_stmt_cond, finish_then_clause,
	begin_else_clause, finish_else_clause, finish_if_stmt,
	begin_while_stmt, finish_while_stmt_cond, finish_while_stmt,
	begin_do_stmt, finish_do_body, begin_for_stmt, finish_for_init_stmt,
	finish_for_cond, finish_for_stmt, begin_switch_stmt,
	finish_switch_cond, finish_switch_stmt, begin_try_block,
	finish_try_block, finish_cleanup_try_block, finish_function_try_block,
	finish_handler_sequence, finish_function_handler_sequence,
	begin_handler, finish_handler_parms, finish_handler,
	begin_stmt_expr, finish_stmt_expr_expr, finish_stmt_expr): Rewrite
	using statement lists.
	(begin_compound_stmt): Replace has_no_scope argument with flags.
	Update all callers.  Use statement lists.
	(finish_compound_stmt): Likewise.
	(finish_decl_cleanup, finish_eh_cleanup): Use push_cleanup.
	(current_scope_stmt_stack): Remove.
	(simplify_aggr_init_expr): Don't muck with TREE_CHAIN.
	* typeck2.c (split_nonconstant_init_1, split_nonconstant_init):
	Rewrite with statement lists.
testsuite/
	* g++.dg/ext/stmtexpr1.C: XFAIL.
	* gcc.dg/20030612-1.c: XFAIL.

From-SVN: r83221
2004-06-15 18:21:38 -07:00
Paolo Bonzini 096f22f424 function.h (struct function): Remove cannot_inline field.
gcc/ChangeLog:
2004-06-15  Paolo Bonzini  <bonzini@gnu.org>

	* function.h (struct function): Remove cannot_inline field.
	(current_function_cannot_inline): Remove.
	* passes.c (rest_of_compilation): Reset DECL_DEFER_OUTPUT.
	Simplify conditionals to ignore warn_return_type.
	* tree-optimize.c (tree_rest_of_compilation): Do not reset
	DECL_DEFER_OUTPUT.
	* objc/objc-act.c (build_module_descriptor, finish_method_def):
	Do not set current_function_cannot_inline.

gcc/java/ChangeLog:
2004-06-15  Paolo Bonzini  <bonzini@gnu.org>

	* class.c (emit_register_classes): Make the function uninlinable,
	do not set current_function_cannot_inline.
	* resource.c (write_resource_constructor): Do not reset
	flag_inline_functions around rest_of_compilation.

gcc/cp/ChangeLog:
2004-06-15  Paolo Bonzini  <bonzini@gnu.org>

	* cp-tree.h (struct language_function): Remove cannot_inline.
	* decl.c (save_function_data): cannot_inline is no more.
	(cxx_push_function_context): Likewise.
	* decl2.c (start_objects, start_static_storage_duration_function):
	Reset DECL_INLINE, set DECL_UNINLINABLE.

From-SVN: r83181
2004-06-15 12:46:07 +00:00
Matt Austern 0524c91d1e re PR c++/15428 (vtables shouldn't always be weak on Darwin)
PR c++/15428
	* default.h (TARGET_WEAK_NOT_IN_ARCHIVE_TOC): New name
	for TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY, with reversed sense.
	* config/darwin.h (TARGET_WEAK_NOT_IN_ARCHIVE_TOC): Likewise.
	* doc/tm.texi (TARGET_WEAK_NOT_IN_ARCHIVE_TOC): Rewrite
	documentation to reflect the new macro name and to clarify its
	meaning.
	* cp/decl2.c (maybe_emit_vtables): If TARGET_WEAK_NOT_IN_ARCHIVE_TOC
	is nonzero, and if we see a noninline definition of a key method,
	make the vtables nonweak.

From-SVN: r82610
2004-06-03 23:15:01 +00:00
Matt Austern 415c974c0b When a class template is explicitly instantiated, its member should be too.
* cp-tree.h (instantiate_decl): new boolean parameter,
	undefined_ok. Current behavior is equivalent to its being 0.
	* decl2.c (mark_used): Add new argument when calling instantiate_decl
	* pt.c (mark_decl_instantiated): Unconditionally make
	instantiations explicit unconditionally
	(do_decl_instantiation): Don't call SET_DECL_EXPLICIT_INSTANTIATION,
	since mark_decl_instantiated now does it.
	(instantiate_class_member): New.  Instantiate a member of an
	explicitly instantiated class template.
	(do_type_instantiation): Explicitly instantiate members of an
	explicitly instantiated class template.
	(instantiate_decl): if undefined_ok is nonzero, and if we're
	trying to explicitly instantiated a template with no definition,
	change it to an implicit instantiation.
	(instantiate_pending_templates): Add new argument to instantiate_decl.
	* tree.c (cp_cannot_inline_tree_fn): Likewise.

From-SVN: r82585
2004-06-02 21:12:54 +00:00
Kazu Hirata 324f9dfb93 call.c, [...]: Fix comment formatting.
* call.c, class.c, cp-tree.def, decl2.c, name-lookup.c, pt.c,
	typeck.c: Fix comment formatting.

From-SVN: r82476
2004-05-31 08:42:32 +00:00
Mark Mitchell c1cca8d4eb re PR c++/15083 (spurious "statement has no effect" warning)
PR c++/15083
	* decl2.c (delete_sanity): Set TREE_SIDE_EFFECTS on a DELETE_EXPR,
	even in a templat.e
	* init.c (build_new): Likewise.

	PR c++/15640
	* name-lookup.c (arg_assoc): Robustify.

	PR c++/15471
	* typeck.c (unary_complex_lvalue): Use context_for_name_lookup
	when determining the scope to use for a pointer to member.

	PR c++/15083
	* g++.dg/warn/noeffect5.C: New test.

	PR c++/15471
	* g++.dg/expr/ptrmem4.C: New test.

	PR c++/15640
	* g++.dg/template/operator3.C: New test.

From-SVN: r82391
2004-05-28 22:35:50 +00:00
Geoffrey Keating bf2774382d method.c (implicitly_declare_fn): Don't call defer_fn; abort if it might be needed.
* method.c (implicitly_declare_fn): Don't call defer_fn; abort
	if it might be needed.
	* pt.c (mark_decl_instantiated): Only call defer_fn if
	the function actually needs processing in finish_file.
	* decl2.c (finish_file): Add check that elements in
	deferred_fns_used are really needed there.  Remove unnecessary
	test of DECL_SAVED_TREE.

From-SVN: r82217
2004-05-24 21:07:42 +00:00
Zack Weinberg bb9a388dad * cgraph.c (hash_node, eq_node, cgraph_node, cgraph_remove_node)
(cgraph_varpool_hash_node, eq_cgraph_varpool_node)
	(cgraph_varpool_node):
	Use DECL_UID for the key, not DECL_ASSEMBLER_NAME.
	(cgraph_function_possibly_inlined_p): Use the decl itself for
	the key, not DECL_ASSEMBLER_NAME.
	(change_decl_assembler_name): No need to muck with the hash tables.
	(cgraph_node_for_identifier, cgraph_varpool_node_for_identifier):
	Delete.
	* cgraphunit.c (cgraph_mark_inline_edge): Use the decl itself
	for the key, not DECL_ASSEMBLER_NAME.
	* cgraph.h: Remove prototypes of deleted functions.
	* varasm.c (mark_referenced): Just set TREE_SYMBOL_REFERENCED.
	(mark_decl_referenced): New function.
	* tree.h: Prototype mark_decl_referenced.
	* final.c (output_addr_const) <case SYMBOL_REF>: Call
	mark_decl_referenced before assemble_name.
	* c-decl.c (finish_decl): Use mark_decl_referenced.
cp:
	* decl.c (cp_finish_decl): Use mark_decl_referenced.
	* decl2.c (maybe_make_one_only): Likewise.
	* method.c (use_thunk): Likewise.

From-SVN: r82015
2004-05-19 01:28:56 +00:00
Diego Novillo 6de9cd9a88 Merge tree-ssa-20020619-branch into mainline.
From-SVN: r81764
2004-05-13 02:41:07 -04:00
Giovanni Bajo 4402147197 re PR c++/14389 (Out-of-line of overloaded template rejected)
PR c++/14389
	* decl2.c (check_classfn): For member templates, compare also the
	template parameters to match the declaration.
	* cp-tree.h: Adjust declaration of check_classfn.
	* decl.c (start_decl, grokfndecl): Adjust callers of check_classfn.
	* friend.c (do_friend): Likewise.
	* pt.c (tsubst_friend_function): Likewise.

	PR c++/14389
	* g++.dg/template/member5.C: New test.

From-SVN: r81426
2004-05-03 10:11:19 +00:00