Commit Graph

892 Commits

Author SHA1 Message Date
Kazu Hirata 1634705dd6 cp-tree.h, [...]: Fix comment typos.
* cp-tree.h, decl.c, decl2.c, semantics.c: Fix comment typos.
	Follow spelling conventions.

From-SVN: r103926
2005-09-06 02:12:30 +00:00
Mark Mitchell 2725073463 re PR c++/23699 (rejects static int as non constant after "extern template")
PR c++/23699
	* decl2.c (mark_used): Always instantiate static data members
	initialized by constant expressions.
	* pt.c (instantiate_decl): Instantiate the initializers for static
	data members initialized by constant expressions.

	PR c++/21687
	* semantics.c (expand_or_defer_fn): Do not call ggc_collect when
	finishing processing for a template function in a local class.
	Revert:
	2005-09-02  Mark Mitchell  <mark@codesourcery.com>
	* parser.c (cp_parser_class_specifier): Push/pop GC contexts
	around functions in local classes.

	PR c++/23699
	* g++.dg/ext/static1.C: New test.

From-SVN: r103806
2005-09-03 18:18:48 +00:00
Andrew Pinski 7932444251 re PR objc++/23640 (obj-c++ does not call __objc_exec_class for the classes)
2005-08-31  Andrew Pinski  <pinskia@physics.uc.edu>

        PR obj-c++/23640
        * decl2.c (cp_finish_file): If this is obj-c++ and we need a static
        init, call generate_ctor_or_dtor_function.

2005-08-31  Andrew Pinski  <pinskia@physics.uc.edu>

        PR obj-c++/23640
        * obj-c++.dg/gnu-runtime-3.mm: New test.

From-SVN: r103673
2005-08-31 06:46:06 -07:00
Volker Reichelt ea7ce50bf7 re PR c++/23266 (ICE on pure specifier for static method)
PR c++/23266
	* decl2.c (grokfield): Check that method is not static before
	marking it as pure.

	PR c++/23266
	* g++.dg/inherit/pure1.C: New test.

	* ChangeLog: Fix typos.

From-SVN: r103006
2005-08-11 22:46:29 +00:00
Giovanni Bajo 4038c495fc Make CONSTRUCTOR use VEC to store initializers.
* c-common.c (complete_array_type): Update to cope with VEC in
	CONSTRUCTOR_ELTS.
	* c-pretty-print.c (pp_c_initializer_list): Use pp_c_constructor_elts.
	(pp_c_constructor_elts): New function.
	* c-pretty-print.h (pp_c_constructor_elts): Declare.
	* c-typeck.c (build_function_call, build_c_cast, digest_init,
	struct constructor_stack, struct initializer_stack,
	constructor_elements, push_init_level, pop_init_level,
	add_pending_init, find_init_member, output_init_element): Update to
	cope with VEC in CONSTRUCTOR_ELTS.
	* coverage.c (build_fn_info_value, build_ctr_info_value,
	build_gcov_info): Likewise.
	* expr.c (categorize_ctor_elements_1, store_constructor,
	expand_expr_real_1): Likewise.
	* fold-const.c (fold_ternary): Likewise.
	* gimplify.c (gimplify_init_ctor_preeval, zero_sized_field_decl,
	gimplify_init_constructor, gimplify_expr): Likewise.
	* tree-dump.c (dequeue_and_dump): Likewise.
	* tree-inline.c (copy_tree_r): Add code to duplicate a CONSTRUCTOR
	node.
	* tree-pretty-print.c (dump_generic_node): Update to cope with VEC in
	CONSTRUCTOR_ELTS.
	* tree-sra.c (generate_element_init_1): Likewise.
	* tree-ssa-ccp.c (fold_const_aggregate_ref): Likewise.
	* tree-ssa-operands.c (get_expr_operands): Likewise.
	* tree-vect-generic.c (expand_vector_piecewise): Likewise.
	* tree-vect-transform.c (vect_get_vec_def_for_operand):
	(get_initial_def_for_reduction): Likewise.
	* tree-vn.c (set_value_handle, get_value_handle): CONSTURCTOR uses
	value handle in annotations.
	* tree.c (tree_node_kind, tree_code_size, make_node_stat,
	tree_node_structure): Add support for constr_kind.
	(build_vector_from_ctor, build_constructor_single,
	build_constructor_from_list): New functions.
	(build_constructor): Update to take a VEC instead of a TREE_LIST.
	(simple_cst_equal, iterative_hash_expr, initializer_zerop, walk_tree):
	Update to cope with VEC in CONSTRUCTOR_ELTS.
	* tree.def (CONSTRUCTOR): Make it a tcc_exceptional node.
	* tree.h (FOR_EACH_CONSTRUCTOR_VALUE, FOR_EACH_CONSTRUCTOR_ELT,
	CONSTRUCTOR_APPEND_ELT): New macros.
	(struct constructor_elt, struct	tree_constructor): New data types.
	(union tree_node): Add tree_constructor field.
	* treestruct.def: Define TS_CONSTRUCTOR.
	* varasm.c (const_hash_1, compare_constant, copy_constant,
	compute_reloc_for_constant, output_addressed_constants,
	initializer_constant_valid_p, output_constant,
	array_size_for_constructor, output_constructor): Update to cope with
	VEC in CONSTRUCTOR_ELTS.
	* vec.h (VEC_empty, VEC_copy): New macros.

ada/
	Make CONSTRUCTOR use VEC to store initializers.
	* decl.c (gnat_to_gnu_entity): Update to cope with VEC in
	CONSTRUCTOR_ELTS.
	* trans.c (extract_values): Likewise.
	* utils.c (convert, remove_conversions): Likewise.
	* utils2.c (contains_save_expr_p, build_binary_op, build_unary_op,
	gnat_build_constructor): Likewise.

cp/
	Make CONSTRUCTOR use VEC to store initializers.
	* call.c (convert_default_arg): Update call to digest_init.
	* class.c (dump_class_hierarchy, dump_array): Update to cope with
	VEC in CONSTRUCTOR_ELTS.
	* cp-tree.h (EMPTY_CONSTRUCTOR_P): Likewise.
	(finish_compound_literal, digest_init): Update declaration.
	* decl.c (struct reshape_iter): New data type.
	(reshape_init_array): Rename to...
	(reshape_init_array_1): Update to cope with VEC in CONSTRUCTOR_ELTS.
	(reshape_init): Rewrite from scratch. Split parts into...
	(reshape_init_array, reshape_init_vector, reshape_init_class,
	reshape_init_r): New functions.
	(check_initializer): Update call to reshape_init. Remove obsolete
	code.
	(initialize_artificial_var, cp_complete_array_type): Update to cope
	with VEC in CONSTRUCTOR_ELTS.
	* decl2.c (grokfield): Update calls to digest_init.
	(mark_vtable_entries): Update to cope with VEC in CONSTRUCTOR_ELTS.
	* error.c (dump_expr_init_vec): New function.
	(dump_expr): Use dump_expr_init_vec.
	* init.c (build_zero_init, build_vec_init): Update to cope with VEC
	in CONSTRUCTOR_ELTS.
	(expand_default_init): Update call to digest_init.
	* parser.c  (cp_parser_postfix_expression): Use a VEC for the
	initializers.
	(cp_parser_initializer_list): Build a VEC of initializers.
	* pt.c (tsubst_copy, tsubst_copy_and_build): Update to cope with VEC
	in CONSTRUCTOR_ELTS.
	* rtti.c (tinfo_base_init, generic_initializer, ptr_initializer,
	ptm_initializer, class_initializer, get_pseudo_ti_init): Use
	build_constructor_from_list instead of build_constructor.
	* semantics.c (finish_compound_literal): Update call to digest_init.
	* tree.c (stabilize_init): Update to cope with VEC in
	CONSTRUCTOR_ELTS.
	* typeck.c (build_ptrmemfunc1): Likewise.
	* typeck2.c: (cxx_incomplete_type_error, split_nonconstant_init_1):
	Likewise.
	(store_init_value): Use build_constructor_from_list and update call
	to digest_init.
	(digest_init): Rewrite.
	(process_init_constructor): Rewrite from scratch. Split into...
	(process_init_constructor_array, picflag_from_initializer,
	process_init_constructor_record, process_init_constructor_union):
	New functions.
	(PICFLAG_ERRONEOUS, PICFLAG_NOT_ALL_CONSTANT, PICFLAG_NOT_ALL_SIMPLE):
	New macros.
	(build_functional_cast): Use build_constructor_from_list instead of
	build_constructor.

fortran/
	Make CONSTRUCTOR use VEC to store initializers.
	* trans-array.c (gfc_build_null_descriptor,
	gfc_trans_array_constructor_value, gfc_conv_array_initializer):
	Update to cope with VEC in CONSTRUCTOR_ELTS.
	* trans-common.c (create_common): Likewise.
	* trans-expr.c (gfc_conv_structure): Likewise.
	* trans-stmt.c (gfc_trans_character_select): Use
	build_constructor_from_list instead of build_constructor.

java/
	Make CONSTRUCTOR use VEC to store initializers.
	* check-init.c (check_init): Update to cope with VEC in
	CONSTRUCTOR_ELTS.
	* class.c (make_field_value, make_method_value, get_dispatch_table,
	make_class_data, emit_symbol_table, emit_catch_table,
	emit_assertion_table): Use build_constructor_from_list instead of
	build_constructor.
	* constants.c (build_constants_constructor): Likewise.
	* java-gimplify.c (java_gimplify_new_array_init): Update to cope with
	VEC in CONSTRUCTOR_ELTS.
	* java-tree.h (START_RECORD_CONSTRUCTOR, PUSH_SUPER_VALUE,
	PUSH_FIELD_VALUE, FINISH_RECORD_CONSTRUCTOR): Create a VEC instead
	of a TREE_LIST.
	* jcf-write.c (generate_bytecode_insns): Update to cope with VEC in
	CONSTRUCTOR_ELTS.
	* parse.y (build_new_array_init): Use build_constructor_from_list
	instead of build_constructor.
	(patch_new_array_init): Update to cope with VEC in
	CONSTRUCTOR_ELTS.
	(array_constructor_check_entry): Likewise.

objc/
	Make CONSTRUCTOR use VEC to store initializers.
	* objc-act.c (objc_build_constructor): Use build_constructor_from_list
	instead of build_constructor.

testsuite/
	Make CONSTRUCTOR use VEC to store initializers.
	* g++.dg/ext/complit3.C: Check for specific error messages.
	* g++.dg/init/brace2.C: Update error message.
	* g++.dg/warn/Wbraces2.C: Likewise.

From-SVN: r102182
2005-07-20 01:19:59 +00:00
Mark Mitchell eba839f971 re PR c++/22263 (explicit instantiation fails to emit symbols defined later)
PR c++/22263
	* cp-tree.h (instantiate_decl): Change prototype.
	* decl2.c (mark_used): Adjust accordingly.
	* pt.c (do_decl_instantiation): Likewise.
	(instantiate_class_member): Likewise.
	(instantiate_decl): Rename undefined_ok as expl_inst_class_mem_p.
	Clear DECL_INTERFACE_KNOWN for an explicitly instantiated template
	that has no definition available.
	(instantiate_pending_templates): Adjust call to instantiate_decl.

	PR c++/22263
	* g++.dg/template/explicit7.C: New test.

From-SVN: r102133
2005-07-18 15:44:36 +00:00
Daniel Berlin 820cc88fbd Makefile.in (TREE_H): Add treestruct.def.
2005-07-08  Daniel Berlin  <dberlin@dberlin.org>

	* Makefile.in (TREE_H): Add treestruct.def.
	(c-decl.o): Add pointer-set.h
	* c-decl.c (diagnose_mismatched_decls): Don't attempt to look at
	visibility on regular DECL's.
	(merge_decls): Fix the copying of decl nodes of various types for
	the new structures.  Don't update RTL, section name, weak status,
	etc, on DECL's without RTL.
	(grokdeclarator): DECL_ARG_TYPE_AS_WRITTEN is gone.
	Don't check volatile on non-variable types.
	(store_parm_decls_oldstyle): Use pointer_set instead of DECL_WEAK
	to check whether we have seen arguments.
	* c-objc-common.c (c_tree_printer): Reverse order of tests so that
	flag is checked before field (flag is common, field is not).
	* dwarf2out.c (decl_ultimate_origin):  Only DECL's with
	TS_DECL_COMMON could have an origin.
	(add_location_or_const_value_attribute): Don't check section name
	on non-var/function decls.
	(dwarf2out_var_location): Reverse order of tests.
	* emit-rtl.c (set_reg_attrs_for_parm): DECL_CHECK is dead, replace
	with DECL_WRTL_CHECK.
	* expmed.c (make_tree): rtl is now in decl_with_rtl.
	* fold-const.c (fold_binary): Don't check weakness on
	non-var/function decls.
	(tree_expr_nonzero_p): Ditto.
	(fold_checksum_tree): Use tree_decl_extra as sizeof
	buffer.
	* ggc-page.c (extra_order_size_table): Add sizes for
	tree_decl_non_common, tree_parm_decl,  tree_var_decl, and
	tree_field_decl.
	* gimplify.c (gimplify_bind_expr): Only set
	DECL_SEEN_IN_BIND_EXPR_P on VAR_DECL.
	* integrate.c (copy_decl_for_inlining): Don't set RTL on decl's
	without RTL.
	* langhooks-def.h (LANG_HOOK_INIT_TS): New.
	* langhooks.h (init_ts). New langhook.
	* passes.c (rest_of_decl_compilation): Reverse order of tests.
	* print-tree.c (print_node): Update to only print fields that
	exist in the structures the passed decl has.
	* toplev.c (wrapup_global_declarations): Don't reset
	DECL_DEFER_OUTPUT on DECL's that don't contain it.
	* tree-browser.c (browse_tree): DECL_ARG_TYPE_AS_WRITTEN removed.
	* tree-inline.c (remap_decl): Ditto.
	* tree-outof-ssa.c (create_temp): Reverse order of tests.
	* tree-pretty-print.c (print_declaration): Don't print
	DECL_REGISTER on things that don't contain it.
	* tree-vrp.c (expr_computes_nonzero): Don't check weakness on
	non-var/function decls.
	* tree.c (tree_contains_struct): New structure.
	(init_priority_for_decl): New hashtable.
	(tree_int_map): New structure.
	(tree_int_map_eq): New function.
	(tree_int_map_marked_p): Ditto.
	(tree_int_map_hash): Ditto.
	(tree_map): Move to tree.h.
	(tree_map_eq): Externalize.
	(tree_map_hash): Ditto.
	(tree_map_marked_p): Ditto.
	(init_ttree): Set up tree_contains_struct and call langhook.
	(decl_assembler_name): Use DECL_NON_COMMON_CHECK..
	(tree_code_size): Update for new structures.
	(tree_node_structure): Update for new structures.
	(make_node_stat): Don't try to set DECL_IN_SYSTEM_HEADER on decls
	without the field.
	(copy_node_stat):  Copy init priority.
	(build_decl_stat): Ditto for visibility.
	(ts_enum_names): New.
	(tree_contains_struct_check_failed): New function.
	(decl_init_priority_lookup): Ditto.
	(decl_init_priority_insert): Ditto.
	* treestruct.def: New file.
	* tree.h (CODE_CONTAINS_STRUCT): New macro.
	(CONTAINS_STRUCT_CHECK): Ditto.
	(tree_contains_struct_check_failed): New prototype.
	(DECL_CHECK): Removed.
	(DECL_MINIMAL_CHECK): New.
	(DECL_COMMON_CHECK): Ditto.
	(DECL_WRTL_CHECK): Ditto.
	(DECL_NON_COMMON_CHECK): Ditto.
	(DECL_WITH_VIS_CHECK): Ditto.
	(VAR_OR_FUNCTION_DECL_P): Ditto
	(struct tree_decl_minimal): New structure.
	(struct tree_decl_common): Ditto.
	(struct tree_decl_with_rtl): Ditto.
	(struct tree_decl_with_vis): Ditto.
	(struct tree_decl_non_common): Ditto.
	(struct tree_field_decl): Ditto.
	(struct tree_parm_decl): Ditto.
	(struct tree_var_decl): Ditto.
	(struct tree_function_decl): Ditto.
	(struct tree_const_decl): Ditto.
	(struct tree_result_decl): Ditto.
	(union tree_node): Add new structures.
	* var-tracking.c (track_expr_p): Reverse order of tests.

	* doc/c-tree.texi: Add documentation on DECL node internal structure.


2005-07-08  Daniel Berlin  <dberlin@dberlin.org>

	* utils.c (create_param_decl): DECL_ARG_TYPE_AS_WRITTEN is
	removed.

2005-07-08  Daniel Berlin  <dberlin@dberlin.org>

	* Make-lang.in: Add gt-cp-lang.h.
	(cp-lang.o): Ditto.
	* class.c (create_vtable_ptr): Stop setting DECL_ASSEMBLER_NAME on
	the field.
	* config-lang.in: Add cp-lang.c to gtfiles.
	* cp-lang.c: Include hashtab.h.
	(cp_init_ts): New function.
	(LANG_HOOK_INIT_TS): Use macro.
	(decl_shadowed_for_var_lookup): New function.
	(decl_shadowed_for_var_insert): Ditto.
	* cp-tree.h (THUNK_FUNCTION_CHECK): Use decl_common.
	(NON_THUNK_FUNCTION_CHECK): Ditto.
	(DECL_NAMESPACE_ASSOCIATIONS): Use decl_non_common.
	(DECL_INIT_PRIORITY): Ditto.
	(DECL_HAS_SHADOWED_FOR_VAR_P): Ditto.
	(DECL_SHADOWED_FOR_VAR): Use hashtable.
	(SET_DECL_SHADOWED_FOR_VAR): Ditto.
	* decl.c (duplicate_decls): Update for new/updated structures.
	(poplevel): Use SET_DECL_SHADOWED_FOR_VAR.
	* decl2.c (start_static_initialization_or_destruction): Deal with
	priority.
	* pt.c (tsubst_decl): Check TS_DECL_WRTL before doing
	SET_DECL_RTL.
	* tree.c (handle_init_priority_attribute): Handle priority.

2005-07-08  Daniel Berlin  <dberlin@dberlin.org>

	* objc-act.c (objc_push_parm): DECL_ARG_TYPE_AS_WRITTEN is
	removed.
	* objc-act.h (KEYWORD_ARG_NAME): Use decl_non_common.
	(KEYWORD_KEY_NAME): Use decl_minimal.
	(METHOD_SEL_NAME): Ditto..
	(METHOD_SEL_ARGS): Use decl_non_common.
	(METHOD_ADD_ARGS): Ditto.
	(METHOD_ADD_ARGS_ELLIPSIS_P): Use decl_common.
	(METHOD_DEFINITION): Ditto.
	(METHOD_ENCODING): Ditto.
	* objc-lang.c: (objc_init_ts): New function.

2005-07-08  Daniel Berlin  <dberlin@dberlin.org>

	* trans-decl.c (create_function_arglist): DECL_ARG_TYPE_AS_WRITTEN
	is removed.

From-SVN: r101799
2005-07-08 23:37:11 +00:00
Paolo Bonzini ef3303124e Makefile.in: Adjust dependencies.
2005-07-05  Paolo Bonzini  <bonzini@gnu.org>

	* Makefile.in: Adjust dependencies.
	* tree-pass.h: Add new passes and passes formerly in tree-optimize.c.
	* basic-block.h (duplicate_computed_gotos): Remove, it is now static.
	* alias.c (rest_of_handle_cfg, pass_cfg): New.
	* bb-reorder.c (duplicate_computed_gotos): Make it static.
	* cfgexpand.c (tree_expand_cfg): Add code formerly at the beginning of
	rest_of_compilation.

	* bb-reorder.c (gate_duplicate_computed_gotos,
	pass_duplicate_computed_gotos, gate_handle_reorder_blocks,
	rest_of_handle_reorder_blocks, pass_reorder_blocks,
	gate_handle_partition_blocks, rest_of_handle_partition_blocks,
	pass_partition_blocks): New.
	* bt-load.c (gate_handle_branch_target_load_optimize,
	rest_of_handle_branch_target_load_optimize,
	pass_branch_target_load_optimize): New.
	* cfgcleanup.c (rest_of_handle_jump, pass_jump, rest_of_handle_jump2,
	pass_jump2): New.
	* cfglayout.c (pass_insn_locators_initialize): New.
	* cfgrtl.c (pass_free_cfg): New.
	* combine.c (gate_handle_combine, rest_of_handle_combine,
	pass_combine): New.
	* cse.c (gate_handle_cse, rest_of_handle_cse, pass_cse,
	gate_handle_cse2, rest_of_handle_cse2, pass_cse2): New.
	* emit-rtl.c (pass_unshare_all_rtl, pass_remove_unnecessary_notes): New.
	* except.c (pass_set_nothrow_function_flags,
	pass_convert_to_eh_region_ranges, gate_handle_eh, rest_of_handle_eh,
	pass_rtl_eh): New.
	* final.c (pass_compute_alignments, rest_of_handle_final, pass_final,
	rest_of_handle_shorten_branches, pass_shorten_branches,
	rest_of_clean_state, pass_clean_state): New.
	* flow.c (pass_recompute_reg_usage, gate_remove_death_notes,
	rest_of_handle_remove_death_notes, pass_remove_death_notes,
	rest_of_handle_life, pass_life, rest_of_handle_flow2,
	pass_flow2): New.
	* function.c (pass_instantiate_virtual_regs, pass_init_function,
	rest_of_handle_check_leaf_regs, pass_leaf_regs): New.
	* gcse.c (gate_handle_jump_bypass, rest_of_handle_jump_bypass,
	pass_jump_bypass, gate_handle_gcse, rest_of_handle_gcse,
	pass_gcse): New.
	* global.c (rest_of_handle_global_alloc, pass_global_alloc): New.
	* ifcvt.c (gate_handle_if_conversion, rest_of_handle_if_conversion,
	pass_rtl_ifcvt, gate_handle_if_after_combine,
	rest_of_handle_if_after_combine, pass_if_after_combine,
	gate_handle_if_after_reload, rest_of_handle_if_after_reload,
	pass_if_after_reload): New.
	* integrate.c (pass_initial_value_sets): New.
	* jump.c (pass_cleanup_barriers, purge_line_number_notes,
	pass_purge_lineno_notes): New.
	* mode-switching.c (rest_of_handle_mode_switching,
	pass_mode_switching): New.
	* local-alloc.c (rest_of_handle_local_alloc, pass_local_alloc): New.
	* loop-init.c (gate_handle_loop2, rest_of_handle_loop2,
	pass_loop2): New.
	* loop.c (gate_handle_loop_optimize, rest_of_handle_loop_optimize,
	pass_loop_optimize): New.
	* modulo-sched.c (gate_handle_sms, rest_of_handle_sms,
	pass_sms): New.
	* postreload-gcse.c (gate_handle_gcse2, rest_of_handle_gcse2,
	pass_gcse2): New.
	* postreload.c (gate_handle_postreload, rest_of_handle_postreload,
	pass_postreload_cse): New.
	* profile.c (gate_handle_profiling, pass_profiling,
	rest_of_handle_branch_prob, pass_branch_prob): New.
	* recog.c (pass pass_split_for_shorten_branches, gate_do_final_split,
	pass_split_before_regstack, gate_handle_split_before_regstack,
	gate_handle_peephole2, rest_of_handle_peephole2, pass_peephole2,
	rest_of_handle_split_all_insns, pass_split_all_insns): New.
	* reg-stack.c (gate_handle_stack_regs, rest_of_handle_stack_regs,
	pass_stack_regs): New.
	* regmove.c (gate_handle_regmove, rest_of_handle_regmove, pass_regmove,
	gate_handle_stack_adjustments, rest_of_handle_stack_adjustments,
	pass_stack_adjustments): New.
	* regrename.c (gate_handle_regrename, rest_of_handle_regrename,
	pass_regrename): New.
	* reorg.c (gate_handle_delay_slots, rest_of_handle_delay_slots,
	pass_delay_slots, gate_handle_machine_reorg,
	rest_of_handle_machine_reorg, pass_machine_reorg): New.
	* rtl.h (extern void purge_line_number_notes): New.
	* sched-rgn.c (gate_handle_sched, rest_of_handle_sched,
	gate_handle_sched2, rest_of_handle_sched2, pass_sched,
	pass_sched2): New.
	* tracer.c (gate_handle_tracer, rest_of_handle_tracer,
	pass_tracer): New.
	* value-prof.c (gate_handle_value_profile_transformations,
	rest_of_handle_value_profile_transformations,
	pass_value_profile_transformations): New.
	* var-tracking.c (gate_handle_var_tracking,
	pass_variable_tracking): New.
	* web.c (gate_handle_web, rest_of_handle_web, pass_web): New.

	* passes.c (open_dump_file, close_dump_file, rest_of_handle_final,
	rest_of_handle_delay_slots, rest_of_handle_stack_regs,
	rest_of_handle_variable_tracking, rest_of_handle_machine_reorg,
	rest_of_handle_old_regalloc, rest_of_handle_regrename,
	rest_of_handle_reorder_blocks, rest_of_handle_partition_blocks,
	rest_of_handle_sms, rest_of_handle_sched, rest_of_handle_sched2,
	rest_of_handle_gcse2, rest_of_handle_regmove,
	rest_of_handle_tracer, rest_of_handle_if_conversion,
	rest_of_handle_if_after_combine, rest_of_handle_if_after_reload,
	rest_of_handle_web, rest_of_handle_branch_prob,
	rest_of_handle_value_profile_transformations, rest_of_handle_cfg,
	rest_of_handle_jump_bypass, rest_of_handle_combine,
	rest_of_handle_life, rest_of_handle_cse, rest_of_handle_cse2,
	rest_of_handle_gcse, rest_of_handle_loop_optimize,
	rest_of_handle_loop2, rest_of_handle_branch_target_load_optimize,
	rest_of_handle_mode_switching, rest_of_handle_jump,
	rest_of_handle_eh, rest_of_handle_stack_adjustments,
	rest_of_handle_flow2, rest_of_handle_jump2,
	rest_of_handle_peephole2, rest_of_handle_postreload,
	rest_of_handle_shorten_branches, rest_of_clean_state,
	rest_of_compilation): Remove.

	* cgraphunit.c (ipa_passes): Moved from tree-optimize.c.
	* passes.c (dump_flags, in_gimple_form, all_passes,
	all_ipa_passes, all_lowering_passes, register_one_dump_file,
	register_dump_files, next_pass_1, last_verified, execute_todo,
	execute_one_pass, execute_pass_list, execute_ipa_pass_list): Moved
	from tree-optimize.c.
	(init_optimization_passes): Moved from tree-optimize.c,
	adding the RTL optimizations.
	* tree-dump.h (dump_info_p, dump_flag): Moved from tree.h.
	* tree-optimize.c (dump_flags, in_gimple_form, all_passes,
	all_ipa_passes, all_lowering_passes, register_one_dump_file,
	register_dump_files, next_pass_1, last_verified, execute_todo,
	execute_one_pass, execute_pass_list, execute_ipa_pass_list,
	init_tree_optimization_passes, ipa_passes): Delete.
	* tree-pass.h (enum tree_dump_index): Moved from tree.h, removing
	the RTL dumps.
	(TDF_*, get_dump_file_name, dump_enabled_p, dump_initialized_p,
	dump_begin, dump_end, dump_node, dump_switch_p, dump_flag_name): Moved
	from tree.h.
	(ipa_passes): Remove.
	(all_passes, all_ipa_passes, all_lowering_passes): Now extern.
	* tree.h (enum tree_dump_index, TDF_*, get_dump_file_name,
	dump_enabled_p, dump_initialized_p, dump_begin, dump_end, dump_node,
	dump_switch_p, dump_flag_name): Moved to tree-pass.h.
	(dump_info_p, dump_flag): Moved to tree-dump.h.

	* Makefile.in: Adjust dependencies for tree-pretty-print.c,
	cgraph.c, opts.c.
	* passes.c (finish_optimization_passes): Use dump_begin
	and dump_end, TDI_end.
	(gate_rest_of_compilation): New.
	(pass_rest_of_compilation): Use it.
	(gate_postreload, pass_postreload): New.
	* toplev.c (general_init): Rename init_tree_optimization_passes.
	* toplev.h (init_tree_optimization_passes): Rename to
	init_optimizations_passes.
	* tree-dump.c (dump_flag): Make static.
	(dump_files): Remove RTL dumps.
	* tree-optimize.c (pass_all_optimizations, pass_early_local_passes,
	pass_cleanup_cfg, pass_free_cfg_annotations,
	pass_cleanup_cfg_post_optimizing, pass_free_datastructures,
	pass_init_datastructures, pass_fixup_cfg): Make non-static.
	* tree-pretty-print.c: Include tree-pass.h.
	* cgraph.c: Include tree-dump.h.

cp:
2005-07-05  Paolo Bonzini  <bonzini@gnu.org>

	* Makefile.in (class.o, decl2.o): Adjust dependencies.
	* class.c: Include tree-dump.h.
	* decl2.c: Include tree-dump.h.

java:
2005-07-05  Paolo Bonzini  <bonzini@gnu.org>

	* Makefile.in (parse.o): Adjust dependencies.
	* parse.y: Include tree-dump.h.

From-SVN: r101627
2005-07-05 16:20:53 +00:00
Joseph Myers dee158440e toplev.c (default_tree_printer): Handle setting location with '+' flag.
2005-07-02  Zack Weinberg  <zack@codesourcery.com>
            Joseph S. Myers  <joseph@codesourcery.com>

	* toplev.c (default_tree_printer): Handle setting location with
	'+' flag.
	* c-objc.common.c (c_tree_printer): Likewise.
	* c-format.c (gcc_diag_flag_specs): Add '+'.
	(gcc_cdiag_char_table): Allow '+' flag for tree formats.
	(format_types_orig): Allow '+' flag for gcc_diag and gcc_cdiag
	formats.
	* c-common.c, c-decl.c, c-objc-common.c, c-pragma.c,
	config/arm/pe.c, config/i386/winnt.c, config/ia64/ia64.c,
	config/mcore/mcore.c, config/sh/symbian.c, config/sol2.c,
	config/v850/v850.c, function.c, stor-layout.c, toplev.c,
	tree-inline.c, tree-optimize.c, tree.c, varasm.c: Use '+' flag
	instead of %J or %H.  Use 'q' flag for quoting.  Avoid '.' at end
	of diagnostics.  Use %q+D not %s for a decl.  Do not pass excess
	format arguments where %J is used without %D.

cp:
	* error.c (location_of): Add comment.
	(locate_error, cp_error_at, cp_warning_at, cp_pedwarn_at): Remove.
	* cp-tree.h (cp_error_at, cp_warning_at, cp_pedwarn_at): Remove.
	* call.c, class.c, decl.c, decl2.c, friend.c, init.c,
	name-lookup.c, parser.c, pt.c, search.c, semantics.c, typeck.c,
	typeck2.c: Use '+' flag instead of %J, cp_error_at, cp_warning_at
	or cp_pedwarn_at.  Mark up some diagnostic strings with N_.

java:
	* class.c, decl.c, expr.c: Use '+' flag instead of %J.  Use 'q'
	flag for quoting.

objc:
	* objc-act.c: Use '+' flag instead of %J.  Use 'q' flag for
	quoting.

testsuite:
	* gcc.dg/format/gcc_diag-1.c: Update.

From-SVN: r101532
2005-07-02 11:55:32 +01:00
Kelley Cook 1788952fea Update FSF address.
From-SVN: r101312
2005-06-25 00:59:41 +00:00
Mike Stump 0cbd750645 Canonicalize whitespace.
From-SVN: r100965
2005-06-15 00:41:35 +00:00
Mike Stump c8094d835f Remove extra white spacing at end of lines.
From-SVN: r100952
2005-06-14 20:01:59 +00:00
Nathan Sidwell b2a9b2086a re PR c++/20637 (Confusing message with different using declarations)
cp:
PR c++/20637
	* cp-tree.h (add_method): Add using_decl parameter.
	* class.c (add_method): Add using_decl parameter.  Adjust error
	messages.
	(handle_using_decl): Pass the using decl to add_method.
	(clone_function_decl): Adjust add_member calls.
	* decl2.c (check_classfn): Likewise.
	* method.c (lazily_declare_fn): Likewise.
	* semantics.c (finish_member_declaration): Likewise.

	* method.c (synthesize_method): Use inform, not warning.
testsuite:
	PR c++/20637
	* g++.dg/inherit/using4.C: New.
	* g++.dg/overload/error1.C: Adjust expected errors.
	* g++.old-deja/g++.benjamin/warn02.C: Likewise.
	* g++.old-deja/g++.brendan/arm2.C: Likewise.
	* g++.old-deja/g++.other/redecl2.C: Likewise.
	* g++.old-deja/g++.other/redecl4.C: Likewise.
	* g++.old-deja/g++.pt/memtemp78.C: Likewise.

From-SVN: r100664
2005-06-06 14:18:22 +00:00
Nathan Sidwell 3e3935a94c re PR c++/21280 (#pragma interface, templates, and "inline function used but never defined")
cp:
	PR c++/21280
	* Make-lang.in (method.o): Add diagnostic.h
	* decl.c (start_preparsed_function): Use decl's location for file
	info.
	* decl2.c (cp_finish_file): Set input_location before synthesizing
	a function.
	(mark_used): When deferring a synthesized function, save current
	location.  Do not set function's location when actually
	synthesizing it.
	* method.c: #include diagnostic.h.
	(synthesize_method): Set the functions source location.  Show
	needed location if errors are emitted.
testsuite:
	PR c++/21280
	* g++.dg/opt/interface2.h: New.
	* g++.dg/opt/interface2.C: New.
	* g++.dg/init/ctor4.C: Adjust error lines.
	* g++.old-deja/g++.bob/inherit2.C: Likewise.
	* g++.old-deja/g++.bugs/900205_04.C: Likewise.
	* g++.old-deja/g++.jason/opeq3.C: Likewise.
	* g++.old-deja/g++.pt/assign1.C: Likewise.
	* g++.old-deja/g++.pt/crash20.C: Likewise.

From-SVN: r100500
2005-06-02 17:52:28 +00:00
Richard Henderson 6de33afa78 re PR libgcj/21692 (unexpected java.lang.NoClassDefFoundError)
PR libgcj/21692
cp/
        * cp-tree.h (make_alias_for): Declare.
        * decl2.c (build_java_method_aliases): New.
        (cp_finish_file): Call it.
        * method.c (make_alias_for): Split out from ...
        (make_alias_for_thunk): ... here.

java/
        * Make-lang.in (java/mangle.o): Depend on LANGHOOKS_DEF_H.
        * class.c (build_class_ref): Set DECL_CLASS_FIELD_P and
        DECL_CONTEXT; avoid pushdecl_top_level.
        (build_dtable_decl): Set DECL_VTABLE_P and DECL_CONTEXT.
        (layout_class): Don't SET_DECL_ASSEMBLER_NAME.
        (layout_class_method): Likewise.
        * decl.c (java_mark_cni_decl_local): New.
        (java_mark_class_local): Use it.
        * java-tree.h (DECL_LOCAL_CNI_METHOD_P): New.
        (DECL_CLASS_FIELD_P, DECL_VTABLE_P): New.
        (struct lang_decl_func): Add local_cni;
        (struct lang_decl_var): Add class_field, vtable.
        (java_mangle_decl): Declare.
        * lang.c (LANG_HOOKS_SET_DECL_ASSEMBLER_NAME): New.
        * mangle.c: Remove dup obstack.h; include langhooks-def.h.
        (mangle_obstack_1): New.
        (java_mangle_decl): Remove obstack argument.  Call mangle_class_field,
        mangle_vtable, and mangle_local_cni_method_decl.  Fall back to
        lhd_set_decl_assembler_name for things that don't need mangling.
        (mangle_class_field): Rename from java_mangle_class_field, make
        static, don't call init_mangling or finish_mangling.
        (mangle_vtable): Similarly.
        (mangle_local_cni_method_decl): New.
        (init_mangling): Remove obstack argument.  Use &mangle_obstack_1,
        gcc_assert, and MANGLE_RAW_STRING.
        (finish_mangling): Use gcc_assert, remove if 0 debugging code.

From-SVN: r100171
2005-05-25 15:08:31 -07:00
H.J. Lu 271bed0e99 re PR libstdc++/19664 (libstdc++ headers should have pop/push of the visibility around the declarations)
2005-05-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR C++/19664
	* decl2.c (determine_visibility): Don't set visibility to
	hidden if it has been set explicitly by user.

From-SVN: r99861
2005-05-17 14:47:13 -07:00
Ziemowit Laski e58a9aa1f6 Yet more Objective-C++...
* cp-objcp-common.h (cxx_get_alias_set): Move from
        here...
        (cxx_warn_unused_global_decl): Likewise.
        (cp_expr_size): Likewise.
        (cp_tree_size): Likewise.
        (cp_var_mod_type_p): Likewise.
        (cxx_initialize_diagnostics): Likewise.
        (cxx_types_compatible_p): Likewise.
        * cp-tree.h: to here.
        (do_poplevel): Add.
        * lex.c (D_OBJC): Add.
        (init_reswords): Add.
        * Make-lang.in (cp/pt.o): Add cp/cp-objcp-common.h.
        * parser.c: Add c-common.h include.
        * pt.c: Add c-common.h and cp-objcp-common.h includes.
        (template_args_equal): Use objc_comptypes as well.
        (tsubst_copy_and_build): Use objcp_tsubst_copy_and_build as well.
        * semantics.c (do_poplevel): Remove static.

        * decl.c (objc_mark_locals_volatile): Don't change decls that are
        already ok.
        * decl2.c (generate_ctor_or_dtor_function): Add code to initialize
        Objective C++ early enough.
        * lex.c (struct resword reswords): Add Objective-C++ support.
        * parser.c (cp_lexer_get_preprocessor_token): Add Objective-C++.
        (cp_parser_objc_message_receiver): Add.
        (cp_parser_objc_message_args): Likewise.
        (cp_parser_objc_message_expression): Likewise.
        (cp_parser_objc_encode_expression): Likewise.
        (cp_parser_objc_defs_expression): Likewise.
        (cp_parser_objc_protocol_expression): Likewise.
        (cp_parser_objc_selector_expression): Likewise.
        (cp_parser_objc_expression): Likewise.
        (cp_parser_objc_visibility_spec): Likewise.
        (cp_parser_objc_method_type): Likewise.
        (cp_parser_objc_protocol_qualifiers): Likewise.
        (cp_parser_objc_typename): Likewise.
        (cp_parser_objc_selector_p): Likewise.
        (cp_parser_objc_selector): Likewise.
        (cp_parser_objc_method_keyword_params): Likewise.
        (cp_parser_objc_method_tail_params_opt): Likewise.
        (cp_parser_objc_interstitial_code): Likewise.
        (cp_parser_objc_method_signature): Likewise.
        (cp_parser_objc_method_prototype_list): Likewise.
        (cp_parser_objc_method_definition_list): Likewise.
        (cp_parser_objc_class_ivars): Likewise.
        (cp_parser_objc_identifier_list): Likewise.
        (cp_parser_objc_alias_declaration): Likewise.
        (cp_parser_objc_class_declaration): Likewise.
        (cp_parser_objc_protocol_declaration): Likewise.
        (cp_parser_objc_protocol_refs_opt): Likewise.
        (cp_parser_objc_superclass_or_category): Likewise.
        (cp_parser_objc_class_interface): Likewise.
        (cp_parser_objc_class_implementation): Likewise.
        (cp_parser_objc_end_implementation): Likewise.
        (cp_parser_objc_declaration): Likewise.
        (cp_parser_objc_try_catch_finally_statement): Likewise.
        (cp_parser_objc_synchronized_statement): Likewise.
        (cp_parser_objc_throw_statement): Likewise.
        (cp_parser_objc_statement): Likewise.
        (cp_parser_primary_expression): Add Objective-C++.
        (cp_parser_statement): Likewise.
        (cp_parser_declaration): Likewise.
        (cp_parser_simple_type_specifier): Likewise.
        (cp_parser_type_name): Likewise.
        (cp_parser_parameter_declaration_list): Likewise.
        (cp_parser_member_declaration) Likewise.
        * tree.c: Include debug.h.
        * typeck.c (composite_pointer_type): Add Objective-C++ support.
        (finish_class_member_access_expr): Likewise.
        (build_function_call): Allow objc to rewrite FUNCTION_DECLs.
        (build_modify_expr): Allow objc to generate write barriers.

        * Make-lang.in (cp/tree.o): Add debug.h.
        * tree.c (lvalue_p_1, case CONST_DECL): Add.

From-SVN: r99855
2005-05-17 20:05:24 +00:00
Kazu Hirata 2b41c04016 decl2.c (pending_statics, [...]): Use VEC instead of VARRAY.
* decl2.c (pending_statics, note_vague_linkage_var,
	cp_finish_file): Use VEC instead of VARRAY.
	(pending_statics_used): Remove.

From-SVN: r99329
2005-05-06 19:03:35 +00:00
Kazu Hirata 1bc5f355d9 decl2.c (ssdf_decls, [...]): Use VEC instead of VARRAY.
* decl2.c (ssdf_decls, start_static_storage_duration_function,
	generate_ctor_or_dtor_function): Use VEC instead of VARRAY.

From-SVN: r99319
2005-05-06 14:24:20 +00:00
Kazu Hirata 6394d87daf * decl2.c (spew_debug): Remove.
From-SVN: r99317
2005-05-06 14:10:35 +00:00
Kazu Hirata 125121e2fb decl2.c (deferred_fns, [...]): Use VEC instead of VARRAY.
* decl2.c (deferred_fns, note_vague_linkage_fn,
	cp_finish_file): Use VEC instead of VARRAY.

From-SVN: r99290
2005-05-05 21:57:46 +00:00
DJ Delorie d4ee4d2525 diagnostic.c (warning): Accept parameter to classify warning option.
* diagnostic.c (warning): Accept parameter to classify warning option.
(warning0): New, for when a pointer to an error() like function is needed.
* errors.c (warning): Likewise.
* errors.h (warning, warning0): Adjust prototypes.
* toplev.h (warning, warning0): Likewise.

* attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c,
c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c,
c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c,
fold-const.c, fortran/trans-decl.c, function.c, gcse.c,
genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c,
reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c,
tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c,
tree-ssa.c, tree.c, varasm.c: Adjust warning() callers.

* config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c,
config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c,
config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c,
config/darwin.c, config/darwin.h, config/h8300/h8300.c,
config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c,
config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c,
config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c,
config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c,
config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h,
config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h,
config/rs6000/aix52.h, config/rs6000/darwin.h,
config/rs6000/rs6000-c.c, config/rs6000/rs6000.c,
config/s390/s390.c, config/sh/sh.c, config/sh/sh.h,
config/sh/symbian.c, config/sol2-c.c, config/sol2.c,
config/stormy16/stormy16.c, config/v850/v850-c.c,
config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning()
callers.

* ada/misc.c: Adjust warning() callers.

* cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c,
cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c,
cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c,
cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers.

* fortran/trans-decl.c: Adjust warning() callers.

* java/class.c, java/decl.c, java/expr.c, java/jcf-io.c,
java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning()
callers.

* objc/objc-act.c: Adjust warning() callers.

* treelang/parse.y: Adjust warning() callers.

From-SVN: r98633
2005-04-23 17:29:07 -04:00
Nathan Sidwell d4e6fecb8f vec.h: Update API to separate allocation mechanism from type.
* vec.h: Update API to separate allocation mechanism from type.
	(VEC_safe_grow): New.
	* vec.c (calculate_allocation): New.
	(vec_gc_o_reserve, vec_heap_o_reserve): Adjust.
	(vec_gc_free, vec_heap_free): Remove.
	* gengtype-lex.l (DEF_VEC_): Process mult-argument macros.  Adjust.
	(VEC): Likewise.
	(mangle_macro_name): New.
	(struct macro_def): New.
	(struct macro): Add multiple argument values.
	(macro_expans_end): New.
	(push_macro_expansion):  Chain on new macro. Process multiple
	args, create follow on expansion. Return follow on argument.
	(macro_input): Deal with multiple arguments.

	* tree.h: Define VEC(tree,heap) and VEC(tree,gc).
	(struct tree_binfo): Adjust.
	* basic-block.h: Define VEC(edge,gc).
	(struct edge_def): Adjust.
	(struct basic_block_def, struct edge_iterator): Likewise.
	(ei_container, ei_start_1, ei_last_1): Likewise.
	* cfg.c (connect_src, connect_dest): Likewise.
	* cfgrtl.c (force_nonfallthru_and_redirect)
	* dbxout.c (dbxout_type)
	* dwarf2out.c (gen_member_die)
	* lambda-code.c: Define VEC(int,gc), VEC(lambda_loop,gc).
	(gcc_tree_to_linear_expression): Adjust.
	(gcc_loop_to_lambda_loop, gcc_loopnest_to_lambda_loopnest,
	lbv_to_gcc_expression, lle_to_gcc_expression,
	lambda_loopnest_to_gcc_loopnest, can_convert_to_perfect_nest,
	perfect_nestify): Likewise.
	* lambda.h (gcc_loopnest_to_lambda_loopnest,
	lambda_loopnest_to_gcc_loopnest): Adjust prototypes.
	* profile.c (instrument_values): Adjust.
	* tree-cfg.c (modified_noreturn_calls): Adjust.
	(remove_fallthru_edge): Likewise.
	* tree-dump.c (dequeue_and_dump): Adjust.
	* tree-flow-inline.h (mark_stmt_modified): Adjust.
	* tree-flow.h (modified_noreturn_calls): Adjust.
	(tree_on_heap): Remove. (yay!)
	(register_new_def): Adjust.
	* tree-into-ssa.c: Define VEC(int,heap).
	(block_defs_stack): Adjust.
	(find_idf, insert_phi_nodes, register_new_def,
	rewrite_initialize_block, rewrite_finalize_block,
	register_new_update_single, rewrite_update_init_block,
	rewrite_update_fini_block, rewrite_blocks,
	ssa_rewrite_finalize_block, ssa_register_new_def,
	ssa_rewrite_initialize_block, rewrite_ssa_into_ssa): Likewise.
	* tree-loop-linear.c (linear_transform_loops): Adjust.
	* tree-ssa-alias.c: Define VEC(fieldoff_t,heap).
	(push_fields_onto_fieldstack, create_overlap_variables_for): Adjust.
	* tree-ssa-dom.c (avail_exprs_stack, block_defs_stack,
	stmts_to_rescan, const_and_copies_stack, nonzero_vars_stack,
	vrp_variables_stack): Adjust declarations.
	(tree_ssa_dominator_optimize): Adjust.
	(dom_opt_initialize_block, remove_local_expressions_from_table,
	restore_nonzero_vars_to_original_value,
	restore_vars_to_original_value,
	restore_currdefs_to_original_value, dom_opt_finalize_block,
	record_var_is_nonzero, record_cond, record_const_or_copy_1,
	optimize_stmt, update_rhs_and_lookup_avail_expr,
	lookup_avail_expr, record_range): Likewise.
	* tree-ssa-pre.c: Define VEC(basic_block,heap).
	(compute_antic_aux): Adjust.
	(inserted_exprs, create_expression_by_pieces,
	insert_into_preds_of_block, eliminate, mark_operand_necessary,
	remove_dead_inserted_code, fini_pre): Likewise.
	* tree-ssa-propagate.c (interesting_ssa_edges): Adjust.
	(varying_ssa_edges, add_ssa_edge, process_ssa_edge_worklist.
	ssa_prop_init): Likewise.
	* tree-ssa.c: Define VEC(bitmap,heap).
	(verify_name_tags): Adjust.
	* value-prof.c (rtl_divmod_values_to_profile): Adjust.
	(insn_prefetch_values_to_profile, rtl_find_values_to_profile,
	tree_divmod_values_to_profile, tree_find_values_to_profile,
	value_profile_transformations): Likewise.
	* value-prof.h: Define VEC(histogram_value,heap).
	* varasm.c: Remove alias_pair pointer typedef, define
	VEC(alias_pair,gc).
	(finish_aliases_1, finish_aliases_2, assemble_alias): Adjust.

	* config/pa/pa.c (typedef extern_symbol): Typedef the structure,
	not a pointer to it.  Create an object vector.
	(extern_symbols): Turn into an object vector.
	(pa_hpux_asm_output_external, pa_hpux_file_end): Adjust.

	* cp/cp-tree.h: Adjust for new VEC API.
	Define VEC(tree_pair_s,gc).
	(struct save_scope): Adjust.
	(struct lang_type_class): Adjust.
	(unemitted_tinfo_decls): Adjust.
	* cp/class.c (add_method, resort_type_method_vec,
	finish_struct_methods, struct find_final_overrider_data,
	dfs_find_final_overrider_pre, find_final_overrider,
	get_vcall_index, warn_hidden, walk_subobject_offsets,
	check_methods, fixup_inline_methods, end_of_class,
	warn_about_ambiguous_bases, finish_struct, build_vtbl_initializer,
	add_vcall_offset): Adjust.
	* cp/decl.c (xref_basetypes, finish_method): Adjust.
	* cp/decl2.c (check_classfn): Adjust.
	* cp/init.c (sort_mem_initializers, push_base_cleanups): Adjust.
	* cp/method.c (do_build_copy_constructor): Adjust.
	* cp/name-lookup.c (new_class_binding, store_binding,
	store_bindings, store_class_bindings): Adjust.
	* cp/name-lookup.h: Define VEC(cxx_saved_binding,gc),
	VEC(cp_class_binding,gc).
	(struct cp_binding_level): Adjust.
	* cp/parser.c: Define VEC(cp_token_position,heap).
	(struct cp_lexer): Adjust.
	(cp_lexer_new_main, cp_lexer_new_from_tokens, cp_lexer_destroy,
	cp_lexer_save_tokens): Adjust.
	* cp/pt.c (retrieve_specialization,
	check_explicit_specialization): Adjust.
	* cp/rtti.c (unemitted_tinfo_decls): Adjust.
	(init_rtti_processing, get_tinfo_decl, get_pseudo_ti_init,
	get_pseudo_ti_desc): Adjust.
	* cp/search.c (dfs_access_in_type, lookup_conversion_operator,
	lookup_fnfields_1, dfs_walk_once, dfs_walk_once_accessible,
	dfs_get_pure_virtuals, lookup_conversions_r, binfo_for_vbase): Adjust.
	* cp/semantics.c: Define VEC(deferred_access,gc).
	(push_deferring_access_checks): Adjust.
	* cp/typeck2.c (abstract_virtuals_error): Adjust.

From-SVN: r98498
2005-04-21 09:18:28 +00:00
Mark Mitchell 1e73110261 target-def.h (TARGET_CXX_EXPORT_CLASS_DATA): Remove.
* target-def.h (TARGET_CXX_EXPORT_CLASS_DATA): Remove.
	(TARGET_CXX_DETERMINE_CLASS_VISIBILITY): New macro.
	(TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): Likewise.
	(TARGET_CXX): Adjust accordingly.
	* target.h (struct gcc_target): Remove epxort_class_data.  Add
	determine_class_data_visibility and class_data_always_comdat.
	* doc/tm.texi (TARGET_CXX_EXPORT_CLASS_DATA): Remove.
	(TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY): Document.
	(TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): Likewise.
	* config/arm/arm.c (arm_cxx_export_class_data): Remove.
	(arm_cxx_determine_class_data_visibility): New.
	(arm_cxx_class_data_always_comdat): Likewise.
	(TARGET_CXX_EXPORT_CLASS_DATA): Remove.
	(TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY): Define.
	(TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): Likewise.
	* config/arm/arm.h (TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P): Define.
	* config/arm/symbian.h (TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P):
	Define.

	* decl2.c (determine_visibility): Don't use export_class_data.
	(import_export_decl): Honor TARGET_CXX_CLASS_DATA_ALWAYS_WEAK and
	TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY.

	* testsuite/g++.dg/ext/visibility/arm2.C: New test.
	* testsuite/g++.dg/ext/visibility/arm3.C: Likewise.
	* testsuite/g++.dg/ext/visibility/symbian2.C: Likewise.

From-SVN: r98010
2005-04-12 06:33:48 +00:00
Mark Mitchell e72f3fa192 re PR c++/19159 (Undefined symbol: vtable for __cxxabiv1::__vmi_class_type_info)
PR c++/19159
	* decl2.c (import_export_decl): Use non-COMDAT external linkage
	for virtual tables, typeinfo, etc. that will be emitted in only
	one translation unit on systems without weak symbols.

From-SVN: r97635
2005-04-05 15:40:16 +00:00
Jan Hubicka 1f4ea8e588 decl2.c (finish_objects): Revert my previous patch.
* decl2.c (finish_objects): Revert my previous patch.
	(cp_finish_file): Likewise.

From-SVN: r97547
2005-04-04 15:12:55 +00:00
Jan Hubicka cd9c7bd28b [multiple changes]
2005-03-31  Jan Hubicka  <jh@suse.cz>

	2004-11-02  Jan Hubicka  <jh@suse.cz>

	* cgraph.c (cgraph_varpool_node_name): New function.
	(dump_cgraph_varpool_node): New function.
	(dump_varpool): New function.
	* cgraphunit.c (cgraph_optimize): Dump varpool.

	2004-10-16  Jan Hubicka  <jh@suse.cz>

	* cgraph.c (decide_is_variable_needed): New function.
	(cgraph_varpool_finalize_decl): Use it.
	* cgraphunit.c (cgraph_optimize): Assemble_pending_decls when not doing
	unit-at-a-time.
	* final.c (output_addr_const): Do not call mark_referenced.
	* passes.c (rest_of_decl_compilation): ifdef out DECL_RTL_SET_P hack;
	always go via cgraph.
	* toplev.c (wrapup_global_declarations): Kill non-unit-at-a-time code.
	(check_global_declarations): Ifdef out code clearing DECL_RTL.
	* tree-optimize.c (execute_inline): Mark functions called.
	* i386.c (output_pic_addr_const): Do not call mark_decl_referenced.

	2004-10-11  Jan Hubicka  <jh@suse.cz>

	* cgraph.c (cgraph_varpool_first_unanalyzed_node): New global voriable
	(cgraph_varpool_last_needed_node): New static variable.
	(enqueue_needed_varpool_node): Break out from ...; add items to the
	end of queue; update first pointers.
	(cgraph_varpool_mark_needed_node): ... here.
	(cgraph_varpool_finalize_decl): Use enqueue_needed_varpool_node.
	(cgraph_varpool_assemble_pending_decls): Move to cgraphunit.c
	* cgraph.h (cgraph_varpool_node): Add analyzed field.
	(cgraph_varpool_first_unanalyzed_node): Declare.
	* cgraphunit.c: Include output.h.
	(cgraph_varpool_analyze_pending_decls): New function.
	(cgraph_varpool_assemble_pending_decls): Move from cgraph.c; bail out
	for errors, analyze pending decls.
	(cgraph_finalize_compilation_unit): Only analyze decls.
	(cgraph_optimize): Assemble the decls after expanding.

From-SVN: r97287
2005-03-30 22:28:02 +00:00
Volker Reichelt 78dcd41a31 call.c, [...]: Fix comment typo(s).
* call.c, class.c, cp-tree.h, decl2.c, error.c, init.c, mangle.c,
        parser.c: Fix comment typo(s).

From-SVN: r95517
2005-02-24 21:55:15 +00:00
Mark Mitchell 744b12b65f re PR c++/19991 (Enum not accepted in array-size)
PR c++/19991
	* init.c (integral_constant_value): Iterate if the value of a decl
	is itself a constant.

	PR c++/20152
	* parser.c (cp_parser_class_head): Check for redefintions here.
	* semantics.c (begin_class_definition): Not here.

	PR c++/20153
	* decl2.c (build_anon_union_vars): Add type parameter.
	(finish_anon_union): Pass it.

	PR c++/20148
	* error.c (dump_expr): Do not print the body of a BIND_EXPR.
	Handle STATEMENT_LIST.

	PR c++/19991
	* g++.dg/parse/constant7.C: New test.

	PR c++/20152
	* g++.dg/parse/error27.C: New test.
	* g++.dg/template/qualttp15.C: Adjust error markers.
	* g++.old-deja/g++.other/struct1.C: Likewise.

	PR c++/20153
	* g++.dg/template/error17.C: New test.

	PR c++/20148
	* g++.dg/parser/error26.C: New test.

From-SVN: r95438
2005-02-23 05:30:48 +00:00
Douglas Gregor 9804209d32 re PR c++/19076 (Pointer to member function not matched to pointer to member template)
2005-02-21  Douglas Gregor  <dgregor@cs.indiana.edu>

	PR c++/19076
	PR c++/6628
	* cp-tree.h (cp_apply_type_quals_to_decl): Declared.
	* decl.c (grokdeclarator): Pedwarn about qualifying a function
	type.
	Add qualifiers when declaring a typedef of a function type.
	Member function pointers pick up the qualifiers of the typedef
	used to declare them.
        Don't complain about creating cv-qualified function types.
	Complain about qualified function typedefs that are used to
	declare non-static member functions or free functions.
	Use cp_apply_type_quals_to_decl.
	(start_preparsed_function): Use cp_apply_type_quals_to_decl.
	(grokclassfn): Use cp_apply_type_quals_to_decl.
	* error.c (dump_type_suffix): Print qualifiers for function
	types.
	* pt.c (tsubst_decl): Use cp_apply_type_quals_to_decl.
	(tsubst): When substituting a function type into a member
	pointer type, pass along the qualifiers.
	(unify): Unify member pointers to member function pointers.
	* tree.c (cp_build_qualified_type_real): Function types may be
	qualified. This includes restrict qualifiers.
	* typeck.c (cp_apply_type_quals_to_decl): New function to replace
	use of c_apply_type_quals_to_decl. Drops qualifiers that are being
	added to function types.

From-SVN: r95356
2005-02-21 23:12:27 +00:00
Giovanni Bajo aecc0cf071 re PR c++/19508 (dwarf2, ICE on __attribute__(aligned) in class template)
2005-01-20  Giovanni Bajo  <giovannibajo@gcc.gnu.org>

        PR c++/19508
        * g++.dg/ext/attrib20.C: New test.

2005-01-20  Giovanni Bajo  <giovannibajo@gcc.gnu.org>

        PR c++/19508
        * decl2.c (grokfield): Do not apply attributes to template parameters
        as they are ignored by tsubst anyway.

From-SVN: r95230
2005-02-18 11:11:58 -08:00
Alexandre Oliva 39a87435bc decl2.c (mark_used): Set the source location of the used decl to the current input location here...
* decl2.c (mark_used): Set the source location of the used decl to
the current input location here...
* method.c (synthesize_method): ... not here.  Set input_location
from the decl instead.

From-SVN: r95070
2005-02-15 19:37:13 +00:00
Giovanni Bajo 515e6a84cd re PR c++/17401 (ICE with invalid pure specifier)
PR c++/17401
	* parser.c (cp_parser_pure_specifier): Emit a specific error
	message with an invalid pure specifier.
	* decl2.c (grok_function_init): Remove.
	(grokfield): An initializer for a method is a always a pure
	specifier.

	PR c++/17401
	* g++.dg/parse/error25.C: New test.

From-SVN: r94656
2005-02-03 10:26:22 +00:00
Nathan Sidwell 4514aa8c67 re PR c++/19030 (ice on tree check)
cp:
	PR c++/19030
	* cp-tree.h (start_decl): Take pointer to pushed scope, not bool.
	* name-lookup.h (push_scope): Return pushed scope, not flag.
	* name-lookup.c (push_scope): Return scope that should be popped,
	not a flag.
	* decl.c (start_decl): Adjust.
	(grokfndecl): Adjust scope push and pop.
	* decl2.c (check_classfn): Likewise.
	* parser.c (cp_parser_condition, cp_parser_conversion_function_id,
	cp_parser_init_declarator, cp_parser_direct_declarator,
	cp_parser_class_specifier, cp_parser_class_head,
	cp_parser_lookup_name,
	cp_parser_constructor_declarator_p): Likewise.
	* pt.c (instantiate_class_template,
	resolve_typename_type): Likewise.
testsuite:
	PR c++/19030
	* g++.dg/parse/crash22.C: New

From-SVN: r92946
2005-01-05 10:02:35 +00:00
Richard Henderson 78e0d62b95 re PR middle-end/17799 (Non-optimizing compile loses 'this')
PR middle-end/17799
        * function.c (use_register_for_decl): Check DECL_IGNORED_P instead
        of DECL_ARTIFICIAL.
        (assign_parms_augmented_arg_list): Set DECL_IGNORED_P.
        * c-decl.c (build_compound_literal): Likewise.
        * dwarf2asm.c (dw2_force_const_mem): Likewise.
        * gimplify.c (create_artificial_label): Likewise.
        * tree-inline.c (expand_call_inline): Likewise.
        * var-tracking.c (vt_initialize): Likewise.
        * tree-outof-ssa.c (create_temp): Copy DECL_IGNORED_P.
cp/
        * call.c (make_temporary_var_for_ref_to_temp): Set DECL_IGNORED_P.
        * class.c (build_vtable): Don't conditionallize setting it
        based on DWARF2_DEBUG.
        (layout_class_type): Set DECL_IGNORED_P.
        * decl2.c (get_guard): Likewise.
        * rtti.c (get_tinfo_decl, build_lang_decl): Likewise.
        * tree.c (build_local_temp): Likewise.

From-SVN: r92781
2004-12-31 17:43:12 -08:00
Mark Mitchell 1d786913b3 cp-tree.h (cp_declarator): Split "name" field into qualifying_scope and unqualified_name.
* cp-tree.h (cp_declarator): Split "name" field into
	qualifying_scope and unqualified_name.
	* decl.c (get_scope_of_declarator): Adjust accordingly.
	(grokdeclarator): Likewise.
	* decl2.c (grokfield): Likewise, and adjust call to
	do_class_using_decl.
	* name-lookup.c (do_class_using_decl): Split "decl" into
	"scope" and "name".  Remove unnecessary code.
	* name-lookup.h (do_class_using_decl): Adjust declaration.
	* parser.c (make_id_declarator): Split "id" into qualifying_scope
	and unqualified_name.
	(cp_parser_using_declaration): Adjust call to do_class_using_decl.
	(cp_parser_direct_declarator): Adjust to handle the fact that
	cp_parser_declarator_id no longer returns a SCOPE_REF.
	(cp_parser_direct_declarator): Likewise.
	(cp_parser_declarator_id): Do not create a SCOPE_REF for qualified
	names.
	(cp_parser_member_declaration): Adjust call to make_id_declarator.
	(cp_parser_check_declarator_template_parameters): Do not expect a
	SCOPE_REF.

	* decl.c (duplicate_decls): Call ggc_free on declarations we will
	not be needing any longer.

From-SVN: r92746
2004-12-30 23:29:33 +00:00
Nathan Sidwell 8a784e4a17 re PR c++/18905 (Strange error: subscripted value is neither array nor pointer)
cp:
	PR c++/18905
	* cp-tree.h (integral_constant_value): Declare.
	* call.c (null_ptr_cst_p): Use integral_constant_value, not
	decl_constant_value.
	(convert_like_real): Likewise.
	* class.c (check_bitfield_decl): Likewise.
	* cvt.c (ocp_convert): Likewise.
	(convert): Remove unnecessary decl_constant_value call.
	* decl.c (compute_array_index_type): Use integral_constant_value,
	not decl_constant_value.
	(build_enumerator): Likewise.
	* decl2.c (grokfield): Likewise.
	* init.c (decl_constant_value): Simplify.
	(integral_constant_value): New.
	* pt.c (fold_decl_constant_value): Use integral_constant_value,
	remove subsequent check.
	(tsubst): Use integral_constant_value, not decl_constant_value.
	(tsubst_copy, unify): Likewise.
	* typeck.c (decay_conversion): Likewise.
	(build_compound_expr): Remove unnecessary decl_constant_value
	calls.
	(build_static_cast_1, build_reinterpret_cast_1):
	(convert_for_assignment): Remove comment about not calling
	decl_constant_value.
testsuite:
	PR c++/18905
	* g++.dg/template/init4.C: New.
	* g++.dg/opt/static3.C: Enable optimizer.

From-SVN: r92257
2004-12-16 11:04:09 +00:00
Nathan Sidwell db24eb1f4f re PR c++/18803 (rejects access to operator() in template)
cp:
	PR c++/18803
	* cp-tree.h (REFERENCE_REF_P): New.
	(CPTI_TYPE_INFO_TYPE): Rename to ...
	(CPTI_CONST_TYPE_INFO_TYPE): ... here.
	(CPTI_TYPE_INFO_REF_TYPE): Remove.
	(type_info_type_node): Rename to ...
	(const_type_info_type_node): ... here.
	(type_info_ref_type): Remove.
	* call.c (build_user_type_conversion): Reformat.
	(resolve_args): Do not convert_from_reference.
	(build_object_call): Call convert_from_reference.
	(prep_operand): Do not convert_from_reference.
	(build_new_method_call): Likewise.
	* class.c (build_vfield_ref): Likewise.
	* cvt.c (convert_to_reference): Likewise.
	(convert_from_reference): Build INDIRECT_REF here, not with
	build_indirect_ref.
	(convert_force): Do not convert_from_reference.
	(build_expr_type_conversion): Likewise.
	* decl.c (grok_reference_init): Likewise.
	* decl2.c (delete_sanity): Likewise.
	* except.c (initialize_handler_parm): Use POINTER_TYPE_P.
	* init.c (build_dtor_call): Do not convert_from_reference.
	* parser.c (cp_parser_template_argument): Unwrap indirected
	reference. Allow TEMPLATE_PARM_INDEX as an object parm.
	* pt.c (tsubst_copy_and_build) <case INDIRECT_REF>: Use
	convert_from_reference, if indicated.
	<case CALL_EXPR>: Do not convert_from_reference.
	<case PARM_DECL, VAR_DECL>: Convert_from_reference if needed.
	(tsubst_initializer_list): Do not convert_from_reference.
	* rtti.c (init_rtti_processing): Adjust node creation.
	(throw_bad_typeid): Use const_type_info_type_node.
	Do not convert_from_reference.
	(typeid_ok_p): Use const_type_info_type_node.
	(build_typeid, get_typeid): Always return type_info typed node.
	(build_dynamic_cast_1): Dont convert_from_reference. Refactor.
	* semantics.c (finish_stmt_expr_expr): Do not
	convert_from_reference.
	(finish_id_expression): Convert_from_reference as appropriate.
	* typeck.c (decay_conversion): Do not convert_from_reference.
	(finish_class_member_access_expr): Likewise.
	(build_indirect_ref): Use POINTER_TYPE_P.
	(convert_arguments): Do not convert_from_reference.
	(build_modify_expr): Likewise.
	(convert_for_initialization): Likewise.
	* typeck2.c (build_x_arrow): Likewise.
testsuite:
	PR c++/18803
	* g++.dg/template/operator5.C: New.

From-SVN: r91863
2004-12-08 08:36:09 +00:00
Joseph Myers 86f029aa95 [multiple changes]
2004-11-29  Daniel Jacobowitz  <dan@codesourcery.com>

	PR c/7544
	* Makefile.in (c-lang.o): Update dependencies.
	* c-lang.c: Include "c-pragma.h".
	(finish_file): Call maybe_apply_pending_pragma_weaks.
	* c-pragma.c (maybe_apply_pending_pragma_weaks): New function.
	* c-pragma.h (maybe_apply_pending_pragma_weaks): New prototype.

cp:
2004-11-29  Daniel Jacobowitz  <dan@codesourcery.com>

	* Make-lang.in (cp/decl2.o): Update dependencies.
	* decl2.c (finish_file): Call maybe_apply_pending_pragma_weaks.

objc:
2004-11-29  Joseph Myers  <joseph@codesourcery.com>

	* Make-lang.in (objc/objc-act.o): Update dependencies.
	* objc-act.c (objc_finish_file): Call
	maybe_apply_pending_pragma_weaks if not OBJCPLUS.

testsuite:
2004-11-29  Joseph Myers  <joseph@codesourcery.com>

	* g++.dg/ext/weak1.C, gcc.dg/weak/weak-10.c, objc.dg/weak-1.m: New
	tests.

From-SVN: r91479
2004-11-29 18:54:06 +00:00
Ben Elliston af74669714 cp-tree.h (context_as_string): Remove extern.
* cp-tree.h (context_as_string): Remove extern.
	* error.c (context_as_string): Remove.

	* cp-tree.h (cp_type_qual_from_rid): Remove extern.
	* lex.c (cp_type_qual_from_rid): Remove.

	* cp-tree.h (do_poplevel): Remove extern.
	(check_multiple_declarators): Likewise.
	* semantics.c (do_poplevel): Make static.
	(check_multiple_declarators): Remove.

	* cp-tree.h (check_final_overrider): Remove extern.
	* search.c (check_final_overrider): Make static.

	* cp-tree.h (build_artificial_parm): Remove extern.
	* decl2.c (build_artificial_parm): Make static.

From-SVN: r91134
2004-11-24 15:09:27 +11:00
Mark Mitchell 44370687a5 re PR c++/18389 (ICE on struct declaration in for statement)
PR c++/18389
	* decl.c (start_decl): Make sure to set *pop_scope_p.  Return
	error_mark_node to indicate errors.

	PR c++/18429
	* parser.c (cp_parser_direct_declarator): Disallow non-constant
	array bounds when not inside a function.

	PR c++/18436
	* pt.c (tsubst_copy_and_build): Do not do Koenig lookup when an
	unqualified name resolves to a member function.

	PR c++/18407
	* pt.c (tsubst_copy_and_build): Handle qualified names used from a
	derived class correctly.

	* decl2.c (import_export_decl): Fix typo in comment.
	* tree.c (pod_type_p): Likewise.

	PR c++/18389
	* g++.dg/parse/cond1.C: New test.

	PR c++/18429
	* g++.dg/template/array9.C: New test.
	* g++.dg/ext/vla1.C: Adjust error messages.
	* g++.dg/ext/vlm1.C: Likewise.
	* g++.dg/template/crash2.C: Likewise.

	PR c++/18436
	* g++.dg/template/call3.C: New test.

	PR c++/18407
	* g++.dg/template/ptrmem11.C: New test.

From-SVN: r90545
2004-11-12 21:47:13 +00:00
Joseph Myers 9e637a2679 builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate.
* builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h,
	c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c,
	gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c,
	tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c,
	config/avr/avr.c, config/c4x/c4x.c, config/darwin.c,
	config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c,
	config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c,
	config/iq2000/iq2000.c, config/m32r/m32r.c,
	config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h,
	config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c,
	config/ns32k/ns32k.c, config/rs6000/host-darwin.c,
	config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c,
	config/sh/symbian.c, config/stormy16/stormy16.c,
	config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %<
	and %> as appropriate.  Use %' as apostrophe in diagnostics where
	applicable.  Use %< and %> in place of '' quotes where applicable.
	Use %qs in place of %<%s%>.  Consistently quote __builtin function
	names.

ada:
	* misc.c (gnat_handle_option): Use %< and %> for quoting in
	warning message.

cp:
	* call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c,
	pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for
	quoting in diagnostics.
	* parser.c (cp_parser_sizeof_operand): Use '' instead of `' for
	quoting in printf format.
	* decl.c (duplicate_decls, start_decl): Use %qD instead of
	unquoted %D.

objc:
	* objc-act.c: Use %q, %< and %> for quoting in diagnostics.

testsuite:
	* gcc.dg/builtin-prefetch-1.c: Adjust expected messages.

From-SVN: r90337
2004-11-09 10:13:30 +00:00
Gabriel Dos Reis c4f731746a Convert diagnostics to use quoting flag q 9/n
Convert diagnostics to use quoting flag q 9/n
        * typeck.c (build_x_unary_op, convert_member_func_to_ptr,
        get_delta_difference):  Use new quotation style.
        * repo.c (reopen_repo_file_for_write): Likewise.
        * pt.c (do_type_instantiation): Likewise.
        * parser.c (cp_parser_diagnose_invalid_type_name):
        * name-lookup.c (push_overloaded_decl, set_decl_namespace):
        * error.c (cp_print_error_function,
        print_instantiation_full_context): Likewise.
        * decl.c (define_label, grok_reference_init,
        maybe_deduce_size_from_array_init, revert_static_member_fn):
        * decl2.c (check_classfn): Likewise.
        * class.c (add_method, check_field_decls, layout_class_type,
        resolve_address_of_overloaded_function): Likewise.
        * call.c (build_x_va_arg, build_over_call): Likewise.

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

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

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

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

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

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

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

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

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

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

From-SVN: r87808
2004-09-21 15:39:00 +00:00