Commit Graph

820 Commits

Author SHA1 Message Date
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
Kazu Hirata a692ad2ece class.c, [...]: Fix comment typos.
* class.c, cp-tree.h, decl.c, decl2.c, pt.c, rtti.c: Fix
	comment typos.

From-SVN: r81344
2004-04-30 15:51:53 +00:00
Jakub Jelinek a7485e9375 decl2.c (mark_used): Don't segfault if cfun != NULL but current_function_decl == NULL.
* decl2.c (mark_used): Don't segfault if cfun != NULL but
	current_function_decl == NULL.

From-SVN: r80506
2004-04-08 15:38:00 +02:00
Mark Mitchell 4546865e5b call.c (build_op_delete_call): Do not forget the placement arguments when iterating through mutiple delete...
* call.c (build_op_delete_call): Do not forget the placement
	arguments when iterating through mutiple delete operators.

	* cp-tree.h (svaed_scope): Remove last_parms.
	(NEW_DELETE_OPNAME_P): New macro.
	(last_function_parms): Remove.
	(do_friend): Adjust prototype.
	* decl.c (grokparms): Return the PARM_DECLs directly, rather than
	using last_function_parms.
	(grokfndecl): Take the PARM_DECLs as an argument, rather than
	using last_function_parms.
	(grokdeclarator): Adjust accordingly.  Do not form METHOD_TYPEs
	for class-specific operator new and operator delete.
	(grok_op_properties): Do not look for allocation functions with
	METHOD_TYPEs.
	(start_function): Use DECL_ARGUMENTS instead of
	last_function_parms.
	* decl.h (last_function_parms): Do not declare.
	* decl2.c (grokclassfn): Do not use last_function_parms.
	* friend.c (do_friend): Remove parmdecls parameter.
	* name-lookup.c (push_to_top_level): Do not save last_function_parms.
	(pop_from_top_level): Do not restore it.
	* pt.c (check_explicit_specialization): Do not adjust
	last_function_parms.

	* name-lookup.c (do_local_using_decl): Create a local binding for
	types brought in via using declarations.

	* name-lookup.c (lookup_arg_dependent): Handle block-scope
	function declarations correctly.

	* semantics.c (finish_id_expression): Correct handling of
	conversion operators to dependent types.

	* typeck.c (lookup_destructor): Allow the use of destructors from
	base classes.

	* g++.dg/init/placement3.C: New test.

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

	* g++.dg/lookup/using11.C: New test.

	* g++.dg/lookup/koenig3.C: New test.

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

	* g++.dg/expr/dtor3.C: New test.
	* g++.old-deja/g++.brendan/crash15.C: Remove incorrect dg-error
	marker.
	* g++.old-deja/g++.law/visibility28.C: Likewise.

From-SVN: r79722
2004-03-20 00:18:24 +00:00
Mark Mitchell ec835fb2bf re PR c++/14586 (Bogus warning in templates about taking address of a temporary in a template)
PR c++/14586
	* cp-tree.h (build_new_op): Change prototype.
	(build_x_binary_op): Likewise.
	* call.c (build_new_op): Add overloaded_p parameter.
	* decl2.c (grok_array_decl): Adjust call to build_new_op.
	* parser.c (cp_parser_binary_expression): Note that uses of
	overloaded operators prevents an expression from being considered
	an integral constant.
	* pt.c (tsubst_copy_and_build): Adjust calls to build_new_op and/or
	build_x_binary_op.
	* semantics.c (finish_call_expr): Likewise.
	* typeck.c (rationalize_conditional_expr): Likewise.
	(build_x_indirect_ref): Likewise.
	(build_x_binary_op): Likewise.
	(build_x_unary_op): Likewise.
	(build_x_compound_expr): Likewise.
	(build_modify_expr): Likewise.
	* typeck2.c (build_x_arrow): Likewise.

	PR c++/14586
	* g++.dg/parse/non-dependent3.C: New test.

From-SVN: r79553
2004-03-16 22:18:11 +00:00
Matt Austern 4746cf8447 Enabled linkonce support for Darwin.
* target.h (struct gcc_target): New target hook, unwind_label.
	* target-def.h (TARGET_ASM_EMIT_UNWIND_LABEL): New hook.
	* output.h (default_emit_unwind_label): New function.
	* default.h (TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY): New macro.
	(TARGET_USES_WEAK_UNWIND_INFO): New target macro.
	(TARGET_SUPPORTS_HIDDEN): New target macro.
	* dwarf2out.c (struct dw_fde_struct): Add field for function decl
	that corresponds to this FDE.
	(FRAME_BEGIN_LABEL): Allow target to override default label.
	(output_call_frame_info): If FDEs are linknonce, then use extra
	indirection for FDE encoding, output a label for each FDE, and
	output an empty label for each function without an FDE.
	(dwarf2out_begin_prologue): Set up decl field when creating an FDE.
	* varasm.c (globalize_decl): Call ASM_MAKE_LABEL_LINKONCE for
	decls with DECL_ONE_ONLY set, if that macro is defined.
	(make_decl_one_only): Don't use DECL_COMMON if we're compiling
	for a SUPPORTS_ONE_ONLY target.
	* config/darwin-protos.h (darwin_unique_section): Declare.
	(darwin_asm_named_section): Likewise.
	(darwin_section_type_flags): Likewise.
	(darwin_non_lazy_pcrel): Likewise.
	(darwin_emit_unwind_label): Likewise.
	(darwin_make_decl_one_only): Likewise.
	* config/darwin.c (machopic_finish): Get rid of tweak that
	eliminate stubs for symbols that are defined.
	(darwin_encode_section_info): Don't treat weak functions as defined.
	(darwin_make_decl_one_only): Define.
	(darwin_asm_named_section): Likewise.
	(darwin_section_type_flags): Likewise.
	(darwin_unique_section): Likewise.
	(darwin_emit_unwind_label): Likewise.
	(darwin_non_lazy_pcrel): Likewise.
	(darwin_asm_output_dwarf_delta): Difference between two labels is
	local only if both labels are local.
	* config/darwin.h (MAKE_DECL_ONE_ONLY): Define.
	(ASM_MAKE_LABEL_LINKONCE): Likewise.
	(TARGET_SUPPORTS_HIDDEN): Likewise.
	(TARGET_USES_WEAK_UNWIND_INFO): Likewise.
	(TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY): Likewise.
	(FRAME_BEGIN_LABEL): Likewise.
	(ASM_DECLARE_OBJECT_NAME): Make references to weak symbols indirect.
	(ASM_DECLARE_FUNCTION_NAME): Likewise.
	(darwin_eh_frame_section): Give __eh_frame section the coalesced flag.
	(TARGET_ASM_UNIQUE_SECTION): Define.
	(EH_FRAME_SECTION_NAME): Define.
	(EH_FRAME_SECTION_ATTR): Likewise.
	(ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise.
	(TARGET_ASM_NAMED_SECTION): Likewise.
	(TARGET_SECTION_TYPE_FLAGS): Likewise.
	* doc/tm.texi: Document TARGET_USES_WEAK_UNWIND_INFO,
	TARGET_EXPLICIT_INSTANTIATIONS_ONE_ONLY, TARGET_SUPPORTS_HIDDEN,
	TARGET_ASM_EMIT_UNWIND_LABEL.

	* cp/decl2.c (maybe_make_one_only): Look at
	TARGET_EXPLICIT_INSTANTIATION_ONE_ONLY when deciding whether
	to make an explicit instantiation weak.
	* cp/method.c (use_thunk): Make sure we call comdat_linkage
	when appropriate.
	* cp/pt.c (do_type_instantiation): On systems where weak symbols
	don't go in a static archive's TOC, explicit instantiation of a
	class must imply *explicit* instantiation of its memeber.

From-SVN: r79394
2004-03-12 17:09:03 +00:00
Mark Mitchell 91b004e5ec re PR c++/14138 (100x -O0 C++ Compile Time Regression {3.2,3.3} -> {3.4,4.0})
PR c++/14138
	* name-lookup.h (push_scope): Change prototype.
	* name-lookup.c (push_scope): Do not reenter the current class
	scope.
	* decl.c (grokfndecl): Check return code from push_scope before
	calling pop_scope.
	* decl2.c (check_classfn): Likewise.
	* parser.c (cp_parser_conversion_function_id): Likewise.
	(cp_parser_init_declarator): Likewise.
	(cp_parser_direct_declarator): Likewise.
	(cp_parser_class_specifier): Likewise.
	(cp_parser_class_head): Likewise.
	(cp_parser_lookup_name): Likewise.
	(cp_parser_constructor_declarator_p): Likewise.
	* pt.c (instantiate_class_template): Likewise.
	(resolve_typename_type): Likewise.

From-SVN: r78696
2004-03-01 06:23:38 +00:00
Mark Mitchell 0e8c9b28a1 re PR c++/14122 (problem with non-type tmplt parm in member template)
PR c++/14122
	* cp-tree.h (delete_sanity): Change prototype.
	* decl2.c (delete_sanity): Make doing_vec a bool, not an int.
	Remove dead code.  Adjust code to warn about deleting an array.
	* typekc.c (decay_conversion): Use build_address and build_nop.

	PR c++/14108
	* search.c (accessible_p): Do not check access in thunks.

	PR c++/14122
	* g++.dg/template/array4.C: New test.

	PR c++/14108
	* g++.dg/inherit/thunk2.C: New test.

From-SVN: r77786
2004-02-14 00:49:15 +00:00
Mark Mitchell 5bd61841e4 call.c (conversion_kind): New type.
* call.c (conversion_kind): New type.
	(conversion_rank): Likewise.
	(conversion): Likewise.
	(CONVERSION_RANK): New macro.
	(conversion_obstack): New variable.
	(obstack_initialized): Likewise.
	(z_candidate): Change type of convs and second_conv.
	(candidate_warning): New type.
	(IDENTITY_RANK): Remove.
	(EXACT_RANK): Likewise.
	(PROMO_RANK): Likewise.
	(STD_RANK): Likewise.
	(PBOOL_RANK): Likewise.
	(USER_RANK): Likewise.
	(ELLIPSIS_RANK): Likewise.
	(BAD_RANK): Likewise.
	(ICS_RANK): Likewise.
	(ICS_STD_RANK): Likewise.
	(ICS_USER_FLAG): Likewise.
	(ICS_ELLIPSIS_FLAG): Likewise.
	(ICS_THIS_FLAG): Likewise.
	(ICS_BAD_FLAG): Likewise.
	(NEED_TEMPORARY_P): Likewise.
	(CHECK_COPY_CONSTRUCTOR_P): Likewise.
	(USER_CONV_CAND): Likewise.
	(USER_CONV_FN): Likewise.
	(conversion_obstack_alloc): New function.
	(alloc_conversion): Likewise.
	(validate_conversion_obstack): Likewise.
	(alloc_conversions): Likewise.
	(build_conv): Adjust to deal with new conversion data structures.
	(build_identity_conv): New function.
	(build_ambiguous_conv): Likewise.
	(standard_conversion): Adjust to deal with new conversion data
	structures.
	(convert_class_to_reference): Likewise.
	(direct_reference_binding): Likewise.
	(reference_binding): Likewise.
	(implicit_conversion): Likewise.
	(add_candidate): Likewise.
	(add_function_candidate): Likewise.
	(add_conv_candidate): Likewise.
	(build_builtin_candidate): Likewise.
	(print_z_candidate): Likewise.
	(merge_conversion_sequences): Likewise.
	(build_user_type_conversion_1): Likewise.
	(build_user_type_conversion): Likewise.
	(build_new_function_call): Likewise.
	(build_object_call): Likewise.
	(conditional_conversion): Likewise.
	(build_conditional_expr): Likewise.
	(build_new_op): Likewise.
	(build_op_delete_call): Likewise.
	(convert_like_real): Likewise.
	(build_over_call): Likewise.
	(build_new_method_call): Likewise.
	(is_subseq): Likewise.
	(maybe_handle_implicit_object): Likewise.
	(maybe_handle_ref_bind): Likewise.
	(compare_ics): Likewise.
	(source_type): Likewise.
	(add_warning): Likewise.
	(joust): Likewise.
	(can_convert_arg): Likewise.
	(can_convert_arg_bad): Likewise.
	(perform_implicit_conversion): Likewise.
	(perform_direct_initialization_if_possible): Likewise.
	(initialize_reference): Likewise.
	* cp-lang.c (cp_tree_size): Do not handle WRAPPER.
	* cp-tree.def (WRAPPER): Likewise.
	(IDENTITY_CONV): Remove.
	(LVALUE_CONV): Likewise.
	(QUAL_CONV): Likewise.
	(STD_CONV): Likewise.
	(PTR_CONV): Likewise.
	(PMEM_CONV): Likewise.
	(BASE_CONV): Likewise.
	(REF_BIND): Likewise.
	(USER_CONV): Likewise.
	(AMBIG_CONV): Likewise.
	(RVALUE_CONV): Likewise.
	* cp-tree.h (tree_wrapper): Remove.
	(WRAPPER_ZC): Remove.
	(lang_tree_node): Remove wrapper.
	(LOOKUP_SPECULATIVELY): Remove.
	(build_op_delete_call): Adjust prototype.
	(validate_conversion_obstack): Declare.
	(build_zc_wrapper): Remove.
	* cvt.c (convert_to_reference): Remove dead code.
	(ocp_convert): Likewise.
	* decl.c (redeclaration_error_message): Correct handling of
	templates.
	(finish_destructor_body): Do not use LOOKUP_SPECULATIVELY.
	(cp_tree_node_structure): Remove WRAPPER case.
	* decl2.c (finish_file): Call validate_conversion_obstack.
	* init.c (build_new_1): Remove use of LOOKUP_SPECULATIVELY.
	(build_op_delete_call): Likewise.
	(build_x_delete): Likewise.
	(build_delete): Adjust call to build_op_delete_call.
	* pt.c (tsubst_friend_declaration): Adjust code to determine
	whether or not a friend template is a definition.
	(tsubst_decl): Clear DECL_INITIAL for new FUNCTION_DECLs.
	* tree.c (build_zc_wrapper): Remove.

From-SVN: r77752
2004-02-13 07:19:25 +00:00
Mark Mitchell c353b8e3fb class.c (add_method): Just check processing_template_decl to determine whether or not we are within a...
* class.c (add_method): Just check processing_template_decl to
	determine whether or not we are within a template.
	* decl2.c (maybe_retrofit_in_chrg): Likewise.
	* init.c (decl_constant_value): Check the type of the declaration,
	not TREE_READONLY.
	* name-lookup.c (maybe_push_to_top_level): Rename to ...
	(push_to_top_level): ... this.
	* name-lookup.h (maybe_push_to_top_level): Do not declare it.
	* pt.c (push_template_decl_real): Reorder condition for speed.
	(convert_template_argument): Use dependency-checking functions in
	place of uses_template_parms.
	(lookup_template_class): Avoid calling uses_template_parms more
	than once.
	(uses_template_parms): Reimplement, using dependency-checking
	functions.
	(instantiate_class_template): Use push_to_top_level, not
	maybe_push_to_top_level.
	(type_unification_real): Simplify.
	(type_dependent_expression_p): Handle OFFSET_REFs and
	TEMPLATE_DECLs.
	(any_dependent_template_arguments_p): Handle multiple levels of
	template argument.
	* semantics.c (expand_or_defer_fn): Do not check
	uses_template_parms for template instantiations.
	* typeck.c (comptypes): Avoid calling cp_type_quals.

From-SVN: r76647
2004-01-26 17:41:50 +00:00
Kazu Hirata 521cc5083b Make-lang.in, [...]: Update copyright.
* Make-lang.in, call.c, class.c, decl2.c, except.c, expr.c,
	init.c, mangle.c, typeck.c: Update copyright.

From-SVN: r76304
2004-01-21 20:52:28 +00:00
Jan Hubicka d34cb6a149 Partial fix PR c++/12850
Partial fix PR c++/12850
	* cgraphunit.c (cgraph_finalize_function): Always ggc_collect when
	at zero nest level.

	* decl2.c (mark_used): Do not proactively instantiate templates
	when compiling in unit-at-a-time or not optimizing.
	* optimize.c (maybe_clone_body): Do not increase function depth.

From-SVN: r75823
2004-01-13 23:59:19 +00:00
Richard Henderson 25ebb82a64 re PR rtl-optimization/10776 (Large aggregate initializers with a single relocated entry causes excessive compile time regression)
PR opt/10776
        * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): New.
        (store_init_value): Use it.
        * decl.c (check_initializer): Expect full initialization code
        from store_init_value.
        * init.c (expand_aggr_init_1): Likewise.
        * decl2.c (maybe_emit_vtables): Abort if runtime init needed.

From-SVN: r75763
2004-01-12 13:38:04 -08:00
Mark Mitchell 57702a80e8 c-common.c (flag_abi_version): Default to 2.
* c-common.c (flag_abi_version): Default to 2.
	* c-cppbuiltin.c (c_cpp_builtins): Define __GXX_ABI_VERSION
	uniformly for versions above 2.
	* doc/invoke.texi: Update documentation for -fabi-version.

	* cp-lang.c (cp_expr_size): Return zero for empty classes.

	* cp-tree.h (warn_if_uknown_interface): Remove unused function.
	* decl2.c (warn_if_unknown_interface): Likewise.

	* g++.dg/abi/macro0.C: New test.
	* g++.dg/abi/macro1.C: Likewise.
	* g++.dg/abi/macro2.C: Likewise.

	* g++.dg/abi/bitfield5.C: Add explicit -fabi-version=1 option.
	* g++.dg/abi/bitfield7.C: Likewise.
	* g++.dg/abi/dtor2.C: Likewise.
	* g++.dg/abi/mangle11.C: Likewise.
	* g++.dg/abi/mangle12.C: Likewise.
	* g++.dg/abi/mangle14.C: Likewise.
	* g++.dg/abi/mangle17.C: Likewise.
	* g++.dg/abi/vbase10.C: Likewise.
	* g++.dg/abi/vbase14.C: Likewise.
	* g++.dg/template/qualttp17.C: Likewise.

From-SVN: r74973
2003-12-23 16:53:53 +00:00
Mark Mitchell 7813d14ccc re PR c++/12862 (Conflicts Between typedefs/enums and Namespace Member Declarations)
* c-common.c (flag_external_templates): Remove.
	(flag_alt_external_templates): Likewise.
	* c-common.h (flag_external_templates): Remove.
	(flag_alt_external_templates): Likewise.
	* c-opts.c (c_common_handle_option): Unsupport
	-falt-external-templates and -ftemplates.
	* doc/invoke.texi: Remove mention of -fexternal-templates and
	-falt-external-templates.

	* decl.c (start_function): Do not check
	flag_alt_external_templates or flag_external_templates.
	* decl2.c (warn_if_unknown_interface): Likewise.
	* lex.c (extract_interface_info): Likewise.
	* pt.c (lookup_template_class): Likewise.

	PR c++/12862
	* name-lookup.c (pushdecl): Look up all namespace-scope entities
	in their corresponding namespace.

	* g++.old-deja/g++.jason/template18.C: Remove.
	* g++.old-deja/g++.jason/template37.C: Likewise.

	PR c++/12862
	* g++.dg/lookup/ns1.C: New test.

From-SVN: r74954
2003-12-22 23:57:08 +00:00
Kazu Hirata f4f206f46f call.c: Fix comment formatting.
* call.c: Fix comment formatting.
	* class.c: Likewise.
	* cp-tree.h: Likewise.
	* cvt.c: Likewise.
	* cxx-pretty-print.c: Likewise.
	* decl.c: Likewise.
	* decl2.c: Likewise.
	* error.c: Likewise.
	* except.c: Likewise.
	* init.c: Likewise.
	* name-lookup.c: Likewise.
	* parser.c: Likewise.
	* pt.c: Likewise.
	* rtti.c: Likewise.
	* semantics.c: Likewise.
	* typeck.c: Likewise.
	* typeck2.c: Likewise.

From-SVN: r74916
2003-12-21 21:07:32 +00:00
Kazu Hirata 926ce8bd97 cvt.c: Remove uses of "register" specifier in declarations of arguments and local...
* cvt.c: Remove uses of "register" specifier in
	declarations of arguments and local variables.
	* decl.c: Likewise.
	* decl2.c: Likewise.
	* expr.c: Likewise.
	* friend.c: Likewise.
	* lex.c: Likewise.
	* name-lookup.c: Likewise.
	* repo.c: Likewise.
	* search.c: Likewise.
	* tree.c: Likewise.
	* typeck.c: Likewise.
	* typeck2.c: Likewise.

From-SVN: r74855
2003-12-19 23:28:11 +00:00
Mark Mitchell 89f1a6eccc re PR c++/10926 (ICE in build_delete when trying to declare template destructor)
PR c++/10926
	* decl2.c (grokfield): Robustify.

	PR c++/11116
	* parser.c (cp_parser_throw_expression): Determine whether or not
	an assignment-expression is present by doing one-token lookahead.

	PR c++/10926
	* g++.dg/template/error9.C: New test.

	PR c++/11116
	* g++.dg/template/error8.C: New test.

From-SVN: r74664
2003-12-16 02:46:31 +00:00
Nathan Sidwell f5c28a158b class.c (add_method): Disallow destructor for java classes.
cp:
	* class.c (add_method): Disallow destructor for java classes.
	* decl.c (xref_basetypes): Check java class inheritance.
	* decl2.c (check_java_method): Skip artificial params.
testsuite:
	* g++.dg/other/java1.C: New test.

From-SVN: r74629
2003-12-15 14:19:10 +00:00
Kriang Lerdsuwanakij d43f603d85 re PR c++/5369 (template member friend declaration not honored)
PR c++/5369
	* friend.c (is_friend): Handle member function of a class
	template as template friend.
	(do_friend): Likewise.
	* decl2.c (check_classfn): Add template_header_p parameter.
	* decl.c (start_decl): Adjust check_classfn call.
	(grokfndecl): Likewise.
	* pt.c (is_specialization_of_friend): New function.
	(uses_template_parms_level): Likewise.
	(push_template_decl_real): Use uses_template_parms_level.
	(tsubst_friend_function): Adjust check_classfn call.
	* cp-tree.h (check_classfn): Adjust declaration.
	(uses_template_parms_level): Add declaration.
	(is_specialization_of_friend): Likewise.

	* g++.dg/template/memfriend1.C: New test.
	* g++.dg/template/memfriend2.C: Likewise.
	* g++.dg/template/memfriend3.C: Likewise.
	* g++.dg/template/memfriend4.C: Likewise.
	* g++.dg/template/memfriend5.C: Likewise.
	* g++.dg/template/memfriend6.C: Likewise.
	* g++.dg/template/memfriend7.C: Likewise.
	* g++.dg/template/memfriend8.C: Likewise.
	* g++.old-deja/g++.pt/friend44.C: Remove a bogus error.

From-SVN: r73833
2003-11-22 06:49:21 +00:00
Jan Hubicka fccc4eb240 re PR rtl-optimization/12275 ([unit-at-a-time] ICE in htab_clear_slot)
PR opt/12275
	* c-decl.c (finish_decl): Use change_decl_assembler_name.
	* c-pragma.c (handle_pragma_redefine_extname): Likewise.
	* varasm.c (make_decl_rtl): Likewise.
	* cgraph.c (change_decl_assembler_name): New function.
	* tree.h (set_decl_assembler_name): Kill dead declaration.
	(change_decl_assembler_name): Declare.

	* decl.c (make_rtl_for_nonlocal_decl): Use change_decl_assembler_name.
	* decl2.c (make_rtl_for_nonlocal_decl): Use change_decl_assembler_name.

From-SVN: r73532
2003-11-13 02:07:57 +00:00
Kazu Hirata cd0be382c9 ChangeLog: Fix typos.
* ChangeLog: Fix typos.
	* call.c: Fix comment typos.
	* class.c: Likewise.
	* cp-tree.h: Likewise.
	* cvt.c: Likewise.
	* cxx-pretty-print.c: Likewise.
	* decl.c: Likewise.
	* decl2.c: Likewise.
	* init.c: Likewise.
	* mangle.c: Likewise.
	* name-lookup.c: Likewise.
	* parser.c: Likewise.
	* search.c: Likewise.
	* semantics.c: Likewise.
	* tree.c: Likewise.
	* typeck.c: Likewise.

From-SVN: r72737
2003-10-21 02:16:17 +00:00
Jan Hubicka 2344a722aa problem that current decl duplication mechanizm > > /* If we didn't remap this variable...
problem that current decl duplication mechanizm
>
>         /* If we didn't remap this variable, so we can't mess with its
>   	 TREE_CHAIN.  If we remapped this variable to the return slot, it's

From-SVN: r72539
2003-10-15 23:10:20 +00:00
Gabriel Dos Reis 5a167978fa name-lookup.h (cxx_scope_find_binding_for_name): Don't export.
* name-lookup.h (cxx_scope_find_binding_for_name): Don't export.
	(binding_for_name): Likewise.
	(cxx_binding_clear): Move to name-lookup.c.
	* name-lookup.c (cxx_scope_find_binding_for_name): Now static.
	(binding_for_name): Likewise.
	* decl2.c (is_ancestor): Move to name-lookup.c
	(namespace_ancestor): Likewise.
	(add_using_namespace): Likewise.
	(ambiguous_decl): Likewise.
	(lookup_using_namespace): Likewise.
	(qualified_lookup_using_namespace): Likewise.
	(set_decl_namespace): Likewise.
	(decl_namespace): Likewise.
	(current_decl_namespace): Likewise.
	(push_decl_namespace): Likewise.
	(pop_decl_namespace): Likewise.
	(push_scope): Likewise.
	(pop_scope): Likewise.
	(struct arg_lookup): Likewise.
	(arg_assoc): Likewise.
	(arg_assoc_args): Likewise.
	(arg_assoc_type): Likewise.
	(add_function): Likewise.
	(arg_assoc_namespace): Likewise.
	(arg_assoc_class): Likewise.
	(arg_assoc_template_arg): Likewise.
	(do_namespace_alias): Likewise.
	(validate_nonmember_using_decl): Likewise.
	(do_nonmember_using_decl): Likewise.
	(do_toplevel_using_decl): Likewise.
	(do_local_using_decl): Likewise.
	(do_class_using_decl): Likewise.
	(do_using_directive): Likewise.
	(constructor_name_full): Likewise.
	(constructor_name): Likewise.
	(constructor_name_p): Likewise.

From-SVN: r72462
2003-10-14 08:19:06 +00:00
Andreas Jaeger edaf3e0357 c-decl.c (finish_function): Convert definition to ISO C90.
* c-decl.c (finish_function): Convert definition to ISO C90.
	* ifcvt.c (mark_loop_exit_edges): Likewise.
	* ra-rewrite.c (emit_colors): Likewise.

For cp:

	* decl.c (cxx_builtin_type_decls): Convert to ISO C90 function
	definition.
	* init.c (push_base_cleanups): Likewise.
	* decl2.c (finish_file): Likewise.
	* mangle.c (init_mangle): Likewise.
	(dump_substitution_candidates): Likewise.
	* search.c: Likewise.

From-SVN: r71872
2003-09-28 06:37:41 +02:00
Gabriel Dos Reis 147135cc00 cp-tree.h, [...]: Remove reference to macros BINDING_SCOPE, BINDING_VALUE and BINDING_TYPE.
* cp-tree.h, name-lookup.h, decl.c, decl2.c: Remove reference to
	macros 	BINDING_SCOPE, BINDING_VALUE and BINDING_TYPE.

From-SVN: r71848
2003-09-27 01:55:13 +00:00
Richard Henderson f31686a322 Revert DECL_SOURCE_LOCATION -> TREE_LOCUS change.
From-SVN: r71641
2003-09-21 22:09:32 -07:00
Richard Henderson 7e2af53a14 tree.h (TREE_LOCUS): Rename from DECL_SOURCE_LOCATION; make const.
* tree.h (TREE_LOCUS): Rename from DECL_SOURCE_LOCATION; make const.
	(TREE_FILENAME, TREE_LINENO): Likewise.
	(set_tree_locus, copy_tree_locus, set_tree_file_line): New.
	(TREE_LOCUS_SET_P): New.
	* c-aux-info.c, c-decl.c, c-parse.in, coverage.c, dbxout.c,
	diagnostic.c, dwarf2out.c, dwarfout.c, function.c, integrate.c,
	print-tree.c, stmt.c, toplev.c, tree-dump.c, tree-inline.c,
	tree-optimize.c, tree.c, tree.def, xcoffout.c, config/alpha/alpha.c,
	config/mips/mips.c, doc/c-tree.texi, objc/objc-act.c: Update to match.

ada/
	* trans.c, utils.c: Update for DECL_SOURCE_LOCATION rename and
	change to const.

cp/
	* class.c, cp-tree.h, decl.c, decl2.c, error.c, init.c,
	method.c, optimize.c, pt.c, semantics.c, tree.c: Update for
	DECL_SOURCE_LOCATION rename and change to const.

f/
	* com.c, ste.c: Update for DECL_SOURCE_LOCATION rename and
	change to const.

java/
	* class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y,
	resource.c: Update for DECL_SOURCE_LOCATION rename and change to const.

treelang/
	* treetree.c: Update for DECL_SOURCE_LOCATION rename and
	change to const.

From-SVN: r71636
2003-09-21 16:39:40 -07:00
Richard Henderson ddd2d57e72 c-format.c (gcc_diag_char_table): Add %J.
* c-format.c (gcc_diag_char_table): Add %J.
        (gcc_cdiag_char_table, gcc_cxxdiag_char_table): Likewise.
        (check_format_types): Fix wanted_type name lookup.
        (init_dynamic_diag_info): Setup %J.
        * diagnostic.c (text_specifies_location): Implement %J.
        * c-common.c, c-decl.c, c-objc-common.c, c-pragma.c, calls.c,
        dwarfout.c, expr.c, function.c, stmt.c, stor-layout.c, toplev.c,
        tree-inline.c, tree-optimize.c, varasm.c, config/arm/pe.c,
        config/i386/winnt.c, config/ia64/ia64.c, config/mcore/mcore.c,
        config/v850/v850.c, objc/objc-act.c: Use %J in diagnostics.

        * tree-inline.c: Include intl.h
        (inline_forbidden_p_1): Fix i18n of inline_forbidden_reason.
        * Makefile.in (tree-inline.o): Update.
cp/
        * decl.c, decl2.c, pt.c: Use %J in diagnostics.
java/
        * check-init.c, class.c, decl.c, expr.c: Use %J in diagnostics.
testsuite/
        * gcc.dg/format/gcc_diag-1.c: Add tests for %J.

From-SVN: r71619
2003-09-20 22:07:20 -07:00
Richard Henderson f6d1b84aa4 cgraphunit.c (cgraph_assemble_pending_functions): Export.
* cgraphunit.c (cgraph_assemble_pending_functions): Export.
        (cgraph_finalize_function): Revert TREE_ASM_WRITTEN check.
        * cgraph.h: Update.

        * decl2.c (finish_file): Check cgraph_assemble_pending_functions
        during relaxation loop.

From-SVN: r71360
2003-09-13 07:18:47 -07:00
David Edelsohn b44a178ae8 * decl2.c (var_finalized_p): Swap arms of conditional.
From-SVN: r71319
2003-09-11 16:47:13 -04:00