Commit Graph

993 Commits

Author SHA1 Message Date
Julian Brown 711b299844 decl2.c (determine_visibility): Allow target to override visibility of class data.
gcc/cp/
    * decl2.c (determine_visibility): Allow target to override
    visibility of class data.

    gcc/
    * config/arm/arm.c (arm_cxx_determine_class_data_visibility): Make
    no-op for targets which don't use DLLs.

    gcc/testsuite/
    * g++.dg/ext/visibility/arm3.C: Add explanatory text. Skip on
    non-DLL targets.
    * g++.dg/ext/visibility/arm1.C: Skip on non-DLL targets.


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

From-SVN: r137922
2008-07-17 14:03:50 +00:00
Jakub Jelinek b2febff9b7 re PR c++/36662 (vector vs template)
PR c++/36662
	* decl2.c (is_late_template_attribute): If the first attribute
	argument is IDENTIFIER_NODE, don't consider it when checking
	if arguments are value or type dependent.

	* g++.dg/ext/altivec-16.C: New test.

From-SVN: r137287
2008-06-30 22:41:29 +02:00
Jonathan Wakely 37ec60ed2c typeck.c (composite_pointer_type_r, [...]): Change pedwarn to permerror.
* typeck.c (composite_pointer_type_r, cxx_sizeof_expr,
	cxx_alignof_expr, check_template_keyword, cp_build_binary_op,
	pointer_diff, cp_build_unary_op, build_x_compound_expr_from_list,
	build_reinterpret_cast_1, cp_build_c_cast, check_return_expr): Change
	pedwarn to permerror.
	* init.c (perform_member_init, build_new_1, build_new): Likewise.
	* decl.c (warn_extern_redeclared_static, duplicate_decls,
	* identify_goto, check_previous_goto_1, check_goto, define_label,
	check_tag_decl, start_decl, check_class_member_definition_namespace,
	grokfndecl, grokdeclarator): Likewise.
	* except.c (check_handlers): Likewise.
	* typeck2.c (digest_init): Likewise.
	* pt.c (check_specialization_namespace,
	check_explicit_instantiation_namespace,
	maybe_process_partial_specialization, check_explicit_specialization,
	convert_template_argument, do_decl_instantiation,
	do_type_instantiation, instantiate_decl): Likewise.
	* semantics.c (finish_template_type_parm): Likewise.
	* name-lookup.c (pushdecl_maybe_friend,
	check_for_out_of_scope_variable): Likewise.
	* decl2.c (finish_static_data_member_decl, build_anon_union_vars,
	coerce_new_type): Likewise.
	* parser.c (cp_parser_nested_name_specifier_opt,
	cp_parser_mem_initializer, cp_parser_elaborated_type_specifier,
	cp_parser_class_head, cp_parser_check_class_key): Likewise.
	(cp_parser_parameter_declaration): Check flag_permissive instead of
	flag_pedantic_errors.
	* call.c (joust): Change pedwarn to warning.
	* friend.c (make_friend_class): Likewise.

From-SVN: r136999
2008-06-21 11:36:27 +01:00
Simon Martin a6d9bc9dda re PR c++/35320 (ICE with invalid friend declaration)
gcc/cp/

2008-06-14  Simon Martin  <simartin@users.sourceforge.net>

	PR c++/35320
	* decl2.c (grokbitfield): Receive the list of attributes, pass it to
	grokdeclarator and apply it to the created declaration.
	* cp-tree.h (grokbitfield): Update prototype.
	* parser.c (cp_parser_member_declaration): Don't apply the attributes
	since they are now applied in grokbitfield. Adjusted the call to
	grokbitfield.
	(cp_parser_objc_class_ivars): Likewise.

gcc/testsuite/

2008-06-14  Simon Martin  <simartin@users.sourceforge.net>

	PR c++/35320
	* g++.dg/parse/bitfield3.C: New test.

From-SVN: r136778
2008-06-14 05:21:30 +00:00
Jakub Jelinek 5dc1195440 re PR c++/35758 (vector_size attribute lost in function arguments for templates)
PR c++/35758
	* c-common.c (handle_vector_size_attribute): Call
	lang_hooks.types.reconstruct_complex_type instead of
	reconstruct_complex_type.
	* config/rs6000/rs6000.c (rs6000_handle_altivec_attribute): Likewise.
	* config/spu/spu.c (spu_handle_vector_attribute): Likewise.
	* langhooks.h (struct lang_hooks_for_types): Add
	reconstruct_complex_type hook.
	* langhooks-def.h (LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE): Define.
	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Add it.

	* cp-tree.h (cp_reconstruct_complex_type): New prototype.
	* cp-objcp-common.h (LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE): Define.
	* decl2.c (is_late_template_attribute): Only make vector_size
	late tmpl attribute if argument is type or value dependent.
	(cp_reconstruct_complex_type): New function.

	* g++.dg/ext/vector14.C: New test.

From-SVN: r134639
2008-04-24 18:29:40 +02:00
Douglas Gregor 5ade1ed2c0 typeck.c (composite_pointer_type_r): Add SFINAE support.
2008-03-25  Douglas Gregor  <doug.gregor@gmail.com>

       * typeck.c (composite_pointer_type_r): Add SFINAE support.
       (composite_pointer_type): Ditto.
       (common_type): Fix call to composite_pointer_type.
       (cxx_sizeof_nowarn): New; used to be a macro.
       (cxx_sizeof_expr): Add SFINAE support.
       (cxx_alignof_expr): Ditto.
       (decay_conversion): Fix calls for SFINAE support.
       (rationalize_conditional_expr): Add SFINAE support.
       (build_class_member_access_expr): Ditto.
       (finish_class_member_access_expr): Ditto.
       (build_x_indirect_ref): Ditto.
       (build_indirect_ref): Original version renamed to
       cp_build_indirect_ref; new version provides a bridge from
       c-common.
       (cp_build_indirect_ref): Was build_indirect_ref; added SFINAE
       support.
       (get_member_function_from_ptrfunc): Fix calls for SFINAE support.
       (build_function_call): Original version renamed to
       cp_build_function_call; new version provides a bridge from
       c-common.
       (cp_build_function_call): Was build_function_call; added SFINAE
       support.
       (convert_arguments): Add SFINAE support.
       (build_x_binary_op): Ditto.
       (build_binary_op): Original version renamed to cp_build_binary_op;
       new version provides a bridge from c-common.
       (cp_build_binary_op): Was build_binary_op; added SFINAE support.
       (pointer_diff): Fix calls for SFINAE.
       (build_x_unary_op): Add SFINAE support.
       (condition_conversion): Fix calls for SFINAE.
       (build_unary_op): Original version renamed to cp_build_unary_op;
       new version provides a bridge from c-common.
       (cp_build_unary_op): Was build_unary_op; added SFINAE support.
       (unary_complex_lvalue): Fix calls for SFINAE.
       (build_x_conditional_expr): Add SFINAE support.
       (build_x_compound_expr_from_list): Fix calls for SFINAE.
       (build_x_compound_expr): Add SFINAE support.
       (convert_ptrmem): Fix calls for SFINAE.
       (build_static_cast_1): Add SFINAE support.
       (build_static_cast): Ditto.
       (build_reinterpret_cast_1): Ditto.
       (build_reinterpret_cast): Ditto.
       (build_const_cast_1): Ditto.
       (build_const_cast): Ditto.
       (build_c_cast): Ditto.
       (build_modify_expr): Original version renamed to
       cp_build_modify_expr; new version provides a bridge from c-common.
       (cp_build_modify_expr): Was build_modify_expr; added SFINAE
       support.
       (build_x_modify_expr): Add SFINAE support.
       (build_ptrmemfunc): Fix calls for SFINAE.
       (convert_for_assignment): Add SFINAE support.
       (convert_for_initialization): Ditto.
       (check_return_expr): Fix calls for SFINAE.
       (lvalue_or_else): Add SFINAE support.
       * init.c (perform_member_init): Fix calls for SFINAE.
       (emit_mem_initializers): Ditto.
       (expand_virtual_init): Ditto.
       (expand_cleanup_for_base): Ditto.
       (build_aggr_init): Add SFINAE support.
       (expand_default_init): Ditto.
       (expand_aggr_init_1): Fix calls for SFINAE.
       (build_offset_ref): Ditto.
       (build_new_1): Add SFINAE support.
       (build_new): Ditto.
       (build_vec_delete_1): Fix calls for SFINAE.
       (get_temp_regvar): Ditto.
       (build_vec_init): Add SFINAE support.
       (build_dtor_call): Fix calls for SFINAE.
       (build_delete): Ditto.
       (push_base_cleanups): Ditto.
       (build_vec_delete_1): Ditto.
       * class.c (build_base_path): Fix calls for SFINAE.
       (build_simple_base_path): Ditto.
       (convert_to_base_statically): Ditto.
       (build_vfn_ref): Ditto.
       (resolve_address_of_overloaded_function): Ditto.
       * decl.c (check_initializer): Fix calls for SFINAE.
       (register_dtor_fn): Ditto.
       (compute_array_index_type): Ditto.
       (finish_enum): Ditto.
       (start_preparsed_function): Ditto.
       (cxx_maybe_build_cleanup): Ditto.
       * call.c (convert_like): Add COMPLAIN argument.
       (convert_like_with_context): Ditto.
       (build_this): Fix calls for SFINAE.
       (build_user_type_conversion): Ditto.
       (resolve_args): Ditto.
       (build_new_function_call): Add SFINAE support.
       (build_operator_new_call): Fix calls for SFINAE.
       (build_object_call): Add SFINAE support.
       (build_conditional_expr): Ditto.
       (build_new_op): Ditto.
       (build_op_delete_call): Fix calls for SFINAE.
       (build_temp): Ditto.
       (convert_like_real): Add SFINAE support.
       (build_x_va_arg): Fix calls for SFINAE.
       (convert_default_arg): Ditto.
       (build_over_call): Add SFINAE support.
       (build_java_interface_fn_ref): Fix calls for SFINAE.
       (build_special_member_call): Add SFINAE support.
       (build_new_method_call): Ditto.
       (perform_implicit_conversion): Ditto.
       (perform_direct_initialization_if_possible): Ditto.
       (initialize_reference): Fix calls for SFINAE.
       * method.c (do_build_assign_ref): Fix calls for SFINAE.
       * rtti.c (build_headof): Fix calls for SFINAE.
       (get_tinfo_decl_dynamic): Ditto.
       (get_typeid): Ditto.
       (build_dynamic_cast_1): Add SFINAE support.
       (build_dynamic_cast): Ditto.
       (tinfo_base_init): Fix calls for SFINAE.
       * except.c (do_get_exception_ptr): Fix calls for SFINAE.
       (do_end_catch): Ditto.
       (initialize_handler_parm): Ditto.
       (expand_start_catch_block): Ditto.
       (do_allocate_exception): Ditto.
       (do_free_exception): Ditto.
       (build_throw): Ditto.
       * cvt.c (build_up_reference): Fix calls for SFINAE.
       (convert_to_reference): Ditto.
       (ocp_convert): Ditto.
       (convert_to_void): Add SFINAE support.
       * tree.c (build_dummy_object): Fix calls for SFINAE.
       (stabilize_expr): Ditto.
       * cp-tree.h (build_conditional_expr): Add tsubst_flags_t
       parameter.
       (build_new_method_call): Ditto.
       (build_special_member_call): Ditto.
       (build_new_op): Ditto.
       (perform_implicit_conversion): Ditto.
       (perform_direct_initialization_if_possible): Ditto.
       (convert_to_void): Ditto.
       (build_aggr_init): Ditto.
       (build_new): Ditto.
       (build_vec_init): Ditto.
       (build_dynamic_cast): Ditto.
       (finish_call_expr): Ditto
       (cxx_sizeof_or_alignof_expr): Add COMPLAIN parameter.
       (cxx_sizeof_nowarn): Remove macro; add function declaration.
       (build_class_member_access_expr): Add tsubst_flags_t parameter.
       (finish_class_member_access_expr): Ditto.
       (build_x_indirect_ref): Ditto.
       (cp_build_indirect_ref): New.
       (cp_build_function_call): Add tsubst_flags_t parameter.
       (build_x_unary_op): Ditto.
       (cp_build_unary_op): New.
       (build_x_conditional_expr): Add tsubst_flags_t parameter.
       (build_x_compound_expr): Ditto.
       (build_compound_expr): Ditto.
       (build_static_cast): Ditto.
       (build_reinterpret_cast): Ditto.
       (build_const_cast): Ditto.
       (build_c_cast): Ditto.
       (build_x_modify_expr): Ditto.
       (cp_build_modify_expr): New.
       (convert_for_initialization): Add tsubst_flags_t parameter.
       (cp_build_binary_op): Remove macro; add function declaration.
       (invalid_nonstatic_memfn_p): Add tsubst_flags_t parameter.
       (lvalue_or_else): Ditto.
       (build_functional_cast): Ditto.
       * typeck2.c (digest_init): Fix calls for SFINAE.
       (process_init_constructor_array): Ditto.
       (process_init_constructor_record): Ditto.
       (build_x_arrow): Ditto.
       (build_m_component_ref): Ditto.
       (build_functional_cast): Add SFINAE support.
       * pt.c (tsubst_copy_and_build): Add (more) SFINAE support.
       * semantics.c (simplify_loop_decl_cond): Fix calls for SFINAE.
       (finish_expr_stmt): Ditto.
       (finish_for_expr): Ditto.
       (finish_asm_stmt): Ditto.
       (finish_non_static_data_member): Ditto.
       (finish_qualified_id_expr): Ditto.
       (finish_call_expr): Add SFINAE support.
       (finish_increment_expr): Fix calls for SFINAE.
       (finish_unary_op_expr): Ditto.
       (simplify_aggr_init_expr): Ditto.
       (finish_omp_clauses): Ditto.
       (finish_omp_for): Ditto.
       (finish_omp_barrier): Ditto.
       (finish_omo_flush): Ditto.
       * decl2.c (grok_array_decl): Fix calls or SFINAE.
       (build_anon_union_vars): Ditto.
       (get_guard_cond): Ditto.
       (set_guard): Ditto.
       (one_static_initialization_or_destruction): Ditto.
       (do_static_initialization_or_destruction): Ditto.
       (generate_ctor_or_dtor_function): Ditto.
       (build_offset_ref_call_from_tree): Ditto.
       * parser.c (cp_parser_postfix_expression): Fix calls for SFINAE.
       (cp_parser_postfix_dot_deref_expression): Ditto.
       (cp_parser_unary_expression): Ditto.
       (cp_parser_new_expression): Ditto.
       (cp_parser_cast_expression): Ditto.
       (cp_parser_binary_expression): Ditto.
       (cp_parser_question_colon_clause): Ditto.
       (cp_parser_assignment_expression): Ditto.
       (cp_parser_expression): Ditto.
       (cp_parser_builtin_offsetof): Ditto.
       (cp_parser_template_argument): Ditto.
       (cp_parser_functional_cast): Ditto.

2008-03-25  Douglas Gregor  <doug.gregor@gmail.com>

       * c-common.c (c_sizeof_or_alignof_type): If we're not allowed to
       complain when we hit an error, return ERROR_MARK_NODE.

2008-03-25  Douglas Gregor  <doug.gregor@gmail.com>

       * g++.dg/template/sfinae4.C: New.
       * g++.dg/template/sfinae5.C: New.
       * g++.dg/template/sfinae6.C: New.
       * g++.dg/template/sfinae6_neg.C: New.
       * g++.dg/template/sfinae7.C: New.
       * g++.dg/template/sfinae8.C: New.
       * g++.dg/template/sfinae9.C: New.
       * g++.dg/template/sfinae10.C: New.
       * g++.dg/template/sfinae11.C: New.
       * g++.dg/template/sfinae12.C: New.
       * g++.dg/template/sfinae13.C: New.
       * g++.dg/template/sfinae14C: New.

From-SVN: r133519
2008-03-25 13:53:58 +00:00
Paolo Carlini 9e1e64ec2b cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P.
2008-03-21  Paolo Carlini  <pcarlini@suse.de>

	* cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P.
	(SET_IS_AGGR_TYPE): Rename to SET_CLASS_TYPE_P.
	(IS_AGGR_TYPE_CODE): Rename to RECORD_OR_UNION_CODE_P.
	(PROMOTES_TO_AGGR_TYPE): Remove.
	(CLASS_TYPE_P, TYPE_NON_AGGREGATE_CLASS): Adjust.
	* typeck.c (unary_complex_lvalue, build_modify_expr,
	convert_for_initialization): Adjust.
	* init.c (is_aggr_type): Remove.
	(is_class_type): Add.
	(build_offset_ref, build_new_1, build_vec_delete_1, build_vec_init,
	build_delete): Adjust.
	* lex.c (make_aggr_type): Remove.
	(make_class_type): Add.
	(cxx_make_type): Adjust.
	* class.c (finish_struct_1, fixed_type_or_null, is_empty_class):
	Adjust.
	* decl.c (build_typename_type, make_typename_type,
	make_unbound_class_template, cxx_init_decl_processing,
	check_tag_decl, groktypename, start_decl_1, layout_var_decl,
	check_initializer, cp_finish_decl, build_ptrmemfunc_type, grokparms,
	grok_op_properties, xref_tag, check_function_type): Adjust.
	* call.c (check_dtor_name, standard_conversion, implicit_conversion,
	add_builtin_candidate, add_builtin_candidates,
	build_user_type_conversion_1, convert_like_real, build_cxx_call,
	is_subseq, compare_ics): Adjust.
	* method.c (use_thunk): Adjust.
	* rtti.c (build_dynamic_cast_1, create_pseudo_type_info,
	create_tinfo_types): Adjust.
	* cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
	build_up_reference, convert_to_reference, convert_from_reference,
	ocp_convert, build_expr_type_conversion): Adjust.
	* tree.c (bind_template_template_parm, error_type): Adjust.
	* dump.c (cp_dump_tree): Adjust.
	* search.c (lookup_member): Adjust.
	* friend.c (make_friend_class, do_friend): Adjust.
	* typeck2.c (store_init_value, process_init_constructor_array,
	process_init_constructor_record, build_x_arrow, build_m_component_ref,
	build_functional_cast): Adjust.
	* pt.c (finish_member_template_decl, process_template_parm,
	lookup_template_class, tsubst_function_type, tsubst,
	tsubst_copy_and_build, get_template_base, bt_instantiate_type_proc):
	Adjust.
	* semantics.c (begin_class_definition, finish_base_specifier,
	finish_typeof, cxx_omp_predetermined_sharing, finish_decltype_type):
	Adjust.
	* name-lookup.c (constructor_name_p, push_overloaded_decl,
	do_class_using_decl, lookup_qualified_name,
	maybe_process_template_type_declaration): Adjust.
	* decl2.c (grok_array_decl, check_member_template,
	constrain_class_visibility): Adjust.
	* parser.c (cp_parser_class_name): Adjust.

From-SVN: r133434
2008-03-21 18:56:51 +00:00
Tom Tromey 2d593c86cf system.h (USE_MAPPED_LOCATION): Poison.
gcc
	* system.h (USE_MAPPED_LOCATION): Poison.
	* Makefile.in (GTFILES): Put CPP_ID_DATA_H first.
	* tree-cfg.c (make_cond_expr_edges): Remove old location code.
	(make_goto_expr_edges): Likewise.
	(remove_bb): Likewise.
	(execute_warn_function_return): Likewise.
	* basic-block.h (struct edge_def) <goto_locus>: Change type to
	location_t.
	* c-common.c (fname_decl): Remove old location code.
	* tree-vect-transform.c (vect_finish_stmt_generation): Remove old
	location code.
	* rtl.h (ASM_OPERANDS_SOURCE_LOCATION): Remove old-location
	variant.
	(ASM_INPUT_SOURCE_LOCATION): Likewise.
	(gen_rtx_ASM_INPUT): Likewise.
	(gen_rtx_ASM_INPUT_loc): Likewise.
	(get_rtx_asm_OPERANDS): Remove.
	* cfglayout.c (insn_locators_alloc): Remove old location code.
	(set_curr_insn_source_location): Likewise.
	(curr_insn_locator): Likewise.
	* print-tree.c (print_node): Remove old location code.
	* tree-mudflap.c (mf_varname_tree): Remove old location code.
	(mf_file_function_line_tree): Remove test of USE_MAPPED_LOCATION.
	* cfgexpand.c (expand_gimple_cond_expr): Don't use
	location_from_locus.
	(construct_exit_block): Remove old location code.
	* emit-rtl.c (force_next_line_note): Remove old location code.
	* profile.c (branch_prob): Remove old location code.
	* tree-vectorizer.h (LOC, UNKNOWN_LOC, EXPR_LOC, LOC_FILE,
	LOC_LINE): Remove old-location variants.
	* langhooks.c (lhd_print_error_function): Remove old location
	code.
	* configure, config.in: Rebuilt.
	* configure.ac (--enable-mapped-location): Remove.
	* c-decl.c (c_init_decl_processing): Remove old location code.
	(finish_function): Likewise.
	* recog.c (decode_asm_operands): Remove old location code.
	* c-pch.c (c_common_read_pch): Remove old location code.
	* rtl.def (ASM_INPUT, ASM_OPERANDS): Remove old location
	variants.
	* gimple-low.c (lower_function_body): Remove old location code.
	* toplev.c (unknown_location): Remove.
	(push_srcloc): Remove old-location variant.
	(process_options): Remove old location code.
	(lang_dependent_init): Likewise.
	* input.h (UNKNOWN_LOCATION): Move definition.
	(location_t): Undeprecate.
	(source_locus): Remove.
	(location_from_locus): Remove.
	(struct location_s): Remove.
	Remove all old-location code.
	(input_line, input_filename): Remove.
	* final.c (final_scan_insn): Remove old location code.
	* diagnostic.c (diagnostic_build_prefix): Remove
	USE_MAPPED_LOCATION test.
	* tree.h (gimple_stmt) <locus>: Now a location_t.
	(tree_exp) <locus>: Likewise.
	(DECL_IS_BUILTIN): Remove old-location variant.
	(annotate_with_file_line, annotate_with_locus): Likewise.
	(expr_locus, set_expr_locus): Update.
	* tree.c (build1_stat): Remove old location code.
	(last_annotated_node): Remove.
	(annotate_with_file_line): Remove old-location variant.
	(annotate_with_locus): Likewise.
	(expr_location): Remove old location code.
	(set_expr_location): Likewise.
	(expr_has_location): Likewise.
	(expr_locus): Likewise.
	(set_expr_locus): Likewise.
	(expr_filename): Don't use location_from_locus.
	(expr_lineno): Likewise.
	* rtl-error.c (location_for_asm): Remove old location code.
	* c-lex.c (cb_line_change): Remove old location code.
	(fe_file_change): Likewise.
	(cb_def_pragma): Likewise.
	(c_lex_with_flags): Likewise.
	* gengtype.c (do_typedef): Don't special-case location types.
	(define_location_structures): Remove.
	(main): Don't call define_location_structures.
	* tree-pretty-print.c (dump_implicit_edges): Remove old location
	code.
gcc/ada
	* misc.c (internal_error_function): Remove test of
	USE_MAPPED_LOCATION.
	* trans.c (gigi): Remove test of USE_MAPPED_LOCATION.
	(Sloc_to_locus): Remove old location code.
gcc/cp
	* parser.c (eof_token): Remove old location code.
	(check_empty_body): Remove test of USE_MAPPED_LOCATION.
	* decl2.c (generate_ctor_or_dtor_function): Remove old location
	code.
	(cp_write_global_declarations): Likewise.
	* lex.c (cxx_init): Remove old location code.
	(handle_pragma_implementation): Remove test of
	USE_MAPPED_LOCATION.
	* pt.c (tsubst): Remove old location code.
	* error.c (cp_print_error_function): Remove test of
	USE_MAPPED_LOCATION.
	* decl.c (pop_label): Remove old location code.
	(finish_function): Likewise.
gcc/fortran
	* trans-io.c (set_error_locus): Remove old location code.
	* trans-decl.c (gfc_set_decl_location): Remove old location code.
	* f95-lang.c (gfc_init): Remove test of USE_MAPPED_LOCATION.
	* scanner.c (gfc_gobble_whitespace): Remove old location code.
	(get_file): Likewise.
	(preprocessor_line): Likewise.
	(load_file): Likewise.
	(gfc_new_file): Likewise.
	* trans.c (gfc_trans_runtime_check): Remove old location code.
	(gfc_get_backend_locus): Likewise.
	(gfc_set_backend_locus): Likewise.
	* data.c (gfc_assign_data_value): Remove old location code.
	* error.c (show_locus): Remove old location code.
	* gfortran.h (gfc_linebuf): Remove old location code.
	(gfc_linebuf_linenum): Remove old-location variant.
gcc/java
	* lang.c (java_post_options): Remove conditional.
	* expr.c (expand_byte_code): Remove old location code.
	* jcf-parse.c (set_source_filename): Remove old location code.
	(give_name_to_class): Likewise.
	(jcf_parse): Likewise.
	(duplicate_class_warning): Likewise.
	(parse_class_file): Likewise.
	(java_parse_file): Likewise.
	* decl.c (finish_method): Remove old location code.
	* class.c (push_class): Remove old location code.
gcc/objc
	* objc-act.c (objc_init): Remove old location code.
gcc/treelang
	* tree1.c (treelang_init): Remove old location code.
	(treelang_parse_file): Likewise.
	* lex.l (LINEMAP_POSITION_FOR_COLUMN): Remove.
	(update_lineno_charno): Remove old location code.

From-SVN: r132679
2008-02-26 16:05:24 +00:00
Jason Merrill 8d2eb30433 PR c++/34962, c++/34937, c++/34939
PR c++/34962, c++/34937, c++/34939
        * decl2.c (is_late_template_attribute): Always defer attributes
        vector_size and weak.

From-SVN: r132297
2008-02-13 16:27:16 -05:00
Jason Merrill 6c5613b043 re PR c++/34094 (Undefined static data member in anonymous namespace can acquire a definition anyway)
PR c++/34094
        * decl2.c (cp_write_global_declarations): Don't write out static
        data members with DECL_IN_AGGR_P set.

From-SVN: r132218
2008-02-10 13:12:01 -05:00
Douglas Gregor 1db54f4e49 re PR c++/35074 (ICE with attribute "aligned" for template classes)
2008-02-05  Douglas Gregor  <doug.gregor@gmail.com>

	PR c++/35074
	* decl2.c (save_template_attributes): When we're modifying the
	TYPE_MAIN_VARIANT to add new attributes, be sure to also modify
	all of the other variants to add those same attributes. Otherwise,
	the main variant will be inconsistent with those other variants.
	
2008-02-05  Douglas Gregor  <doug.gregor@gmail.com>

	PR c++/35074
	* g++.dg/ext/attrib30.C: New.

From-SVN: r132120
2008-02-05 13:29:43 +00:00
Douglas Gregor 7b3e2d465d re PR c++/34055 (ICE with invalid specialization of variadic template)
2008-01-29  Douglas Gregor  <doug.gregor@gmail.com>

	PR c++/34055
	PR c++/34103
	PR c++/34219
	PR c++/34606
	PR c++/34753
	PR c++/34754
	PR c++/34755
	PR c++/34919
	PR c++/34961
	* c-pretty-print.c (pp_c_type_qualifier_list): Don't try to print
	qualifiers for an ERROR_MARK_NODE or a NULL_TREE.


2008-01-29  Douglas Gregor  <doug.gregor@gmail.com>

	PR c++/34055
	PR c++/34103
	PR c++/34219
	PR c++/34606
	PR c++/34753
	PR c++/34754
	PR c++/34755
	PR c++/34919
	PR c++/34961
	* typeck.c (check_return_expr): Tweak call to
	check_for_bare_parameter_packs.
	* class.c (add_method): Be careful with error_mark_nodes.
	* cp-tree.h (check_for_bare_parameter_packs): Remove "*" from
	signature.
	* pt.c (struct find_parameter_pack_data): Remove
	SET_PACKS_TO_ERROR.
	(find_parameter_packs_r): Don't use SET_PACKS_TO_ERROR.
	(uses_parameter_packs): Don't set SET_PACKS_TO_ERROR.
	(make_pack_expansion): Ditto.
	(check_for_bare_parameter_packs): Parameter is now a tree, not a
	tree*.
	(process_template_parm): Tweak call to
	check_for_bare_parameter_packs.  
	(push_template_decl_real): Tweak calls to
	check_for_bare_parameter_packs. If bare parameter packs are found
	in the list of exceptions, clear out that list after giving an
	error.
	* semantics.c (finish_cond): Tweak call to
	check_for_bare_parameter_packs.
	(finish_expr_stmt): Ditto.
	(finish_for_expr): Ditto.
	(finish_switch_cond): Ditto.
	(finish_mem_initializers): Ditto.
	(finish_member_declaration): Ditto.
	(finish_static_assert): Check for bare parameter packs in the
	condition.
	* decl2.c (cplus_decl_attributes): Check for bare parameter packs in the
	attributes of a declaration.
	* parser.c (cp_parser_using_declaration): Tweak call to
	check_for_bare_parameter_packs.
	(cp_parser_base_clause): Ditto.
	

2008-01-29  Douglas Gregor  <doug.gregor@gmail.com>

	PR c++/34055
	PR c++/34103
	PR c++/34219
	PR c++/34606
	PR c++/34753
	PR c++/34754
	PR c++/34755
	PR c++/34919
	PR c++/34961
	* g++.dg/cpp0x/vt-34219-2.C: New.
	* g++.dg/cpp0x/pr32126.C: Tweak expected error messages.
	* g++.dg/cpp0x/vt-34961.C: New.
	* g++.dg/cpp0x/vt-34055.C: Tweak error messages; add new test
	cases from the re-opened PR.
	* g++.dg/cpp0x/vt-34753.C: New.
	* g++.dg/cpp0x/vt-34919.C: New.
	* g++.dg/cpp0x/vt-34754.C: New.
	* g++.dg/cpp0x/vt-34606.C: New.
	* g++.dg/cpp0x/vt-34219.C: New.
	* g++.dg/cpp0x/pr32125.C: Tweak expected error messages.
	* g++.dg/cpp0x/vt-34755.C: New.
	* g++.dg/cpp0x/pr31438.C: Ditto.
	* g++.dg/cpp0x/variadic81.C: Ditto.

From-SVN: r131938
2008-01-29 13:59:59 +00:00
Jason Merrill 1d555e2632 decl2.c (is_late_template_attribute): Don't defer attribute visibility just because the type is dependent.
* decl2.c (is_late_template_attribute): Don't defer attribute
        visibility just because the type is dependent.

From-SVN: r131833
2008-01-25 14:47:28 -05:00
Jason Merrill 160b8b8014 re PR c++/34913 (ICE vector in template)
PR c++/34913
        * decl2.c (is_late_template_attribute): Defer any attribute with
        dependent args.  Also defer type attributes if the type is dependent.

From-SVN: r131779
2008-01-24 09:41:32 -05:00
Jakub Jelinek 5b767b9d0c re PR c++/34238 ("static data member used, but not defined" error on member definition)
PR c++/34238
	* decl2.c (cp_write_global_declarations): Revert 2007-11-22 change.

	* g++.dg/ext/visibility/anon7.C: Add xfail.
	* g++.dg/ext/visibility/anon9.C: New test.
	* g++.dg/ext/visibility/anon10.C: New test.

From-SVN: r130771
2007-12-11 09:22:10 +01:00
Jakub Jelinek 23372b3faa re PR c++/34178 (Compilation using -frepo fails)
PR c++/34178
	PR c++/34340
	* repo.c (repo_emit_p): Return 2 for DECL_INTEGRAL_CONSTANT_VAR_P
	in class scope rather than DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
	Return 2 also if DECL_EXPLICIT_INSTANTIATION.
	* decl2.c (import_export_decl): Don't make VAR_DECLs import_p when
	flag_use_repository and repo_emit_p returned 2.

	* g++.dg/template/repo6.C: New test.
	* g++.dg/template/repo7.C: New test.
	* g++.dg/template/repo8.C: New test.

From-SVN: r130727
2007-12-09 22:26:29 +01:00
Jakub Jelinek 6d1f904c2e re PR c++/34094 (Undefined static data member in anonymous namespace can acquire a definition anyway)
PR c++/34094
	* decl2.c (cp_write_global_declarations): Issue error about static
	data members in anonymous namespace which are declared and used,
	but not defined.

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

From-SVN: r130351
2007-11-22 15:06:06 +01:00
H.J. Lu 565603f84a re PR c++/33871 (typeinfo name referenced in ... defined in discarded section)
2007-11-05  H.J. Lu  <hongjiu.lu@intel.com>

	PR c++/33871
	* decl2.c (constrain_visibility): Clear DECL_ONE_ONLY if marked
	local.

From-SVN: r129911
2007-11-05 15:11:57 -08:00
Diego Novillo c4e622b658 langhooks.h (struct lang_hooks_for_callgraph): Remove third argument from function pointer ANALYZE_EXPR.
* langhooks.h (struct lang_hooks_for_callgraph): Remove third
	argument from function pointer ANALYZE_EXPR.  Update all
	users.
	* cgraph.c (debug_cgraph_node): New.
	(debug_cgraph): New.

From-SVN: r129845
2007-11-02 07:12:30 -04:00
Jakub Jelinek 4c38e99eb4 re PR c++/33616 ("lvalue required as unary '&' operand" with template pmf)
PR c++/33616
	* decl2.c (build_offset_ref_call_from_tree): Call
	build_non_dependent_expr on object prior to building ADDR_EXPR from it
	if FN is DOTSTAR_EXPR.

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

From-SVN: r129784
2007-10-30 23:37:53 +01:00
Paolo Carlini 07021f8c63 re PR c++/31988 (new operator should not permit default first parameter)
cp/
2007-10-26  Paolo Carlini  <pcarlini@suse.de>

	PR c++/31988
	* decl2.c (coerce_new_type): Do not allow a default argument for
	the first parameter.

testsuite/
2007-10-26  Paolo Carlini  <pcarlini@suse.de>

	PR c++/31988
	* g++.dg/init/new25.C: New.

From-SVN: r129657
2007-10-26 18:32:41 +00:00
Jason Merrill dc472c59a5 re PR c++/33094 (ICE on valid C++ virtual template static member in anonymous namespace)
PR c++/33094
        * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member
        constant to not have DECL_EXTERNAL if it's file-local.

From-SVN: r128890
2007-09-29 22:41:39 -04:00
Jason Merrill 533007c1e9 decl2.c (is_late_template_attribute): Don't crash on unknown attribute.
* decl2.c (is_late_template_attribute): Don't crash on unknown
        attribute.

From-SVN: r128844
2007-09-27 14:54:06 -04:00
Jason Merrill a7f6bc8c74 re PR c++/19407 (vector keyword in typedef inside template struct ignored)
PR c++/19407
        * cp/cp-tree.h (ATTR_IS_DEPENDENT): New macro.
        (MAYBE_TAGGED_TYPE_P): Remove.
        * cp/pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
        instead of calling is_late_template_attribute again.
        (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
        (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
        Don't crash on typedefs from non-template classes.
        * cp/decl2.c (grokfield): Don't sorry about attrs on template parms.
        (is_late_template_attribute): All attributes applied to template
        parms or typename types are dependent.  Static, take decl.
        (splice_template_attributes): Pass decl through.
        (save_template_attributes): Likewise.
        * attribs.c (lookup_attribute_spec): Split out...
        (decl_attributes): From here.
        * tree.h: Declare it.

From-SVN: r128681
2007-09-22 22:36:34 -04:00
Jason Merrill 5044ab0e64 re PR c++/17743 (dependent expressions in attributes)
PR c++/17743
        * pt.c (apply_late_template_attributes): Set processing_template_decl.
        (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
        ATTR_FLAG_TYPE_IN_PLACE.
        (tsubst): Do unqualified lookup to find typedefs from current class.
        [ARRAY_TYPE]: Propagate alignment info.
        * decl2.c (is_late_template_attribute): Only defer handling of
        attribute aligned if the expression is dependent.
        (save_template_attributes): If we're deferring any attributes,
        make this a naming typedef.

From-SVN: r128590
2007-09-18 18:50:03 -04:00
Jason Merrill 4f4141ffe2 PR c++/17743, c++/19163
PR c++/17743, c++/19163
        * decl2.c (is_late_template_attribute): New fn.
        (splice_template_attributes, save_template_attributes): New fns.
        (cplus_decl_attributes): Call save_template_attributes.
        * pt.c (apply_late_template_attributes): New fn.
        (instantiate_class_template, tsubst_decl): Use it.
        * cp-tree.h: Declare is_late_template_attribute.

From-SVN: r128488
2007-09-14 02:07:25 -04:00
Jason Merrill 3fd406847c * decl2.c (get_guard): Copy visibility from the guarded variable.
From-SVN: r128226
2007-09-06 23:56:41 -04:00
Jason Merrill 6117220672 re PR c++/29365 (Unnecessary anonymous namespace warnings)
PR c++/29365
        * pt.c (outermost_tinst_level): New function.
        * lex.c (in_main_input_context): New function.
        * decl2.c (constrain_class_visibility): Use it to avoid warning
        about uses of the anonymous namespace in the main input file.

From-SVN: r127711
2007-08-22 13:23:37 -04:00
Richard Guenther 145881069e tree.c (WALK_SUBTREE): Call walk_tree_1.
2007-08-20  Richard Guenther  <rguenther@suse.de>

	* tree.c (WALK_SUBTREE): Call walk_tree_1.
	(walk_type_fields): Take lh parameter.
	(walk_tree): Rename to ...
	(walk_tree_1): ... this.  Do not call the walk_subtrees
	langhook but the now passed callback.  Pass lh on recursion.
	(walk_tree_without_duplicates): Rename to ...
	(walk_tree_without_duplicates_1): ... this.  Take lh parameter
	and call walk_tree_1.
	* tree.h (walk_tree_lh): New typedef.
	(walk_tree_1): Declare.
	(walk_tree_without_duplicates_1): Likewise.
	(walk_tree): New define to walk_tree_1 with NULL lh parameter.
	(walk_tree_without_duplicates): New define to
	walk_tree_without_duplicates_1 with NULL lh parameter.
	* langhooks.c (lhd_tree_inlining_walk_subtrees): Remove.
	* langhooks.h (lang_hooks_for_tree_inlining): Remove walk_subtrees
	langhook.
	* langhooks-def.h (lhd_tree_inlining_walk_subtrees): Remove.
	(LANG_HOOKS_TREE_INLINING_WALK_SUBTREES): Likewise.
	(LANG_HOOKS_TREE_INLINING_INITIALIZER): Remove walk_subtrees
	initializer.

	java/
	* lang.c (java_tree_inlining_walk_subtrees): Remove.
	(LANG_HOOKS_TREE_INLINING_WALK_SUBTREES): Remove.

	cp/
	* cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
	Remove define.
	* tree.h (cp_walk_tree): New define to walk_tree_1 with
	cp_walk_subtrees lh parameter.
	(cp_walk_tree_without_duplicates): New define to
	walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
	* tree.c (count_trees): Call
	cp_walk_tree_without_duplicates.
	(verify_stmt_tree): Call cp_walk_tree.
	(break_out_target_exprs): Likewise.
	(WALK_SUBTREE): Likewise.
	* cp-gimplify.c (cp_genericize): Likewise.
	* cp-pt.c (find_parameter_packs_r): Likewise.
	(uses_parameter_packs): Likewise.
	(make_pack_expansion): Likewise.
	(check_for_bare_parameter_packs): Likewise.
	(for_each_template_parm): Likewise.
	* decl.c (check_default_argument): Call
	cp_walk_tree_without_duplicates.
	* except.c (build_throw): Likewise.
	* decl2.c (type_visibility): Likewise.
	* semantics.c (expand_or_defer_fn): Likewise.
	(finalize_nrv): Call cp_walk_tree.

From-SVN: r127642
2007-08-20 11:19:22 +00:00
Paolo Carlini f8c3b097ed re PR c++/27211 (Bogus error "template definition of non-template" when there is no non-template)
/cp
2007-08-14  Paolo Carlini  <pcarlini@suse.de>

	PR c++/27211
	* decl2.c (check_classfn): Return error_mark_node in case of error;
	in that case, do not call add_method.
	* decl.c (start_decl): Deal with check_classfn returning
	error_mark_node.
	(grokfndecl): Likewise.
	* pt.c (tsubst_friend_function): Likewise.

/testsuite
2007-08-14  Paolo Carlini  <pcarlini@suse.de>

	PR c++/27211
	* g++.dg/template/error27.C: New.
	* g++.dg/template/error28.C: New.
	* g++.dg/other/pr28304.C: Adjust.
	* g++.old-deja/g++.mike/p811.C: Likewise.

From-SVN: r127492
2007-08-14 22:07:31 +00:00
Nick Clifton e77f031de8 typeck.c: Change copyright header to refer to version 3 of the GNU General Public...
* typeck.c: Change copyright header to refer to version 3 of the GNU General 
  Public License and to point readers at the COPYING3 file and the FSF's license
  web page.
* optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c, config-lang.in, 
  cp-tree.def, call.c, decl.h, ptree.c, Make-lang.in, method.c, rtti.c, 
  cp-objcp-common.c, g++spec.c, cp-objcp-common.h, except.c, error.c, 
  operators.def, cvt.c, tree.c, mangle.c, cp-tree.h, dump.c, search.c, 
  friend.c, expr.c, cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, 
  pt.c, cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
  name-lookup.h, parser.c: Likewise.

From-SVN: r127154
2007-08-02 10:36:13 +00:00
Geoffrey Keating ddbfd28de9 Index: gcc/ChangeLog
2007-06-21  Geoffrey Keating  <geoffk@apple.com>

	* doc/invoke.texi (C++ Dialect Options): Document
	fvisibility-ms-compat.
	* c.opt (fvisibility-ms-compat): New.

Index: gcc/cp/ChangeLog
2007-06-21  Geoffrey Keating  <geoffk@apple.com>

	* decl2.c (determine_visibility): Implement
	flag_visibility_ms_compat effect on type info.
	* decl.c (cxx_init_decl_processing): Implement
	global effect of flag_visibility_ms_compat.

Index: gcc/testsuite/ChangeLog
2007-06-26  Geoffrey Keating  <geoffk@apple.com>

	* g++.dg/ext/visibility/ms-compat-1.C: New.

From-SVN: r126088
2007-06-28 19:31:45 +00:00
Geoffrey Keating 32d4913401 decl2.c (start_objects): Mark constructor-runnning function as artificial.
* decl2.c (start_objects): Mark constructor-runnning function
	as artificial.

From-SVN: r126080
2007-06-28 18:31:53 +00:00
Mark Mitchell 3a687f8bbb extend.texi: Document that dllimport and dllexport imply default visibility.
2007-06-23  Mark Mitchell  <mark@codesourcery.com>

	* doc/extend.texi: Document that dllimport and dllexport imply
	default visibility.
	* tree.c (handle_dll_attribute): Set DECL_VISIBILITY on the
	imported or exported declaration, including type declarations.
	* c-common.c (handle_visibility_attribute): Check for conflicts
	with dllimport/dllexport.
	(c_determine_visibility): Handle dllimport/dllexport as an
	explicit visibility atttribute.

2007-06-23  Mark Mitchell  <mark@codesourcery.com>

	* decl2.c (determine_visibility): Don't look for dllexport here.
	(determine_visibility_from_class): Tidy.

2007-06-23  Mark Mitchell  <mark@codesourcery.com>

	* gcc.dg/visibility-12.c: New test.
	* gcc.dg/visibility-13.c: Likewise.
	* g++.dg/ext/visibility-9.C: Likewise.
	* g++.dg/ext/visibility-10.C: Likewise.

From-SVN: r125975
2007-06-23 19:17:04 +00:00
Mark Mitchell 555551c24b cp-tree.h (DECL_VAR_MARKED_P): Remove.
* cp-tree.h (DECL_VAR_MARKED_P): Remove.
	(DECL_ANON_UNION_VAR_P): New macro.
	* class.c (fixed_type_or_null): Tidy.  Use a hash table, rather
	than DECL_VAR_MARKED_P, to keep track of which variables we have
	seen.
	* decl.c (redeclaration_error_message): Complain about redeclaring
	anonymous union members at namespace scope.
	* decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
	* g++.dg/lookup/anon6.C: New test.

From-SVN: r125745
2007-06-15 16:58:29 +00:00
Geoffrey Keating c96f00012b decl2.c (determine_visibility): Ensure that functions with hidden types as parameters are hidden.
* decl2.c (determine_visibility): Ensure that functions with
	hidden types as parameters are hidden.

From-SVN: r125722
2007-06-14 21:04:10 +00:00
Geoffrey Keating 7dbd86a541 re PR libgcj/31093 (Multicast PromiscuousTraffic)
PR 31093
	* decl2.c (determine_visibility): Remove duplicate code for
	handling type info.

From-SVN: r125721
2007-06-14 20:56:25 +00:00
Mark Mitchell 46a9e52178 decl.c (get_atexit_fn_ptr_type): New function.
* decl.c (get_atexit_fn_ptr_type): New function.
	(get_atexit_node): Use it.
	(start_cleanup_fn): Likewise.
	(register_dtor_fn): Use the object's destructor, instead of a
	separate cleanup function, where possible.
	* cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
	(atexit_fn_ptr_type_node): New macro.
	* decl2.c (build_cleanup): Use build_address.
	* g++.dg/init/cleanup3.C: New test.

From-SVN: r125253
2007-06-01 00:44:36 +00:00
Jan Hubicka 7be8227904 semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
* semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
	* decl2.c (start_objects): ctors and dtors are no longer public.
	(cp_write_global_declarations): Do not call c_build_cdtor_fns.

	* cgraphunit.c: Include gt-cgraphunit.h
	(static_ctors, static_dtors): New static vars.
	(record_cdtor_fn, build_cdtor, cgraph_build_cdtor_fns): New functions,
	based on implementation in c-common.c
	(cgraph_finalize_function): Call record_cdtor_fn.
	(cgraph_optimize): Call cgraph_build_cdtor_fns.
	* decl.c (finish_function): Do not call c_record_cdtor_fn.
	(c_write_global_declarations): Do not call c_build_cdtor_fns.
	* c-common.c (static_ctors, static_dtors, c_record_cdtor_fn,
	build_cdtor, c_build_cdtor_fns): Remove.
	* c-common.h (static_ctors, static_dtors, c_record_cdtor_fn,
	c_build_cdtor_fns): Remove prototype.

From-SVN: r124618
2007-05-11 12:18:17 +00:00
Seongbae Park ba99296704 re PR c++/31663 (Segfault in constrain_class_visibility with anonymous namespace)
gcc/ChangeLog:
2007-05-02  Seongbae Park  <seongbae.park@gmail.com>

	PR c++/31663
	* c-common.c (strip_pointer_or_array_types): New function.
	* c-common.h (strip_pointer_or_array_types): New function declaration.

gcc/cp/ChangeLog:
2007-05-02  Seongbae Park  <seongbae.park@gmail.com>

	PR c++/31663
	* decl2.c (constrain_class_visibility): 
	Use strip_pointer_or_array_types instead of strip_array_types.

gcc/testsuite/ChangeLog:
2007-05-02  Seongbae Park  <seongbae.park@gmail.com>

	PR C++/31663
	* g++.dg/warn/anonymous-namespace-2.C: New. 
	* g++.dg/warn/anonymous-namespace-2.h: New.

From-SVN: r124363
2007-05-02 23:11:13 +00:00
Jan Hubicka 09191b7e58 decl2.c (finish_objects): Do not call target constructor/destructor bits dirrectly.
* cp/decl2.c (finish_objects): Do not call target constructor/destructor
	bits dirrectly.

From-SVN: r124062
2007-04-23 10:10:20 +00:00
Seongbae Park 8fff206014 re PR c++/29365 (Unnecessary anonymous namespace warnings)
gcc/ChangeLog:

2007-04-16  Seongbae Park <seongbae.park@gmail.com>

	PR c++/29365

	* cp/decl2.c (constrain_class_visibility):
	Do not warn about the use of anonymous namespace in the main input file.

gcc/testsuite/ChangeLog:

2007-04-16  Seongbae Park <seongbae.park@gmail.com>

	PR c++/29365
	Testcase for c++ anonymous namespace warning

	* g++.dg/warn/anonymous-namespace-1.C: New test
	* g++.dg/warn/anonymous-namespace-1.h: New test

From-SVN: r123879
2007-04-16 16:49:02 +00:00
Douglas Gregor 5d80a30674 re PR c++/20599 (variadic template support)
2007-03-09  Douglas Gregor  <doug.gregor@gmail.com>

	PR c++/20599
	* typeck.c (check_return_expr): Check for bare parameter packs.
	(comptypes): Compare template parameter packs and
	type pack expansions.
	* decl.c (grokdeclarator): Deal with the declaration of function
	parameter packs.
	(grokparms): Verify that the (optional) function parameter pack is
	at the end of the parameter list.
	(xref_basetypes): Handle pack expansions in the base class.
	(cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
	* cp-tree.def (TYPE_ARGUMENT_PACK): New.
	(NONTYPE_ARGUMENT_PACK): New.
	(TYPE_PACK_EXPANSION): New.
	(EXPR_PACK_EXPANSION): New.
	(ARGUMENT_PACK_SELECT): New.
	* cp-objcp-common.c (cp_tree_size): Compute size of
	(NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
	ARGUMENT_PACK_SELECT.
	* error.c (dump_template_argument): Print template argument packs.
	(dump_template_argument_list): Ditto.
	(dump_template_parameter): Dump `...' for template type parameter
	packs.
	(dump_type): Dump TYPE_PACK_EXPANSION nodes.
	(dump_parameters): Print function parameter packs.
	(dump_template_parms): Print template argument packs.
	(dump_expr): Dump EXPR_PACK_EXPANSION nodes.
	(maybe_warn_variadic_templates): New.
	* operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
	* tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
	NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
	CAST_EXPR. 
	* mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
	(write_template_arg): Write argument packs as separate arguments.
	* cp-tree.h (struct template_parm_index_s): Add flag that
	indicates that the template parameter is actually a parameter
	pack.
	(struct tree_argument_pack_select): New.
	(enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
	(union lang_tree_node): Add argument_pack_select.
	(FUNCTION_PARAMETER_PACK_P): New.
	(PACK_EXPANSION_P): New.
	(PACK_EXPANSION_PATTERN): New.
	(SET_PACK_EXPANSION_PATTERN): New.
	(PACK_EXPANSION_PARAMETER_PACKS): New.
	(ARGUMENT_PACK_P): New.
	(ARGUMENT_PACK_ARGS): New.
	(SET_ARGUMENT_PACK_ARGS): New.
	(ARGUMENT_PACK_INCOMPLETE_P): New.
	(ARGUMENT_PACK_EXPLICIT_ARGS): New.
	(TEMPLATE_PARM_PARAMETER_PACK): New.
	(TEMPLATE_TYPE_PARAMETER_PACK): New.
	(ARGUMENT_PACK_SELECT_FROM_PACK): New.
	(ARGUMENT_PACK_SELECT_INDEX): New.
	(ARGUMENT_PACK_SELECT_ARG): New.
	(struct cp_declarator): Add parameter_pack_p flag.
	(maybe_warn_variadic_templates): Declare.
	(process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
	indicate a template parameter pack. 
	(uses_parameter_packs): Declare.
	(template_parameter_pack_p): Declare.
	(template_parms_variadic_p): Declare.
	(make_pack_expansion): Declare.
	(check_for_bare_parameter_packs): Declare.
	* cxx-pretty-print.c (pp_cxx_unary_expression): Print
	sizeof... expressions. 
	(pp_cxx_expression): Print pack expansions and non-type argument
	packs.
	(pp_cxx_exception_specification): Print pack expansions. 
	(pp_cxx_direct_declarator): Print ellipsis for parameter packs.
	(pp_cxx_ctor_initializer): Print pack expansions.
	(pp_cxx_type_id): Print pack expansions.
	(pp_cxx_template_argument_list): Print argument packs.
	(pp_cxx_template_parameter): Print ellipsis for template parameter
	packs.
	* pt.c (comp_template_parms): Compare template parameter packs.
	(template_parameter_pack_p): New.
	(template_parms_variadic_p): New.
	(template_args_variadic_p): New.
	(make_ith_pack_parameter_name): New.
	(struct find_parameter_pack_data): New.
	(find_parameter_packs_r): New.
	(uses_parameter_packs): New.
	(make_pack_expansion): New.
	(check_for_bare_parameter_packs): New.
	(expand_template_argument_pack): New.
	(reduce_template_parm_level): Propagate parameter pack flag.
	(process_template_parm): Add is_parameter_pack parameter to state
	when the parameter is actually a parameter pack. Create template
	parameter packs when is_parameter_pack is true.
	(current_template_args): The argument for a template parameter
	pack is an argument pack containing a single pack expansion.
	(process_partial_specialization): When checking that non-type
	argument expressions do not involve template parameters, loop over
	the arguments in argument packs separately.
	(push_template_decl_real): Check that the type of the declaration
	does not have any bare parameter packs. Check that primary
	templates have no more than one parameter pack, and that it comes
	at the end of the template parameter list.
	(convert_template_argument): Handle coercions for pack expansion
	expressions by coercing the pattern then rebuilding the expansion.
	(coerce_template_parms): When coercing the arguments for a
	variadic template, pack "extra" arguments into an argument pack.
	(coerce_template_template_parms): Cannot coerce between parameter
	packs and non-pack parameters.
	(template_args_equal): Compare PACK_EXPANSION_P expressions.
	(comp_template_args): Expand all template arguments packs before
	comparing template argument lists.
	(mangle_class_name_for_template): Make argument packs as separate
	template arguments.
	(for_each_template_parm_r): No need to handle BASELINK. 
	(instantiate_class_template): Handle pack expansions in the base
	class list.
	(tsubst_pack_expansion): New.
	(tsubst_template_args): Handle substitutions of argument packs and
	pack expansion into template argument lists.
	(tsubst_decl): Expand function parameter packs into separate
	function parameters.
	(tsubst_arg_types): Expand a type pack expansion into separate
	argument types.
	(tsubst_exception_specification): Handle pack expansions in
	exception specifiers.
	(tsubst): See through ARGUMENT_PACK_SELECT arguments when 
	replacing a template parameter with its argument. If we encounter
	a substitution for an argument pack, just return the parameter
	itself. 
	(tsubst_copy): sizeof(X...) returns the number of elements in
	parameter pack X.  See through ARGUMENT_PACK_SELECT when the
	PARM_DECL is a parameter pack.
	(tsubst_expr): Expression pack expansions and argument packs
	cannot show up here; they will all be handled through function
	calls, sizeof, and template argument lists.
	(tsubst_copy_and_build): sizeof(X...) returns the number of
	elements in parameter pack X.  Handle pack expansions in TREE_LIST
	and CONSTRUCTOR nodes.
	(fn_type_unification): Handle "incomplete" explicit template
	argument lists that specify some of the arguments for a template
	parameter pack.
	(type_unification_real): Unify arguments against pack expansions.
	(template_parm_level_and_index): New, helper function.
	(unify_pack_expansion): New.
	(unify): Unify argument packs on an argument-by-argument basis,
	handling variadic argument packs as well.
	(more_specialized_fn): Handle unification of function parameter
	packs. All things being equal, prefer non-variadic function
	templates to variadic function templates.
	(more_specialized_class): Prefer the variadic class template
	partial specialization that binds fewer arguments to a parameter
	pack.
	(regenerate_decl_from_template): Expand function parameter packs
	into separate parameters.
	(instantiate_decl): Ditto.
	(tsubst_initializer_list): Handle pack expansions for base-class
	initializers.
	(dependent_type_p_r): Determine dependent types in argument packs
	and pack expansions.
	(value_dependent_expression_p): Determine value-dependence of
	non-type argument packs.
	(dependent_template_arg_p): Handle argument packs.
	* semantics.c (finish_cond): Check for bare parameter packs.
	(finish_expr_stmt): Ditto.
	(finish_for_expr): Ditto.
	(finish_switch_cond): Ditto.
	(finish_mem_initializers): Ditto.
	* name-lookup.c (arg_assoc_type): Handle pack expansions and
	argument packs.
	* decl2.c (cp_build_parm_decl): Mark function parameter packs.
	* parser.c (make_declarator): Declarator is not an expansion.
	(make_pointer_declarator): Transfer parameter pack flag to outer
	declarator.
	(make_reference_declarator): Ditto.
	(make_ptrmem_declarator): Ditto.
	(make_call_declarator): Ditto.
	(make_array_declarator): Ditto.
	(cp_parser_postfix_expression): Allow pack expansion expressions
	in the argument list for a call expression.
	(cp_parser_parenthesized_expression_list): Add new parameter
	ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
	into separate arguments."
	(cp_parser_new_placement): Allow pack expansion expressions.
	(cp_parser_new_initializer): Ditto.
	(cp_parser_mem_initializer_list): Allow ellipsis to create a
	base-class initializer expansion.
	(cp_parser_mem_initializer): Ditto.
	(cp_parser_template_parameter_list): Keep track of whether the
	template parameter is a template parameter pack.
	(cp_parser_template_parameter): Parse the ellipsis to indicate a
	template parameter pack.
	(cp_parser_type_parameter): Ditto.
	(cp_parser_template_argument_list): Parse the ellipsis to indicate
	a pack expansion.
	(cp_parser_direct_declarator): Parse the ellipsis to indicate that
	this declarator is a parameter pack.
	(cp_parser_parameter_declaration): The ellipsis does not end the
	parameter declaration, because it might be a parameter pack. Parse
	the ellipsis to indicate a parameter pack.
	(cp_parser_initializer): Allow pack expansions.
	(cp_parser_initializer_list): Allow ellipsis to create an
	initializer expansion.
	(cp_parser_base_clause): Allow ellipsis to create a base specifier
	expansion.
	(cp_parser_type_id_list): Allow ellipsis to create an exception
	specifier expansion.
	(cp_parser_attribute_list): Don't allow pack expansions.
	(cp_parser_functional_cast): Allow pack expansions.
	(cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
	compute the length of a parameter pack.
	(cp_parser_next_token_ends_template_argument_p): An ellipsis can
	end a template argument.
	* tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
	NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
	CAST_EXPR.

From-SVN: r122788
2007-03-10 01:58:58 +00:00
Mark Mitchell 57a4c089e2 c-decl.c (static_ctors): Move to c-common.c.
* c-decl.c (static_ctors): Move to c-common.c.
	(static_dtors): Likewise.
	(finish_function): Use c_record_cdtor_fn.
	(build_cdtor): Move to c-common.c.
	(c_write_global_declarations): Use c_build_cdtor_fns.
	* c-common.h (static_ctors): Declare.
	(static_dtors): Likewise.
	(c_record_cdtor_fn): Likewise.
	(c_build_cdtor_fns): Likewise.
	* c-common.c (static_ctors): New variable.
	(static_dtors): Likewise.
	(c_record_cdtor_fn): New function.
	(build_cdtor): Move from c-decl.c
	(c_build_cdtor_fns): New function.

	* semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
	* decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.

From-SVN: r122341
2007-02-26 21:14:24 +00:00
Mark Mitchell fc8600f9c1 extend.texi: Document optional priority argument to constructors and destructors.
* doc/extend.texi: Document optional priority argument to
	constructors and destructors.
	* tree.c (init_priority_for_decl): Adjust GTY markers.
	(init_ttree): Use priority-info hash functions for
	init_priority_for_decl.
	(tree_map_eq): Rename to ...
	(tree_map_base_eq): ... this.
	(tree_map_marked_p): Rename to ...
	(tree_map_base_marked_p): ... this.
	(tree_map_base_hash): New function.
	(decl_init_priority_lookup): Rework.
	(decl_fini_priority_lookup): New function.
	(decl_priority_info): New function.
	(decl_init_priority_insert): Use it.
	(decl_fini_priority_insert): Likewise.
	(decl_restrict_base_lookup): Adjust for refactoring of tree_map
	hierarchy.
	(decl_restrict_base_insert): Likewise.
	(decl_debug_expr_insert): Likewise.
	(decl_value_expr_lookup): Likewise.
	(decl_value_expr_insert): Likewise.
	* tree.h (priority_type): New type.
	(decl_init_priority_lookup): Use priority_type.
	(decl_fini_priority_lookup): New function.
	(decl_init_priority_insert): Use priority_type.
	(decl_fini_priority_insert): New function.
	(DECL_HAS_INIT_PRIORITY): Tweak comments.
	(DECL_INIT_PRIORITY): Likewise.
	(SET_DECL_INIT_PRIORITY): Add comment.
	(DECL_FINI_PRIORITY): New macro.
	(SET_DECL_FINI_PRIORITY): Likewise.
	(DEFAULT_INIT_PRIORITY): Document.
	(MAX_INIT_PRIORITY): Likewise.
	(MAX_RESERVED_INIT_PRIORITY): Likewise.
	(tree_map_base): New type.
	(tree_map_base_eq): New function.
	(tree_map_base_hash): Likewise.
	(tree_map_base_marked_p): Likewise.
	(tree_map): Inherit from tree_map_base.
	(tree_map_eq): Make it a macro.
	(tree_map_marked_p): Likewise.
	(tree_int_map): Inherit from tree_map_base.
	(tree_int_map_eq): Make it a macro.
	(tree_int_map_hash): Likewise.
	(tree_int_map_marked_p): Likewise.
	(tree_priority_map): New type.
	(tree_priority_map_eq): New macro.
	(tree_priority_map_hash): Likewise.
	(tree_priority_map_marked_p): Likewise.
	* varasm.c (emults_decl): Adjust for refactoring of tree_map
	hierarchy.
	(emutls_common_1): Likewise.
	* lambda-code.c (replace_uses_equiv_to_x_with_y): Likewise.
	* tree-ssa-structalias.c (heapvar_lookup): Adjust for refactoring
	of tree_map hierarchy.
	* tree-cfg.c (move_stmt_r): Likewise.
	(new_label_mapper): Likewise.
	* c-tree.h (c_expand_body): Move to ...
	* c-common.h (c_expand_body): ... here.
	* c-decl.c (c_expand_body): Move to ...
	* c-common.c (c_expand_body): ... here.
	(c_common_attribute_table): Allow 1 argument for the constructor
	and destructor attributes.
	(get_priority): New function.
	(handle_constructor_attribute): Set DECL_INIT_PRIORITY.
	(handle_destructor_attribute): Set DECL_FINI_PRIORITY.

	* cp-tree.h (static_ctors): Remove.
	* cp-tree.h (static_dtors): Likewise.
	* cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
	refactoring of tree_map hierarchy.
	(decl_shadowed_for_var_insert): Likewise.
	* semantics.c (expand_body): Use c_expand_body.
	(expand_or_defer_fn): Don't update static_ctors or static_dtors.
	* decl2.c (static_ctors): Remove.
	(static_dtors): Likewise.
	(generate_ctor_or_dtor_function): Pass NULL_TREE to
	objc_generate_static_init_call.  Do not call static_[cd]tors.
	(generate_ctor_and_dtor_functions_for_priority): Do not check for
	static_[cd]tors.
	(cp_write_global_declarations): Likewise.

	* decl.c (annotate_value): Adjust for refactoring of tree_map
	hierarchy.

	* gcc.dg/initpri1.c: New test.
	* gcc.dg/initpri2.c: Likewise.
	* g++.dg/special/initpri1.C: New test.
	* g++.dg/special/initpri2.C: Likewise.
	* g++.dg/special/conpr-1.C: Use init_priority effective target.
	* g++.dg/special/conpr-2.C: Likewise.
	* g++.dg/special/conpr-3.C: Likewise.
	* g++.dg/special/conpr-4.C: Likewise.
	* g++.dg/special/initp1.C: Likewise.
	* g++.dg/special/ecos.exp: Remove code to detect availability of
	constructor priorities.
	* lib/target-support.exp (target_init_priority): New function.

From-SVN: r122315
2007-02-25 18:47:05 +00:00
Sandra Loosemore 5039610b96 tree.h (enum tree_code_class): Add tcc_vl_exp.
2007-02-15  Sandra Loosemore  <sandra@codesourcery.com>
	    Brooks Moses  <brooks.moses@codesourcery.com>
	    Lee Millward  <lee.millward@codesourcery.com>

	* tree.h (enum tree_code_class): Add tcc_vl_exp.
	(VL_EXP_CLASS_P): New.
	(TREE_OPERAND_CHECK): Use TREE_OPERAND_LENGTH instead of
	TREE_CODE_LENGTH.
	(TREE_OPERAND_CHECK_CODE): Likewise.
	(GIMPLE_STMT_OPERAND_CHECK): Likewise.
	(TREE_RTL_OPERAND_CHECK): Likewise.
	(tree_operand_check_failed): Make second parameter the whole tree
	instead of its code.  Fixed callers.
	(VL_EXP_CHECK): New.
	(TREE_OPERAND_LENGTH): New.
	(VL_EXP_OPERAND_LENGTH): New.
	(CALL_EXPR_FN): New.
	(CALL_EXPR_STATIC_CHAIN): New.
	(CALL_EXPR_ARGS): New.
	(CALL_EXPR_ARG): New.
	(call_expr_nargs): New.
	(CALL_EXPR_ARGP): New.
	(build_nt_call_list): Declare.
	(build_vl_exp_stat): Declare.
	(build_vl_exp): New.
	(build_call_list): Declare.
	(build_call_nary): Declare.
	(build_call_valist): Declare.
	(build_call_array): Declare.
	(call_expr_arg): Declare.
	(call_expr_argp): Declare.
	(call_expr_arglist): Declare.
	(fold_build_call_list): Declare.
	(fold_build_call_list_initializer): Declare.
	(fold_call_expr): Declare to replace fold_builtin.
	(fold_builtin_fputs): Update to agree with modified definition.
	(fold_builtin_strcpy): Likewise.
	(fold_builtin_strncpy): Likewise.
	(fold_builtin_memory_chk): Likewise.
	(fold_builtin_stxcpy_chk): Likewise.
	(fold_builtin_strncpy_chk): Likewise.
	(fold_builtin_next_arg): Likewise.
	(fold_build_call_expr): Declare.
	(fold_builtin_call_list): Declare.
	(fold_builtin_call_valist): Declare.
	(build_call_expr): Declare.
	(validate_arglist): Update to agree with modified definition.
	(tree_operand_length): New.
	(call_expr_arg_iterator): New.
	(init_call_expr_arg_iterator): New.
	(next_call_expr_arg): New.
	(first_call_expr_arg): New.
	(more_call_expr_args_p): New.
	(FOR_EACH_CALL_EXPR_ARG): New.

	* tree.c (tree_code_class_string): Add entries for tcc_vl_exp
	and tcc_gimple_stmt.
	(tree_code_size): Update documentation.  Use sizeof (tree) rather
	than sizeof (char *).
	(tree_size): Likewise.  Add case for tcc_vl_exp.
	(tree_node_structure): Add case for tcc_vl_exp.
	(contains_placeholder_p): Likewise.
	(substitute_in_expr): Likewise.
	(substitute_placeholder_in_expr): Likewise.
	(stabilize_reference_1): Likewise.
	(build3_stat): Remove logic for CALL_EXPRs.  Replace with assertion
	to diagnose breakage of this interface for constructing CALL_EXPRs.
	(build_nt): Add similar assertion here.
	(build_nt_call_list): New.
	(simple_cst_equal) <CALL_EXPR>: Rewrite to use new accessors.
	(iterative_hash_expr): Use TREE_OPERAND_LENGTH instead of
	TREE_CODE_LENGTH.
	(get_callee_fndecl): Use new CALL_EXPR accessors.
	(tree_operand_check_failed): Change parameters to pass entire node
	instead of its code, so that we can call TREE_OPERAND_LENGTH on it.
	(process_call_operands): New.
	(build_vl_exp_stat): New.
	(build_call_list): New.
	(build_call_nary): New.
	(build_call_valist): New.
	(build_call_array): New.
	(walk_tree): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
	(call_expr_arglist): New.

	* tree.def (CALL_EXPR): Change representation of CALL_EXPRs to use
	tcc_vl_exp instead of a fixed-size tcc_expression.

	* doc/c-tree.texi (CALL_EXPR): Document new representation and
	accessors for CALL_EXPRs.
	(AGGR_INIT_EXPR): Likewise.

2007-02-15  Sandra Loosemore  <sandra@codesourcery.com>
	    Brooks Moses  <brooks.moses@codesourcery.com>
	    Lee Millward  <lee.millward@codesourcery.com>

	* builtins.c (c_strlen): Return NULL_TREE instead of 0.
	(expand_builtin_nonlocal_goto): Change parameter to be entire
	CALL_EXPR instead of an arglist.  Use new CALL_EXPR accessors.
	(expand_builtin_prefetch): Likewise.
	(expand_builtin_classify_type): Likewise.
	(mathfn_built_in): Return NULL_TREE instead of 0.
	(expand_errno_check): Use new CALL_EXPR accessors.
	(expand_builtin_mathfn): Use new CALL_EXPR accessors and constructors.
	Return NULL_RTX instead of 0.
	(expand_builtin_mathfn_2): Likewise.
	(expand_builtin_mathfn_3): Likewise.
	(expand_builtin_interclass_mathfn): Likewise.
	(expand_builtin_sincos): Likewise.
	(expand_builtin_cexpi): Likewise.
	(expand_builtin_int_roundingfn): Likewise.
	(expand_builtin_int_roundingfn_2): Likewise.
	(expand_builtin_pow): Likewise.
	(expand_builtin_powi): Likewise.
	(expand_builtin_strlen): Pass entire CALL_EXPR as parameter instead
	of arglist, fixing callers appropriately.  Use new CALL_EXPR
	accessors and constructors.  Return NULL_RTX instead of 0.
	(expand_builtin_strstr): Likewise.
	(expand_builtin_strchr): Likewise.
	(expand_builtin_strrchr): Likewise.
	(expand_builtin_strpbrk): Likewise.
	(expand_builtin_memcpy): Likewise.
	(expand_builtin_mempcpy): Likewise.
	(expand_builtin_mempcpy_args): New.
	(expand_builtin_memmove): Similarly to expand_builtin_mempcpy.
	(expand_builtin_memmove_args): New.
	(expand_builtin_bcopy): Similarly to expand_builtin_mempcpy.
	(expand_movstr): Likewise.
	(expand_builtin_strcpy): Likewise.
	(expand_builtin_strcpy_args): New.
	(expand_builtin_stpcpy): Similarly to expand_builtin_strcpy.
	(expand_builtin_strncpy): Likewise.
	(expand_builtin_memset): Likewise.
	(expand_builtin_memset_args): New.
	(expand_builtin_bzero): Similarly to expand_builtin_memset.
	(expand_builtin_memcmp): Likewise.
	(expand_builtin_strcmp): Likewise.
	(expand_builtin_strncmp): Likewise.
	(expand_builtin_strcat): Likewise.
	(expand_builtin_strncat): Likewise.
	(expand_builtin_strspn): Likewise.
	(expand_builtin_strcspn): Likewise.
	(expand_builtin_args_info): Likewise.
	(expand_builtin_va_start): Likewise.
	(gimplify_va_arg_expr): Likewise.
	(expand_builtin_va_end): Likewise.
	(expand_builtin_va_copy): Likewise.
	(expand_builtin_frame_address): Likewise.
	(expand_builtin_alloca): Likewise.
	(expand_builtin_bswap): Likewise.
	(expand_builtin_unop): Likewise.
	(expand_builtin_fputs): Likewise.
	(expand_builtin_expect): Likewise.
	(expand_builtin_fabs): Likewise.
	(expand_builtin_copysign): Likewise.
	(expand_builtin_printf): Likewise.
	(expand_builtin_fprintf): Likewise.
	(expand_builtin_sprintf): Likewise.
	(expand_builtin_init_trampoline): Likewise.
	(expand_builtin_signbit): Likewise.
	(expand_builtin_fork_or_exec): Likewise.
	(expand_builtin_sync_operation): Likewise.
	(expand_builtin_compare_and_swap): Likewise.
	(expand_builtin_lock_test_and_set): Likewise.
	(expand_builtin_lock_release): Likewise.
	(expand_builtin): Likewise.
	(builtin_mathfn_code): Likewise.

	(fold_builtin_constant_p): Pass call arguments individually instead
	of as an arglist, fixing callers appropriately.  Use new CALL_EXPR
	accessors and constructors.  Return NULL_TREE instead of 0.
	(fold_builtin_expect): Likewise.
	(fold_builtin_classify_type): Likewise.
	(fold_builtin_strlen): Likewise.
	(fold_builtin_nan): Likewise.
	(integer_valued_real_p): Likewise.
	(fold_trunc_transparent_mathfn): Likewise.
	(fold_fixed_mathfn): Likewise.
	(fold_builtin_cabs): Likewise.
	(fold_builtin_sqrt): Likewise.
	(fold_builtin_cbrt): Likewise.
	(fold_builtin_cos): Likewise.
	(fold_builtin_cosh): Likewise.
	(fold_builtin_tan): Likewise.
	(fold_builtin_sincos): Likewise.
	(fold_builtin_cexp): Likewise.
	(fold_builtin_trunc): Likewise.
	(fold_builtin_floor): Likewise.
	(fold_builtin_ceil): Likewise.
	(fold_builtin_round): Likewise.
	(fold_builtin_int_roundingfn): Likewise.
	(fold_builtin_bitop): Likewise.
	(fold_builtin_bswap): Likewise.
	(fold_builtin_logarithm): Likewise.
	(fold_builtin_hypot): Likewise.
	(fold_builtin_pow): Likewise.
	(fold_builtin_powi): Likewise.
	(fold_builtin_exponent): Likewise.
	(fold_builtin_memset): Likewise.
	(fold_builtin_bzero): Likewise.
	(fold_builtin_memory_op): Likewise.
	(fold_builtin_bcopy): Deleted; call site changed to invoke
	fold_builtin_memory_op directly.
	(fold_builtin_strcpy): Similarly as for fold_builtin_memory_op.
	(fold_builtin_strncpy): Likewise.
	(fold_builtin_memcmp): Likewise.
	(fold_builtin_strcmp): Likewise.
	(fold_builtin_strncmp): Likewise.
	(fold_builtin_signbit): Likewise.
	(fold_builtin_copysign): Likewise.
	(fold_builtin_isascii): Likewise.
	(fold_builtin_toascii): Likewise.
	(fold_builtin_isdigit): Likewise.
	(fold_builtin_fabs): Likewise.
	(fold_builtin_abs): Likewise.
	(fold_builtin_fmin_fmax): Likewise.
	(fold_builtin_carg): Likewise.
	(fold_builtin_classify): Likewise.
	(fold_builtin_unordered_cmp): Likewise.

	(fold_builtin_0, fold_builtin_2, fold_builtin_3, fold_builtin_4):
	New functions split out from fold_builtin_1.
	(fold_builtin_n): New.
	(fold_builtin_varargs): New.
	(fold_builtin): Deleted.  Most callers changed to use fold_call_expr
	instead.
	(fold_call_expr): New.
	(build_function_call_expr): Rewrite to use new helper function.
	(fold_builtin_call_list): New.
	(build_call_expr): New.
	(fold_builtin_call_valist): New.
	(rewrite_call_expr): New.
	(validate_arg): New.
	(validate_arglist): Change parameter to be entire CALL_EXPR instead
	of an arglist.  Change return type to bool.  Use new CALL_EXPR
	accessors.

	(fold_builtin_strstr):  Pass call arguments individually instead
	of as an arglist, fixing callers appropriately.  Use new CALL_EXPR
	accessors and constructors.  Return NULL_TREE instead of 0.
	(fold_builtin_strchr): Likewise.
	(fold_builtin_strrchr): Likewise.
	(fold_builtin_strpbrk): Likewise.
	(fold_builtin_strcat): Likewise.
	(fold_builtin_strncat): Likewise.
	(fold_builtin_strspn): Likewise.
	(fold_builtin_strcspn): Likewise.
	(fold_builtin_fputs): Likewise.
	(fold_builtin_next_arg): Likewise.
	(fold_builtin_sprintf): Likewise.

	(expand_builtin_object_size): Use new CALL_EXPR accessors.  Use
	NULL_RTX instead of 0.
	(expand_builtin_memory_chk): Likewise.
	(maybe_emit_chk_warning): Likewise.
	(maybe_emit_sprintf_chk_warning): Likewise.

	(fold_builtin_object_size): Pass call arguments individually instead
	of as an arglist, fixing callers appropriately.  Use new CALL_EXPR
	accessors and constructors.  Return NULL_TREE instead of 0.
	(fold_builtin_memory_chk): Likewise.
	(fold_builtin_stxcpy_chk): Likewise.
	(fold_builtin_strncpy_chk): Likewise.
	(fold_builtin_strcat_chk): Likewise.
	(fold_builtin_strcat_chk): Likewise.
	(fold_builtin_strncat_chk): Likewise.
	(fold_builtin_sprintf_chk): Likewise.
	(fold_builtin_snprintf_chk): Likewise.
	(fold_builtin_printf): Likewise.
	(fold_builtin_vprintf): Likewise.

	* fold-const.c (negate_expr_p): Use new CALL_EXPR accessors and
	constructors.
	(operand_equal_p): Add separate tcc_vl_exp/CALL_EXPR case.
	(make_range): Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
	(extract_muldiv_1): Add VL_EXP_CLASS_P case.
	(fold_mathfn_compare): Use new CALL_EXPR accessors and constructors.
	(fold_unary): Likewise.
	(fold_binary): Likewise.
	(fold_ternary): Remove CALL_EXPR case, since they are no longer
	ternary expressions.
	(fold): Add logic for tcc_vl_exp.
	(fold_checksum_tree):  Make it know about tcc_vl_exp.  Use
	TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
	(fold_build3_stat): Add assertion to flag broken interface for
	constructing CALL_EXPRs.
	(fold_build_call_list): New.
	(fold_build_call_list_initializer): New.
	(tree_expr_nonnegative_p): Use new CALL_EXPR accessors and
	constructors.
	(fold_strip_sign_ops): Likewise.

2007-02-15  Sandra Loosemore  <sandra@codesourcery.com>
	    Brooks Moses  <brooks.moses@codesourcery.com>
	    Lee Millward  <lee.millward@codesourcery.com>

	* tree-dump.c (dequeue_and_dump) <CALL_EXPR>: Use new CALL_EXPR
	accessors and dump arguments explicitly.

	* tree-pretty-print.c (do_niy): Use TREE_OPERAND_LENGTH instead of
	TREE_CODE_LENGTH.
	(dump_generic_node): Use new CALL_EXPR accessors and walk arguments
	explicitly.
	(print_call_name): Use new CALL_EXPR accessors.

	* print-tree.c (print_node): Add case tcc_vl_exp.  Print
	CALL_EXPR arguments explicitly instead of as a list.  Use
	TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.

	* tree-vrp.c (stmt_interesting_for_vrp): Use new CALL_EXPR accessors.
	(vrp_visit_stmt): Likewise.

	* tree-ssa-loop-im.c (outermost_invariant_loop_expr):  Make it
	know about tcc_vl_exp.  Use TREE_OPERAND_LENGTH instead of
	TREE_CODE_LENGTH.
	(force_move_till_expr): Likewise.

	* targhooks.c (default_external_stack_protect_fail): Use
	build_call_expr instead of build_function_call_expr.
	(default_hidden_stack_protect_fail): Likewise.

	* tree-complex.c (expand_complex_libcall): Use build_call_expr to
	build the call.

	* cgraphbuild.c (build_cgraph_edges): Use new CALL_EXPR accessors
	and walk arguments explicitly.

	* tree-ssa-loop-niter.c (simplify_replace_tree): Use
	TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
	(expand_simple_operations): Likewise.
	(infer_loop_bounds_from_array): Use new CALL_EXPR accessors.

	* gengtype.c (adjust_field_tree_exp): Use TREE_OPERAND_LENGTH instead
	of TREE_CODE_LENGTH.
	(walk_type): Tweak walking of arrays not to blow up on CALL_EXPRs.

	* optabs.c (expand_widen_pattern-expr): Use TREE_OPERAND_LENGTH
	instead of TREE_CODE_LENGTH.

	* value_prof.c (tree_ic): Use new CALL_EXPR accessors.
	(tree_ic_transform): Likewise.
	(interesting_stringop_to_profile_p): Pass entire CALL_EXPR as
	parameter instead of arglist.  Fix callers.
	(tree_stringop_fixed_value): Use new CALL_EXPR accessors.
	(tree_stringops_transform): Likewise.
	(tree_indirect_call_to_profile): Likewise.
	(tree_stringops_values_to_profile): Likewise.

	* tree-tailcall.c (find_tail_calls): Use new CALL_EXPR iterator.
	(eliminate_tail_call): Likewise.

	* ipa-cp.c (ipcp_update_callgraph): Use new CALL_EXPR accessors.

	* tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop):
	Use TREE_OPERAND_LENGTH and generalize to handle any number of
	operands.
	(instantiate_parameters_1): Can't handle tcc_vl_exp here.

	* omp-low.c (build_omp_barrier): Use build_call_expr.
	(lower_rec_input_clauses): Likewise.
	(lower_reduction_clauses): Likewise.
	(expand_parallel_call): Likewise.
	(maybe_catch_exception): Likewise.
	(expand_omp_for_generic): Likewise.
	(expand_omp_for_static_nochunk): Likewise.
	(expand_omp_sections): Likewise.
	(lower_omp_single_simple): Likewise.
	(lower_omp_single_copy): Likewise.
	(lower_omp_master): Likewise.
	(lower_omp_ordered): Likewise.
	(lower_omp_critical): Likewise.

	* ipa-reference.c (check-call): Use new CALL_EXPR iterator.
	(scan_for_static_refs): Create tcc_vl_exp case for CALL_EXPR.

	* tree-gimple.c (is_gimple_call_addr): Fix doc.
	(recalculate_side_effects): Use TREE_OPERAND_LENGTH instead of
	TREE_CODE_LENGTH.  Add tcc_vl_exp case.

	* tree-chrec.c (chrec_contains_symbols): Use TREE_OPERAND_LENGTH
	and generalize to handle any number of operands.
	(chrec_contains_undetermined): Likewise.
	(tree_contains_chrecs): Likewise.
	(evolution_function_is_invariant_rec_p): Use TREE_OPERAND_LENGTH.

	* cgraphunit.c (update_call_expr): Use new CALL_EXPR accessors.

	* tree-ssa-ccp.c (ccp_fold): Use new CALL_EXPR accessors.  Use
	fold_call_expr instead of fold_builtin.
	(ccp_fold_builtin): Likewise.  Update calls into builtins.c to
	match declarations there.
	(fold_stmt): Use new CALL_EXPR constructor and accessors.  Doc
	updates.

	* tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Use
	TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.

	* ipa-pure-const.c (check_call): Use new CALL_EXPR accessors.
	(scan_function): Add case tcc_vl_exp for CALL_EXPR.

	* tree-stdarg.c (execute_optimize_stdarg): Use new CALL_EXPR
	accessors.

	* tree-ssa-math-opts.c (execute_cse_sincos_1): Use build_call_expr.
	(execute_cse_sincos): Use new CALL_EXPR accessors.

	* tree-ssa-alias.c (find_used_portions): Use new CALL_EXPR iterator.

	* gimple-low.c (lower_function_body): Use build_call_expr.
	(lower_builtin_setjmp): Likewise.

	* expr.c (emit_block_move_via_libcall): Use build_call_expr.
	(set_storage_via_libcall): Likewise.
	(safe_from_p): Add tcc_vl_exp case.  Use TREE_OPERAND_LENGTH
	instead of TREE_CODE_LENGTH.
	(expand_expr_real_1): Use new CALL_EXPR accessors.

	* tree-browser.c (store_child_info): Use TREE_OPERAND_LENGTH and
	generalize to handle any number of operands.
	(TB_parent_eq): Likewise.

	* predict.c (expr_expected_value): Use new CALL_EXPR accessors.
	(strip_builtin_expect): Likewise.

	* function.c (gimplify_parameters): Use build_call_expr.

	* tree-vectorizer.c (vect_is_simple_reduction): Use TREE_OPERAND_LENGTH
	instead of TREE_CODE_LENGTH.

	* ipa-type-escape.c (check_call): Use new CALL_EXPR iterators.
	(scan_for_refs): Add case tcc_vl_exp for CALL_EXPR.

	* tree-data-ref.c (get_references_in_stmt): Use new CALL_EXPR
	iterators.

	* gimplify.c (build_stack_save_restore): Use build_call_expr.
	(gimplify_decl_expr): Likewise.
	(gimplify_call_expr): Use fold_call_expr instead of fold_builtin.
	Use new CALL_EXPR iterators.
	(gimplify_modify_expr_to_memcpy): Use build_call_expr.
	(gimplify_modify_expr_to_memset): Likewise.
	(gimplify_variable_sized_compare): Likewise.
	(gimplify_omp_atomic_fetch_op): Likewise.
	(gimplify_omp_atomic_pipeline): Likewise.
	(gimplify_omp_atomic_mutex): Likewise.
	(gimplify_function_tree): Likewise.

	* calls.c (alloca_call_p): Use new CALL_EXPR accessors.
	(call_expr_flags): Likewise.
	(expand_call): Likewise.

	* except.c (expand_builtin_eh_return_data_regno): Pass entire
	CALL_EXPR as parameter instead of arglist.  Use new CALL_EXPR 
        accessors.

	* coverage.c (create_coverage): Use build_call_expr.

	* tree-ssa-pre.c (expression_node_pool, list_node_pool): Delete.
	(temp_call_expr_obstack): New.
	(pool_copy_list): Delete.
	(temp_copy_call_expr): New.
	(phi_translate): Add case tcc_vl_exp for CALL_EXPR.  Use new
	CALL_EXPR accessors.  Get rid of special goo for copying argument
	lists and use temp_copy_call_expr instead.
	(valid_in_sets): Add case tcc_vl_exp for CALL_EXPR.  Use new
	CALL_EXPR accessors.
	(create_expression_by_pieces): Likewise.  Use build_call_array
	to construct the result instead of fold_build3.
	(create_value_expr_from): Add tcc_vl_exp.  Delete special goo for
	dealing with argument lists.
	(init_pre): Remove references to expression_node_pool and
	list_node_pool.  Init temp_call_expr_obstack instead.
	(fini_pre): Remove references to expression_node_pool and
	list_node_pool.

	* tree-sra.c (sra_walk_call_expr): Use new CALL_EXPR accessors
	and walk arguments explicitly instead of as a list.

	* tree-mudflap.c (mf_build_check_statement_for): Use build_call_expr.
	(mx_register_decls): Likewise.
	(mudflap_register_call): Likewise.
	(mudflap_finish_file): Likewise.

	* ipa-prop.c (ipa_callsite_compute_count): Use new CALL_EXPR accessors.
	(ipa_callsite_compute_param): Likewise.

	* tree-vect-patterns.c (vect_recog_pow_pattern): Use new CALL_EXPR
	accessors and constructor.

	* tree-nested.c (convert_nl_goto_reference): Use new CALL_EXPR
	accessors and constructor.
	(convert_tramp_reference): Likewise. 
	(convert_call_expr): Likewise.
	(finalize_nesting_tree_1): Likewise.

	* tree-ssa.c (tree_ssa_useless_type_conversion): Use new CALL_EXPR
	accessors.

	* tree-ssa-loop-prefetch.c (issue_prefetch_ref): Use build_call_expr.

	* tree-inline.c (initialize_inlined_parameters): Pass entire
	CALL_EXPR as parameter instead of arglist.  Use new CALL_EXPR
	accessors.
	(estimate_num_insns_1): Use new CALL_EXPR accessors.
	(expand_call_inline): Tidy up call to initialize_inlined_parameters.

	* tree-vect-transform.c (vect_create_epilog_for_reduction):  Use
	TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.
	(vectorizable_reduction): Likewise.
	(vectorizable_call): Use new CALL_EXPR iterators.
	(vectorizable_conversion): Use build_call_expr.
	(vectorizable_operation): Use TREE_OPERAND_LENGTH.
	(vect_gen_widened_results_half): Use build_call_expr.
	(vect_setup_realignment): Likewise.
	(vectorizable_live_operation): Use TREE_OPERAND_LENGTH.

	* tree-object-size.c (alloc_object_size): Use new CALL_EXPR accessors.
	(pass_through_call): Likewise.
	(compute_object_sizes): Likewise.  Use fold_call_expr instead of
	fold_builtin.

	* tree-profile.c (tree_gen_interval_profiler): Use build_call_expr.
	(tree_gen_pow2_profiler): Likewise.
	(tree_gen_one_value_profiler): Likewise.
	(tree_gen_ic_func_profiler): Likewise.
	(tree_gen_average_profiler): Likewise.
	(tree_gen_ior_profiler): Likewise.

	* tree-ssa-structalias.c (get_constraint_for): Add case tcc_vl_exp.
	(find_func_aliases): Use new CALL_EXPR accessors.  Add case
	tcc_vl_exp.  Use TREE_OPERAND_LENGTH instead of TREE_CODE_LENGTH.

	* tree-ssa-reassoc.c (get_rank): Use TREE_OPERAND_LENGTH instead
	of TREE_CODE_LENGTH.

	* stmt.c (warn_if_unused_value): Use TREE_OPERAND_LENGTH instead
	of TREE_CODE_LENGTH.

	* convert.c (convert_to_real): Use new CALL_EXPR accessors and
	constructor.
	(convert_to_integer): Likewise.

	* tree-ssa-operands.c (get_call_expr_operands): Use new CALL_EXPR
	accessors.

2007-02-15  Sandra Loosemore  <sandra@codesourcery.com>
	    Brooks Moses  <brooks.moses@codesourcery.com>
	    Lee Millward  <lee.millward@codesourcery.com>

	* config/alpha/alpha.c (alpha_expand_builtin): Use new CALL_EXPR
	accessors.
	* config/frv/frv.c (frv_expand_builtin): Likewise.
	* config/s390/s390.c (s390_expand_builtin): Likewise.

	* config/sparc/sparc.c (sparc_gimplify_va_arg): Use build_call_expr.
	(sparc_expand_builtin): Use new CALL_EXPR accessors.

	* config/i386/i386.c (ix86_function_ok_for_sibcall): Likewise.
	(ix86_expand_binop_builtin): Pass entire CALL_EXPR as parameter
	instead of arglist.  Use new CALL_EXPR accessors on it.  Fix callers.
	(ix86_expand_store_builtin): Likewise.
	(ix86_expand_unop_builtin): Likewise.
	(ix86_expand_unop1_builtin): Likewise.
	(ix86_expand_sse_compare): Likewise.
	(ix86_expand_sse_comi): Likewise.
	(ix86_expand_vec_init_builtin): Likewise.
	(ix86_expand_vec_ext_builtin): Likewise.
	(ix86_expand_vec_set_builtin): Likewise.
	(ix86_expand_builtin): Use new CALL_EXPR accessors.

	* config/sh/sh.c (sh_expand_builtin): Use new CALL_EXPR accessors.
	* config/c4x/c4x.c (c4x_expand_builtin): Likewise.

	* config/iq2000/iq2000.c (expand_one_builtin): Pass entire CALL_EXPR
	instead of arglist.  Use new CALL_EXPR accessors.  Fix callers.
	(iq2000_expand_builtin): Use new CALL_EXPR accessors.

	* config/rs6000/rs6000-c.c (altivec_build_resolved_builtin): Use
	build_call_expr.
	* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise.
	(rs6000_expand_unop_builtin): Pass entire CALL_EXPR instead of
	arglist.  Use new CALL_EXPR accessors.  Fix callers.
	(altivec_expand_abs_builtin): Likewise.
	(rs6000_expand_binop_builtin): Likewise.
	(altivec_expand_predicate_builtin): Likewise.
	(altivec_expand_lv_builtin): Likewise.
	(spe_expand_stv_builtin): Likewise.
	(altivec_expand_stv_builtin): Likewise.
	(rs6000_expand_ternop_builtin): Likewise.
	(altivec_expand_ld_builtin): Use new CALL_EXPR accessors.
	(altivec_expand_st_builtin): Likewise.
	(altivec_expand_dst_builtin): Likewise.
	(altivec_expand_vec_init_builtin): Pass entire CALL_EXPR instead of
	arglist.  Use new CALL_EXPR accessors.  Fix callers.
	(altivec_expand_vec_set_builtin): Likewise.
	(altivec_expand_vec_ext_builtin): Likewise.
	(altivec_expand_builtin): Use new CALL_EXPR accessors.
	(spe_expand_builtin): Likewise.
	(spe_expand_predicate_builtin): Pass entire CALL_EXPR instead of
	arglist.  Use new CALL_EXPR accessors.  Fix callers.
	(spe_expand_evsel_builtin): Likewise.
	(rs6000_expand_builtin): Use new CALL_EXPR accessors.  VCFUX and
	FCFSX cases must construct whole new CALL_EXPR, not just arglist.

	* config/arm/arm.c (arm_expand_binop_builtin): Pass entire CALL_EXPR
	instead of arglist.  Use new CALL_EXPR accessors.  Fix callers.
	(arm_expand_unop_builtin): Likewise.
	(arm_expand_builtin): Use new CALL_EXPR accessors.

	* config/mips/mips.c (mips_expand_builtin):  Use new CALL_EXPR
	accessors.

	* config/bfin/bfin.c (bfin_expand_binop_builtin): Pass entire CALL_EXPR
	instead of arglist.  Use new CALL_EXPR accessors.  Fix callers.
	(bfin_expand_unop_builtin): Likewise.
	(bfin_expand_builtin): Use new CALL_EXPR accessors.

2007-02-15  Sandra Loosemore  <sandra@codesourcery.com>
	    Brooks Moses  <brooks.moses@codesourcery.com>
	    Lee Millward  <lee.millward@codesourcery.com>

	* c-semantics.c (build_stmt): Add internal diagnostic check.

	* c-pretty-print.c (pp_c_postfix_expression): Use new CALL_EXPR
	accessors.  Print arguments explicitly instead of as a list.

	* c-typeck.c (build_function_call): Use new CALL_EXPR constructors.

	* c-omp.c (c_finish_omp_barrier): Use build_call_expr.
	(c_finish_omp_flish): Likewise.

	* c-common.c (verify_tree): Use new CALL_EXPR accessors.  Traverse
	arguments explicitly instead of as a list.  Use TREE_OPERAND_LENGTH
	instead of TREE_CODE_LENGTH.
	(check_function_arguments_recurse): Use new CALL_EXPR accessors.
	(c_warn_unused_result): Likewise.

2007-02-15  Sandra Loosemore  <sandra@codesourcery.com>
	    Brooks Moses  <brooks.moses@codesourcery.com>
	    Lee Millward  <lee.millward@codesourcery.com>

	* cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
	Change class to tcc_vl_exp.

	* call.c (build_call): Use build_call_list instead 
	of build3. 
	(build_over_call): Likewise.
	(build_new_method_call): Use build_min_non_dep_call_list 
	instead of build_min_non_dep.

	* error.c (dump_call_expr_args): New function.
	(dump_aggr_init_expr_args): New function.
	(dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them. 
	Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.

	* cvt.c (convert_to_void): Use build_call_array instead
	of build3; use new AGGR_INIT_EXPR accessor macros.

	* mangle.c (write_expression): Use TREE_OPERAND_LENGTH
	instead of TREE_CODE_LENGTH.

	* dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
	AGGR_INIT_EXPR accessor macros.

	* cp-gimplify.c (cp_gimplify_init_expr): Use 
	AGGR_INIT_EXPR_SLOT to set the slot operand.

	* cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
	(AGGR_INIT_EXPR_SLOT): New macro.
	(AGGR_INIT_EXPR_ARG): New macro.
	(aggr_init_expr_nargs): New macro.
	(AGGR_INIT_EXPR_ARGP): New macro.
	(aggr_init_expr_arg_iterator): New.
	(init_aggr_init_expr_arg_iterator): New.
	(next_aggr_init_expr_arg): New.
	(first_aggr_init_expr_arg): New.
	(more_aggr_init_expr_args_p): New.
	(FOR_EACH_AGGR_INIT_EXPR_ARG): New.
	(stabilize_aggr_init): New declaration.
	(build_min_non_dep_call_list): Likewise.

	* tree.c (process_aggr_init_operands): New function.
	(build_aggr_init_array) New function.
	(build_cplus_new): Update to use new CALL_EXPR and
	AGGR_INIT_EXPR accessor macros. Replace use of build3 with
	build_aggr_init_array.
	(build_min_non_dep_call_list) New function.
	(build_min_nt): Assert input code parameter is not a variable
	length expression class.
	(build_min, build_min_non_dep): Likewise.
	(cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
	to check for equality instead of recursing. Handle tcc_vl_exp
	tree code classes.
	(stabilize_call): Update to only handle CALL_EXPRs, not 
	AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
	(stabilize_aggr_init): New function.
	(stabilize_init): Use it.

	* cxx-pretty-print.c (pp_cxx_postfix_expression)
	<AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
	AGGR_INIT_EXPR accessor macros and argument iterators.
	
	* pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
	build_vl_exp. Iterate through the operands, recursively 
	processing each one.
	(tsubst_copy_and_build) <CALL_EXPR>: Update to use new
	CALL_EXPR accessor macros.
	(value_dependent_expression_p) <default>: Handle tcc_vl_exp
	tree code classes. Use TREE_OPERAND_LENGTH instead of 
	TREE_CODE_LENGTH.

	* semantics.c (finish_call_expr): Use build_nt_call_list
	instead of build_nt.
	(simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR 
	accessor macros. Use build_call_array to construct the 
	CALL_EXPR node instead of build3
	
	* decl2.c (build_offset_ref_call_from_tree): Use 
	build_nt_call_list and build_min_non_dep_call_list instead
	of build_min_nt and build_min_non_dep.

	* parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
	Use build_nt_call_list instead of build_min_nt.

2007-02-15  Sandra Loosemore  <sandra@codesourcery.com>
	    Brooks Moses  <brooks.moses@codesourcery.com>
	    Lee Millward  <lee.millward@codesourcery.com>

	* java-tree.h (BUILD_MONITOR_ENTER): Use build_call_nary instead
	of build3.
	(BUILD_MONITOR_EXIT): Likewise.

	* java-gimplify.c (java_gimplify_component_ref): Use build_call_expr.
	(java_gimplify_modify_expr): Likewise.

	* class.c (cache_this_class_ref): Use build_call_expr.
	(build_static_field_ref): Likewise.
	(emit_indirect_register_classes): Likewise.
	(emit_register_classes): Likewise.

	* resource.c (write_resource_constructor): Use build_call_expr.

	* builtins.c (builtin_creator_function): Change interpretation of
	the second parameter to be the whole CALL_EXPR instead of the arglist.
	(max_builtin): Tweak parameter list.  Use new CALL_EXPR accessors.
	(min_builtin): Likewise.
	(abs_builtin): Likewise.
	(java_build_function_call_expr): Likewise.
	(convert_real): Likewise.
	(UNMARSHAL3): Likewise.
	(UNMARSHAL4): Likewise.
	(UNMARSHAL5): Likewise.
	(build_arglist_for_builtin): Delete.  Fix callers to use
	build_call_expr instead.
	(putObject_builtin): Tweak parameter list.  Use new CALL_EXPR
	accessors.
	(compareAndSwapInt_builtin): Likewise.
	(compareAndSwapLong_builtin): Likewise.
	(compareAndSwapObject_builtin): Likewise.
	(putVolatile_builtin): Likewise.
	(getVolatile_builtin): Likewise.
	(VMSupportsCS8_builtin): Likewise.
	(check_for_builtin): Pass entire CALL_EXPR to builtin expander
	instead of arglist.

	* expr.c (build_java_athrow): Use build_call_nary instead of build3.
	(build_java_throw_out_of_bounds_exception): Likewise.
	(java_check_reference): Likewise.
	(build_java_arraystore_check): Likewise.
	(build_newarray): Likewise.
	(build_anewarray): Likewise.
	(expand_java_multinewarray): Use build_call_list instead of build3.
	(build_java_monitor): Use build_call_nary instead of build3.
	(java_create_object): Likewise.
	(expand_java_NEW): Likewise.
	(build_instanceof): Likewise.
	(expand_java_CHECKCAST): Likewise.
	(build_java_soft_divmod): Likewise.
	(build_java_binop): Likewise.
	(build_field_ref): Likewise.
	(build_class_init): Likewise.
	(rewrite_arglist_getcaller): Use build_call_expr.
	(build_invokeinterface):  Use build_call_nary instead of build3.
	(expand_invoke): Use build_call_list instead of build3.
	(build_jni_stub): Use build_call_nary, build_call_list, or
	build_call_expr instead	of build3.
	(expand_java_field_op): Use build_call_expr instead of build3.
	(force_evaluation_order): Use new CALL_EXPR accessors.

	* lang.c (java_get_callee_fndecl): Use new CALL_EXPR accessors.

2007-02-15  Sandra Loosemore  <sandra@codesourcery.com>
	    Brooks Moses  <brooks.moses@codesourcery.com>
	    Lee Millward  <lee.millward@codesourcery.com>

	* objc-act.c (receiver_is_class_object): Use new CALL_EXPR accessors.
	(objc_get_callee_fndecl): Likewise.

2007-02-15  Sandra Loosemore  <sandra@codesourcery.com>
	    Brooks Moses  <brooks.moses@codesourcery.com>
	    Lee Millward  <lee.millward@codesourcery.com>

	* trans-expr.c (gfc_conv_power_op): Use build_call_expr.
	(gfc_conv_string_tmp): Likewise.
	(gfc_conv_concat_op): Likewise.
	(gfc_build_compare_string): Likewise.
	(gfc_conv_function_call): Use build_call_list instead of build3.

	* trans-array.c (gfc_trans_allocate_array_storage): Use
	build_call_expr.
	(gfc_grow_array): Likewise.
	(gfc_trans_array_ctor_element): Likewise.
	(gfc_trans_array_constructor_value): Likewise.
	(gfc_array_allocate): Likewise.
	(gfc_array_deallocate): Likewise.
	(gfc_trans_auto_array_allocation): Likewise.
	(gfc_trans_dummy_array_bias): Likewise.
	(gfc_conv_array_parameter): Likewise.
	(gfc_trans_dealloc_allocated): Likewise.
	(gfc_duplicate_allocatable): Likewise.

	* trans-openmp.c (gfc_trans_omp_barrier): Use build_call_expr.
	(gfc_trans_omp_flush): Likewise.

	* trans-stmt.c (gfc_conv_elementel_dependencies): Use build_call_expr.
	(gfc_trans_pause): Likewise.
	(gfc_trans_stop): Likewise.
	(gfc_trans_character_select): Likewise.
	(gfc_do_allocate): Likewise.
	(gfc_trans_assign_need_temp): Likewise.
	(gfc_trans_pointer_assign_need_temp): Likewise.
	(gfc_trans_forall_1): Likewise.
	(gfc_trans_where_2): Likewise.
	(gfc_trans_allocate): Likewise.
	(gfc_trans_deallocate): Likewise.

	* trans.c (gfc_trans_runtime_check): Use build_call_expr.

	* trans-io.c (gfc_trans_open): Use build_call_expr.
	(gfc_trans_close): Likewise.
	(build_filepos): Likewise.
	(gfc_trans_inquire): Likewise.
	(NML_FIRST_ARG): Delete.
	(NML_ADD_ARG): Delete.
	(transfer_namelist_element): Use build_call_expr.
	(build_dt): Likewise.
	(gfc_trans_dt_end): Likewise.
	(transfer_expr): Likewise.
	(transfer_array-desc): Likewise.

	* trans-decl.c (gfc_generate_function_code): Use build_call_expr.
	(gfc_generate_constructors): Likewise.

	* trans-intrinsic.c (gfc_conv_intrinsic_ctime): Use build_call_expr.
	(gfc_conv_intrinsic_fdate): Likewise.
	(gfc_conv_intrinsic_ttynam): Likewise.
	(gfc_conv_intrinsic_array_transfer): Likewise.
	(gfc_conv_associated): Likewise.
	(gfc_conv_intrinsic_si_kind): Likewise.
	(gfc_conv_intrinsic_trim): Likewise.
	(gfc_conv_intrinsic_repeat: Likewise.
	(gfc_conv_intrinsic_iargc): Likewise.

Co-Authored-By: Brooks Moses <brooks.moses@codesourcery.com>
Co-Authored-By: Lee Millward <lee.millward@codesourcery.com>

From-SVN: r122018
2007-02-15 18:50:49 -05:00
Kazu Hirata 3b426391d3 class.c, [...]: Follow spelling conventions.
* class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
	parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.

From-SVN: r121566
2007-02-04 04:24:53 +00:00
Jan Hubicka 77dbd49bdc decl2.c (start_objects, [...]): Do not make the functions uninlinable.
* decl2.c (start_objects, start_static_storage_duration_function):
	Do not make the functions uninlinable.

From-SVN: r120992
2007-01-20 00:30:19 +00:00
Kazu Hirata 44cbf6e454 * decl2.c: Fix a comment typo.
From-SVN: r120240
2006-12-28 06:48:38 +00:00
Jan Hubicka 8a4a83ed92 Move all varpool routines out of cgraph/cgraphunit to varpool.c
Move all varpool routines out of cgraph/cgraphunit to varpool.c
	* cgraph.c: Update comments.
	(cgraph_varpool_hash,
	cgraph_varpool_nodes, cgraph_varpool_last_needed_node
	cgraph_varpool_node_name, cgraph_varpool_node,
	cgraph_varpol_mode_for_asm, cgraph_varpool_mark_needed_node,
	cgraph_variable_initializer_availability): Move to
	varpool.c and drop cgraph_ prefixes.
	(cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue,
	cgraph_varpool_first_unanalyzed_node, cgraph_varpool_finalize_decl):
	move to varpool.c; drop cgraph_ prefix; make static.
	(dump_cgraph_varpool_node): Move to varpool.c under name
	dump_varpool_node.
	(dump_varpool, hash_varpool_node, eq_varpool_node,
	decide_is_variable_needed): Move to varpool.c
	(decl_assembler_name_equal): Move to tree.c.
	(availability_names): Rename to ...
	(cgraph_availability_names): ... this one.
	(dump_cgraph_node): Update.
	* cgraph.h: Reorder declarations now in varpool.c
	(cgraph_vailablity_names): Declare.
	(struct cgraph_varpool_node): Rename to ...
	(struct varpool_node): ... this one.
	(cgraph_varpool_first_unanalyzed_node, cgraph_varpool_nodes_queue,
	cgraph_varpool_first_unanalyzed_node, cgraph_varpool_node,
	cgraph_varpool_node_for_asm, cgraph_varpool_mark_needed_node,
	cgraph_varpool_finalize_decl, cgraph_varpool_enqueue_needed_node,
	cgraph_varpool_reset_queue, cgraph_varpool_assemble_pending_decls,
	cgraph_variable_initializer_availability): Rename to ...
	(varpool_first_unanalyzed_node, varpool_nodes_queue,
	varpool_first_unanalyzed_node, varpool_node,
	varpool_node_for_asm, varpool_mark_needed_node,
	varpool_finalize_decl, varpool_enqueue_needed_node,
	varpool_assemble_pending_decls, variable_initializer_availability):
	Rename to ...
	* tree.c (decl_assembler_name_equal): Move here from cgraph.c.
	* tree.h (decl_assembler_name_equal): Declare.
	* omp-low.c (lower_omp_critical): Update.
	* ipa-reference (analyze_variable, static_execute): Likewise.
	* toplev.c (wrapup_global_declaration_2, compile_file): Update.
	* cgraphunit.c: Update comments.
	(cgraph_varpool_assembled_nodes_queue): Move to varpool.c under name
	varpool_assembled_nodes_queue.
	(cgraph_varpool_analyze_pending_decls): Move to varpool.c under name
	varpool_analyze_pending_decls.
	(cgraph_varpool_remove_unreferenced_decls): Move to varpool.c under name
	varpool_remove_unreferenced_decls.
	(record_reference): Update.
	(cgraph_create_edges): Update.
	(record_referneces_in_initializer): New function.
	(cgraph_varpool_assemble_decl): Move to varpool.c under name
	varpool_assemble_decl; make global.
	(cgraph_varpool_assemble_pending_decls): Move to varpool.c under name
	varpool_assemble_pending_decls.
	(process_function_and_variable_attributes, cgraph_finalize_compilation_unit,
	struct cgraph_order_sort, cgraph_output_in_order,
	cgraph_function_and_variable_invisibility, cgraph_optimize,
	cgraph_increase_alignment): Update.
	* dwarf2out.c (decls_for_scope): Likewise.
	* ipa-type-escape.c (analyze_variable, type_escape_execute): Likewise.
	* except.c (output_ttype): Likewise.
	* varasm.c (mark_decl_referenced): Likewise.
	(find_decl_and_mark_referenced, assemble_alias): update.
	* Makefile.in: Add varpool.c, gt-varpool.c and remove gt-cgraphunit.c
	* passes.c (rest_of_decl_compilation): Update.

	* cp/decl2.c (var_finalized_p): Update for renamed varpool functions.
	* fortran/f59-lang.c (gfc_expand_function): Update for renamed varpool functions.

From-SVN: r119731
2006-12-11 08:07:52 +00:00