Commit Graph

929 Commits

Author SHA1 Message Date
Lee Millward 662c2e83b1 re PR c++/28292 (ICE in acceptable_java_type)
PR c++/28292
	* decl2.c (acceptable_java_type): Robustify. Use
	proper Boolean return type instead of return 1.
	(check_java_method): Don't issue error about
	type not being an acceptable Java parameter if 
	it's error_mark_node.

	* g++.dg/other/error12.C: New test.

From-SVN: r115474
2006-07-15 14:44:48 +00:00
Volker Reichelt 6ae9b8759e re PR c++/28387 (ICE with attribute on invalid declaration)
PR c++/28387
	* decl2.c (cplus_decl_attributes): Check for invalid decls.

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

From-SVN: r115465
2006-07-15 09:22:17 +00:00
Volker Reichelt 4f543d151e re PR c++/28343 (ICE with invalid asm specifier for struct member)
PR c++/28343
	* decl.c (cp_finish_decl): Check asmspec_tree for error_mark_node.
	* decl2.c (grokfield): Likewise.

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

From-SVN: r115436
2006-07-14 09:43:23 +00:00
Geoffrey Keating 7c0de6a544 Index: ChangeLog
2006-07-12  Geoffrey Keating  <geoffk@apple.com>

	* doc/invoke.texi (C++ Dialect Options): Explain difference
	between -fvisibility-inlines-hidden and setting hidden
	visibility explicitly.

Index: cp/ChangeLog
2006-07-12  Geoffrey Keating  <geoffk@apple.com>

	* decl2.c (determine_visibility): Don't change visibility of
	function locals because of -fvisibility-inlines-hidden.

Index: testsuite/ChangeLog
2006-07-12  Geoffrey Keating  <geoffk@apple.com>

	* g++.dg/ext/visibility/fvisibility-inlines-hidden-2.C: New.

From-SVN: r115411
2006-07-13 06:16:59 +00:00
Jason Merrill 1f0b926a1f re PR c++/28279 (ICE in finish_static_data_member_decl, at cp/decl2.c:716)
PR c++/28279
        * decl2.c (finish_static_data_member_decl): Don't assert
        TREE_PUBLIC.

From-SVN: r115228
2006-07-06 14:39:39 -04:00
Kazu Hirata e7d35a8840 * decl2.c: Fix a comment typo.
From-SVN: r115099
2006-06-30 19:34:38 +00:00
Jason Merrill 444762dfeb re PR c++/18698 (Error message using "using" for code not using "using" ;-))
PR c++/18698
        * decl2.c (grokfield): Only try to treat the decl as an access
        declaration if the scope is a class.

From-SVN: r115095
2006-06-30 14:27:18 -04:00
Jason Merrill b9e7569630 re PR c++/26905 (default-visibility class symbol improperly resolved as hidden-visibility)
PR c++/26905
        PR c++/26612
        PR c++/27000
        PR c++/26984
        PR c++/19134
        * tree.c (build_decl_stat): Don't hande #pragma visibility here.
        * c-common.c (c_determine_visibility): Handle it here.
        * c-decl.c (finish_decl): Call c_determine_visibility for
        functions, too.
        * flags.h (enum symbol_visibility): Sort from most to least visibility.
        * tree.h: Likewise.
        * varasm.c (default_assemble_visibility): Likewise.
        * c-common.c (handle_visibility_attribute): Complain about trying
        to give visibility to an already defined class, or trying to change
        declared visibility. Always attach the attribute.
        * cp/decl2.c (determine_visibility): Overhaul.
        (determine_visibility_from_class): Likewise.
        (min_vis_r, type_visibility, constrain_visibility): New fns.
        (constrain_visibility_for_template): Likewise.
        (constrain_class_visibility): Likewise.
        * cp/decl.c (cp_finish_decl): Call determine_visibility for function
        decls, too.
        * cp/name-lookup.c (pushtag): Call determine_visibility.
        * cp/decl.c (duplicate_decls): Don't copy visibility from template to
        specialization.
        * cp/pt.c (check_explicit_specialization): Likewise.
        (lookup_template_class, tsubst_decl): Call determine_visibility.
        * cp/class.c (finish_struct_1): Call constrain_class_visibility.

        PR c++/26905
        PR c++/21675
        PR c++/17470
        * cp/parser.c (cp_parser_explicit_instantiation): Pass the attributes
        to grokdeclarator.
        (cp_parser_type_specifier): Allow 'enum __attribute ((...)) E'.
        (cp_parser_enum_specifier): Likewise.
        (cp_parser_elaborated_type_specifier): Apply attributes if this
        declares only the class.
        (cp_parser_class_specifier): Apply leading attributes immediately.
        * cp/semantics.c (begin_class_definition): Add attributes parameter,
        apply them to the type.
        * attribs.c (decl_attributes): Ignore type-in-place attributes
        once the type has been defined.

        PR c++/21581
        PR c++/25915
        * cp/tree.c (decl_anon_ns_mem_p): New function.
        * cp/cp-tree.h: Declare it.
        * cp/decl2.c (determine_visibility): Make anonymous namespace
        members static.
        (min_vis_r, constrain_visibility): Likewise.
        * cp/rtti.c (create_pseudo_type_info): Set TREE_PUBLIC on
        pseudo-types.
        * cp/decl.c (cxx_init_decl_processing): Set TREE_PUBLIC on
        global_namespace.
        * cp/name-lookup.c (push_namespace_with_attribs): Don't set TREE_PUBLIC
        on anonymous namespaces.

From-SVN: r115086
2006-06-29 21:15:56 -04:00
Lee Millward 344f237baf re PR c++/28054 (ICE with friend declaration of invalid bitfield)
PR c++/28054
	* decl2.c (grokbitfield): Remove check for grokdeclarator
	returning NULL_TREE, instead check for error_mark_node
	to indicate failure.
	* decl.c (grokdeclarator): Adjust block comment.

	* g++.dg/other/incomplete3.C: New test.


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

From-SVN: r114986
2006-06-25 11:28:01 +00:00
Volker Reichelt 8bdb09cb0b re PR c++/27951 (ICE with invalid anonymous union)
PR c++/27951
	* decl2.c (finish_anon_union): Return early if build_anon_union_vars
	fails.

	* g++.dg/other/anon4.C: New test.

From-SVN: r114577
2006-06-12 20:50:53 +00:00
Mike Stump 3db45ab592 Fix up whitespacing
From-SVN: r114428
2006-06-06 11:44:09 +00:00
Kazu Hirata ddd0b831eb decl.c, [...]: Fix comment typos.
* decl.c, decl2.c, parser.c: Fix comment typos.  Follow
	spelling conventions.

From-SVN: r114169
2006-05-28 17:53:11 +00:00
Mark Mitchell e92fb50114 re PR c++/20103 (ICE in create_tmp_var with C99 style struct initializer)
PR c++/20103
	* gimplify.c (gimplify_decl_expr): Do not call gimple_add_tmp_var
	for anonymous variables explicitly declared by front ends. 

	PR c++/20103
	* decl.c (cp_make_fname_decl): Don't set DECL_INITIAL to
	error_mark_node to indicate an initialization is OK.
	(start_decl): Likewise.  Adjust call to start_decl_1.
	(start_decl_1): Add initialized parameter.  Simplify.
	* except.c (initialize_handler_parm): Adjust call to
	setart_decl_1.
	(expand_start_catch_block): Let cp_finish_decl initialize catch
	parameters.
	* cp-tree.h (start_decl_1): Adjust prototype.
	* pt.c (tsubst_expr): Don't set DECL_INITIAL to error_mark_node.
	(instantiate_decl): Let cp_finish_decl handle initialization.
	* semantics.c (finish_compound_literal): Create a temporary
	variable for the literal.
	* typeck.c (build_unary_op): Remove COMPOUND_LITERAL_P special
	cases.
	* decl2.c (finish_static_data_member_decl): Don't set
	DECL_INITIAL.
	(grokfield): Do not try to initialize functions.

	PR c++/20103
	* g++.dg/ext/complit6.C: New test.
	* g++.dg/ext/complit3.C: Adjust error markers.
	* g++.dg/init/const3.C: New test.

From-SVN: r114119
2006-05-25 20:18:26 +00:00
Mark Mitchell ceacde632a re PR c++/26122 (Pure specifiers for templates causing trouble)
PR c++/26122
	* decl2.c (check_member_template): Remove checks for virtual
	functions.
	* parser.c (cp_parser_function_specifier_opt): Complain about
	virtual templates.
	(cp_parser_pure_specifier): Likewise.
	PR c++/26122
	* g++.old-deja/g++.oliva/template9.C: Remove XFAIL.

From-SVN: r113873
2006-05-17 21:39:07 +00:00
Volker Reichelt 15218346be re PR c++/27447 (ICE on invalid ptr-to-member-function)
PR c++/27447
	* decl2.c (build_memfn_type): Skip invalid functions and class types.

	* g++.dg/other/ptrmem7.C: New test.

From-SVN: r113615
2006-05-08 00:26:08 +00:00
Mark Mitchell 7137605e8f re PR c++/27309 (ICE on invalid constructor definition)
PR c++/27309
	* class.c (add_method): Call grok_special_member_properties.
	* decl.c (grokdeclarator): Don't call it here.
	(copy_fn_p): A TEMPLATE_DECL is never a copy constructor or
	assignment operator.  Set TYPE_HAS_CONSTURCTOR if DECL is a
	constructor.
	(start_method): Don't call grok_special_member_properties.
	* method.c (implicitly_declare_fn): Likewise.
	* pt.c (instantiate_class_template): Likewise.
	* decl2.c (grokfield): Likewise.
	PR c++/27309
	* g++.dg/parser/ctor5.C: New test.

From-SVN: r113473
2006-05-02 15:59:50 +00:00
Mark Mitchell 5a8613b2d9 re PR c++/27094 (tree check: expected tree_list, have omp_return in build_call)
PR c++/27094
	* pt.c (tsubst_default_argument): Increment function_depth around
	call to tsubst_expr.
	* parser.c (cp_parser_parameter_declaration): Likewise.
	* decl2.c (mark_used): Tidy.
	PR c++/27094
	* g++.dg/template/defarg8.C: New test.

From-SVN: r113399
2006-04-30 23:21:38 +00:00
Mark Mitchell e2537f2c03 re PR c++/26912 (friend const member function specialization fails to compile)
PR c++/26912
	* cp-tree.h (build_this_parm): Declare.
	(grok_method_quals): Remove.
	(build_memfn_type): Declare.
	(build_artificial_parm): Declare.
	(do_friend): Remove quals parameter.
	* decl.c (build_this_parm): New function.
	(grokfndecl): Use it.  Do not pass quals to grokclassfn.
	(grokdeclarator): Rename quals to memfn_quals.  Avoid allocating
	unnecessary TYPE_DECLs.  Correct qualification of member function
	types.  Tidy.
	* method.c (implicitly_declare_fn): Use build_this_parm.
	* friend.c (do_friend): Remove quals parameter.
	* decl2.c (grok_method_quals): Remove.
	(build_memfn_type): New function.
	(build_artificial_parm): Give it external linkage.
	(grokclassfn): Remove quals parameter.  Do not build "this"
	PARM_DECL here.
	PR c++/26912
	* g++.dg/template/friend41.C: New test.

From-SVN: r113213
2006-04-24 03:50:31 +00:00
Kazu Hirata 84dc00e8ac * decl2.c, pt.c, semantics.c: Fix comment typos.
From-SVN: r112779
2006-04-08 14:15:44 +00:00
Jason Merrill 0ed5edac59 re PR c++/21764 (visibility attributes on namespace scope)
PR c++/21764
        * c-pragma.c (visstack): Move out of handle_pragma_visibility.
        (push_visibility, pop_visibility): Likewise.
        * c-pragma.h: Declare them.
        * cp/name-lookup.h (struct cp_binding_level): Add has_visibility
        bitfield.
        * cp/name-lookup.c: Include c-pragma.h.
        (push_namespace_with_attribs): Split out from push_namespace.
        Push visibility if appropriate.  Set TREE_PUBLIC on namespaces.
        (leave_scope): Pop visibility if appropriate.
        * cp/parser.c (cp_parser_declaration, cp_parser_namespace_name): Allow
        attributes on namespace declarations.

        PR c++/19238
        * cp/decl.c (cp_finish_decl): Call determine_visibility later.
        (start_preparsed_function): Likewise.
        * cp/cp-tree.h (CP_TYPE_CONTEXT, TYPE_NAMESPACE_SCOPE_P): New macros.
        (TYPE_CLASS_SCOPE_P, TYPE_FUNCTION_SCOPE_P): New macros.
        * cp/decl2.c (determine_visibility_from_class): Split out from...
        (determine_visibility): ...here.  Handle function scope and
        nested classes.
        (import_export_decl): Move visibility handling to
        determine_visibility_from_class.

From-SVN: r112239
2006-03-20 22:19:06 -05:00
Mike Stump 67a70df65b decl2.c (import_export_decl): Remove redundant call to targetm.cxx.key_method_may_be_inline ().
* decl2.c (import_export_decl): Remove redundant call to
	targetm.cxx.key_method_may_be_inline ().

From-SVN: r111685
2006-03-03 20:37:50 +00:00
Mike Stump 1a1d091751 re PR target/25908 (vtables with vague linkage is not being marked as vague on darwin)
PR darwin/25908
	* decl2.c (import_export_decl): Fix ABI breakage on darwin.

	* g++.dg/abi/key2.C: Add.

From-SVN: r111632
2006-03-02 02:20:54 +00:00
Mark Mitchell d174af6c58 re PR c++/26266 (Trouble with static const data members in template classes)
PR c++/26266
	* cp-tree.h (cp_finish_decl): Adjust declaration.
	(grokbitfield): Likewise.
	(finish_static_data_member_decl): Likewise.
	* init.c (constant_value_1): Ensure processing_template_decl when
	folding non-dependent initializers for static data members of
	dependent types.  Return error_mark_node for erroneous
	initailizers.
	* class.c (get_vtable_decl): Use finish_decl, not cp_finish_decl.
	* decl.c (cp_make_fname_decl): Adjust call to cp_finish_decl.
	(cp_finish_decl): Add init_const_expr_p parameter.  Set
	DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P here.
	(finish_decl): Adjust call to cp_finish_decl.
	(compute_array_index_type): Robustify.
	(start_method): Use finish_decl, not cp_finish_decl.
	* rtti.c (emit_tinfo_decl): Likewise.
	* except.c (initialize_handler_parm): Adjust call to
	cp_finish_decl.
	(expand_start_catch_block): Likewise.
	* cvt.c (build_up_reference): Adjust call to cp_finish_decl.
	* pt.c (instantiate_class_template): Adjust call to
	finish_static_data_member_decl.
	(tsubst_expr): Use finish_decl, not cp_finish_decl.
	(instantiate_decl): Adjust call to cp_finish_decl.
	* name-lookup.c (pushdecl_top_level_1): Use finish_decl, not
	cp_finish_decl.
	* decl2.c (finish_static_data_member_decl): Add init_const_expr_p
	parameter.
	(grokfield): Likewise.
	* parser.c (cp_parser_condition): Check for constant initializers.
	(cp_parser_init_declarator): Adjust calls to grokfield and
	cp_finish_decl.  Don't set
	DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P here.
	(cp_parser_member_declaration): Likewise.
	(cp_parser_objc_class_ivars): Likewise.
	PR c++/26266
	* g++.dg/template/static22.C: New test.
	* g++.dg/template/static23.C: New test.
	* g++.dg/template/static24.C: New test.
	* g++.dg/template/non-dependent13.C: New test.

From-SVN: r111229
2006-02-18 08:36:11 +00:00
Gabriel Dos Reis 67f5655f98 call.c (alloc_conversion): Use cast when converting from void *.
* call.c (alloc_conversion): Use cast when converting from
	void *.
        (alloc_conversions): Likewise.
        (add_candidate): Likewise.
        (print_z_candidates): Likewise.
        (add_warning): Likewise.
        * pt.c (retrieve_local_specialization): Likewise.
        (process_partial_specialization): Likewise.
        (mangle_class_name_for_template): Likewise.
        (tsubst_template_args): Likewise.
        * typeck2.c (pat_calc_hash): Likewise.
        (pat_compare): Likewise.
        (abstract_virtuals_error): Likewise.
        * class.c (method_name_cmp): Likewise.
        (resort_method_name_cmp): Likewise.
        (get_vfield_name): Likewise.
        * decl2.c (generate_ctor_and_dtor_functions_for_priority):
	Likewise.
        * lex.c (init_reswords): Likewise.
        * rtti.c (create_pseudo_type_info): Likewise.
        * search.c (dfs_lookup_base): Likewise.
        (dfs_dcast_hint_pre): Likewise.
        (dfs_dcast_hint_post): Likewise.
        * tree.c (hash_tree_cons): Likewise.
        * repo.c (extract_string): Likewise.
        (afgets): Likewise.
        * cp-objcp-common.c (decl_shadowed_for_var_lookup): Likewise.
        * g++spec.c (lang_specific_driver): Likewise.

From-SVN: r110366
2006-01-29 09:10:48 +00:00
Volker Reichelt 607c855eb7 re PR c++/16829 (default parameter can be not one of the last in function)
PR c++/16829
	* decl.c (start_preparsed_function): Check default arguments
	unconditionally.
	* name-lookup.c (pushdecl_maybe_friend): Check default arguments
	of all functions and function templates.
	* parser.c (cp_parser_late_parsing_default_args): Check default
	arguments.
	* decl2.c (check_default_args): Set missing default arguments to
	error_mark_node.

	* g++.dg/other/default2.C: New test.
	* g++.dg/other/default3.C: New test.

From-SVN: r109950
2006-01-19 09:51:57 +00:00
Mark Mitchell 520c308128 * decl2.c (mark_used): Fix typo in comment.
From-SVN: r109239
2006-01-02 17:53:44 +00:00
Mark Mitchell 7eab6e7b91 re PR c++/25369 (use of inline function in template class leads to undefined reference)
PR c++/25369
	* g++.dg/template/ptrmem16.C: New test.
	PR c++/25369
	* tree.c (really_overloaded_fn): Tweak comment.
	* pt.c (tsubst_call_declarator_parms): Remove.
	(tsubst_copy): Call mark_used on the member referenced by an
	OFFSET_REF.
	* semantics.c (finish_qualified_id_expr): Simplify.
	* decl2.c (mark_used): Accept BASELINKs.

From-SVN: r109010
2005-12-23 07:40:04 +00:00
Gabriel Dos Reis 0ac1b88953 decl2.c (get_priority_info): Use XNEW, not xmalloc.
* decl2.c (get_priority_info): Use XNEW, not xmalloc.
        * decl.c (push_switch): Likewise.
        * lex.c (handle_pragma_implementation): Likewise.
        * cp-objcp-common.c (decl_shadowed_for_var_insert): Use GGC_NEW,
        not ggc_alloc.
        (cxx_initialize_diagnostics): Use XNEW, not xmalloc.
        * class.c (init_class_processing): Use XNEWVEC, not xmalloc.
        * g++spec.c (lang_specific_driver): Likewise.
        * mangle.c (save_partially_mangled_name): Likewise.
        * parser.c (cp_lexer_new_main): Use GGC_NEWVEC, not ggc_alloc.
        (cp_parser_template_argument_list): Use XNEWVEC, nto xmalloc.
        (cp_parser_sizeof_operand): Likewise.
        * repo.c (open_repo_file, open_repo_file): Likewise.

From-SVN: r107884
2005-12-02 11:21:28 +00:00
Jason Merrill 96c993a890 re PR c++/17256 (undefined but used static or inline functions should be diagnosed)
PR c++/17256
        * decl2.c (cp_finish_file): Fix conditions for undefined warning.
        Set TREE_NO_WARNING instead of TREE_PUBLIC.
        * pt.c (instantiate_pending_templates): Set DECL_INITIAL to avoid
        a warning on a function we didn't instantiate because of excessive
        recursion.

Co-Authored-By: James A. Morrison <phython@gcc.gnu.org>

From-SVN: r106581
2005-11-07 01:17:47 -05:00
Kazu Hirata dd36d4e1da * decl2.c, init.c, typeck.c: Fix comment typos.
From-SVN: r106533
2005-11-05 20:34:08 +00:00
Mark Mitchell 2d22db1f2a re PR c++/24389 (template variable not getting marked as weak)
PR c++/24389
	* decl2.c (mark_used): Use uses_template_parms instead of
	dependent_type_p.
	* init.c (constant_value_1): Handle uninstantiated templates
	specially.
	* pt.c (instantiate_decl): Add sanity check.
	PR c++/24389
	* g++.dg/template/static21.C: New test.
	* g++.dg/template/static21-a.cc: Likewise.

From-SVN: r105474
2005-10-16 23:17:53 +00:00
Richard Guenther 6cec5cb56a re PR middle-end/15855 (g++ crash with -O2 and -O3 on input file)
2005-09-26  Richard Guenther  <rguenther@suse.de>

	PR middle-end/15855
	* decl2.c (do_static_destruction): Remove.
	(finish_static_initialization_or_destruction): Likewise.
	(DECL_EFFECTIVE_INIT_PRIORITY): New macro.
	(NEEDS_GUARD_P): Likewise.
	(do_static_initialization): Rename to
	do_static_initialization_or_destruction.  Process all
	initializers/destructors and handle common conditionalizing.
	(start_static_initialization_or_destruction): Rename to
	one_static_initialization_or_destruction.  Handle only
	decl-specific conditionalizing.
	(cp_finish_file): Call do_static_initialization_or_destruction.

From-SVN: r104642
2005-09-26 08:42:57 +00:00
Richard Henderson 56b4ea3de8 decl2.c (build_anon_union_vars): Copy attributes from the base addr.
* decl2.c (build_anon_union_vars): Copy attributes from the base addr.
        * pt.c (tsubst_decl): Substitute in DECL_VALUE_EXPR.

        * g++.dg/other/error8.C: Update expected diagnostic text.

From-SVN: r104160
2005-09-11 21:04:03 -07:00
Richard Henderson 9bfa80fb88 dbxout.c: Include expr.h.
* dbxout.c: Include expr.h.
        (dbxout_global_decl): Don't suppress for DECL_RTL unset.
        (dbxout_symbol): Handle DECL_VALUE_EXPR.
        * Makefile.in (dbxout.o): Add EXPR_H.
cp/
        * cp-tree.def (ALIAS_DECL): Remove.
        * cp-lang.c (cp_init_ts): Remove support for it.
        * error.c (dump_decl): Likewise.
        * name-lookup.c (pushdecl): Likewise.
        * semantics.c (finish_id_expression): Likewise.
        * decl2.c (build_anon_union_vars): Use a VAR_DECL with
        DECL_VALUE_EXPR instead.

From-SVN: r104106
2005-09-09 14:00:49 -07:00
Mark Mitchell 1ef0df4745 re PR c++/22252 (pragma interface/implementation still break synthesized methods)
PR c++/22252
	* decl.c (start_preparsed_function): Do not pay attention to
	#pragma interface for implicitly-defined methods.
	* decl2.c (cp_finish_file): Do not complain about uses of inline
	functions that have bodies, even if we decided not to emit the
	body in this translation unit.
	* semantics.c (note_decl_for_pch): Do not mess with linkage.
	(expand_or_defer_fn): Make inline, non-template functions COMDAT
	at this point.

	PR c++/22252
	* g++.dg/ext/interface1.C: New test.
	* g++.dg/ext/interface1.h: Likewise.
	* g++.dg/ext/interface1a.cc: Likewise.

From-SVN: r104103
2005-09-09 18:56:16 +00:00
Richard Henderson db5f8b93fe re PR debug/23190 (debug info omitted for uninitialized variables (stabs))
PR debug/23190
        * toplev.c (wrapup_global_declaration_1): Split out ...
        (wrapup_global_declaration_2): ... from ...
        (wrapup_global_declarations): ... here.  Return bool.
        (check_global_declaration_1): Split out ...
        (check_global_declarations): from here.
        (emit_debug_global_declarations): New.
        * toplev.h (wrapup_global_declaration_1, wrapup_global_declaration_2,
        check_global_declaration_1, emit_debug_global_declarations): Declare.
        * c-decl.c (c_write_global_declarations_1): Don't create a vector
        of decls.  Call wrapup_global_declaration_1,
        wrapup_global_declaration_2, check_global_declaration_1 directly.
        (c_write_global_declarations_2): New.
        (ext_block): New.
        (c_write_global_declarations): Call c_write_global_declarations_2.
        * langhooks.c (write_global_declarations): Call
        emit_debug_global_declarations.
        * cgraphunit.c (cgraph_varpool_remove_unreferenced_decls): Don't
        remove decls that have DECL_RTL_SET_P.
        * passes.c (rest_of_decl_compilation): Invoke
        cgraph_varpool_finalize_decl for all but functions.
cp/
        * decl.c (wrapup_globals_for_namespace): Call
        emit_debug_global_declarations.
        * decl2.c (cp_finish_file): Likewise.

From-SVN: r104065
2005-09-08 17:47:05 -07:00
Mark Mitchell 024f1251b5 re PR c++/23691 (`mpl_::bool_<false>::value' is not a valid template argument for type `bool' because it is a non-constant expression)
PR c++/23691
	* decl2.c (mark_used): Instantiate static data members initialized
	by constants, even in a template.

	PR c++/23691
	* g++.dg/template/static16.C: New test.

From-SVN: r104041
2005-09-08 18:56:42 +00:00
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