Commit Graph

54 Commits

Author SHA1 Message Date
Mark Mitchell 47aa0df475 re PR debug/12066 (g++ generates stabs for "char *" that gdb cannot read)
PR debug/12066
	* dbxout.c (dbxout_init): Use a langhook to find builtin types.
	* langhooks-def.h (lhd_return_null_tree_v): New function.
	(LANG_HOOKS_BUILTIN_TYPE_DECLS): New macro.
	(LANG_HOOKS_DECLS): Add it to the intializer.
	* langhooks.c (lhd_return_null_tree_v): New function.
	* langhooks.h (lang_hooks_for_decls): Add builtin_type_decls.


	PR debug/12066
	* cp-lang.c (LANG_HOOKS_BUILTIN_TYPE_DECLS): Define.
	* cp-tree.h (cxx_builtin_type_decls): Declare.
	* decl.c (builtin_type_decls): New variables.
	(cxx_builtin_type_decls): New function.
	(record_builtin_type): Add to builtin_type_decls.

From-SVN: r71478
2003-09-17 20:52:41 +00:00
Mark Mitchell a7e8c268ed re PR c++/3907 (nested template parm collides with member name)
* coverage.c (create_coverage): Do not call pushlevel/poplevel.
	* langhooks-def.h (lhd_do_nothing_iii_return_null_tree): New
	function.
	* langhooks.c (lhd_do_nothing_iii_return_null_tree): Define it.

	PR c++/3907
	* class.c (maybe_note_name_used_in_class): Refine test for whether
	or not we are in a class scope.

	* cp-tree.h (language_function): Remove x_expanding_p.
	(expanding_p): Remove.
	(doing_semantic_analysis_p): Remove.
	(scope_kind): Add sk_function_parms, sk_class,
	sk_namespace.
	(innermost_scope_kind): New method.
	* call.c (cxx_type_promotes_to): Use type_decays_to.
	* cp-lang.c (LANG_HOOKS_PUSHLEVEL): Redefine.
	(LANG_HOOKS_POPLEVEL): Likewise.
	* decl.c (cp_binding_level): Remove parm_flag, template_parms_p,
	template_spec_p, namespace_p, is_for_scope, is_try_scope, and
	is_catch_scope.  Add kind and explicit_spec_p.
	(cxx_scope_descriptor): Use a lookup table.
	(find_class_binding_level): Use "kind" field in binding_level, not
	the various flags.
	(pop_binding_level): Likewise.
	(innermost_nonclass_level): Likewise.
	(toplevel_bindings_p): Likewise.
	(namespace_bindings_p): Likewise.
	(template_parm_scope_p): Likewise.
	(innermost_scope_kind): New method.
	(current_tmpl_spec_kind): Use "kind" field in binding_level, not
	the various flags.
	(pushlevel): Remove check for doing_semantic_analysis_p.
	(begin_scope): Simplify.
	(add_decl_to_level): Use "kind" field in binding_level, not
	the various flags.
	(push_local_binding): Likewise.
	(pop_label): Remove check for doing_semantic_analysis_p.
	(poplevel): Use "kind" field in binding_level, not
	the various flags.
	(set_block): Remove check for doing_semantic_analysis_p.
	(pushlevel_class): Use "kind" field in binding_level, not
	the various flags.
	(poplevel_class): Likewise.
	(initial_push_namespace_scope): Likewise.
	(maybe_push_to_top_level): Likewise.
	(set_identifier_type_value_with_scope): Likewise.
	(pop_everything): Likewise.
	(maybe_process_template_type_declaration): Likewise.
	(pushtag): Likewise.
	(pushdecl): Likewise.
	(pushdecl_with_scope): Likewise.
	(check_previous_goto_1): Likewise.
	(define_label): Likewise.
	(finish_case_label): Likewise.
	(lookup_tag): Likewise.
	(unqualified_namespace_lookup): Likewise.
	(lookup_name_real): Likewise.
	(lookup_name_current_level): Likewise.
	(lookup_type_current_level): Likewise.
	(record_builtin_type): Likewise.
	(cp_make_fname_decl): Likewise.
	(maybe_inject_for_scope_var): Likewise.
	(cp_finish_decl): Remove check for doing_semantic_analysis_p.
	(start_function): Use begin_scope, not pushlevel.
	(finish_function): Use "kind" field in binding_level, not
	the various flags.
	(start_method): Use begin_scope, not pushlevel.
	(make_label_decl): Do not check expanding_p.
	(save_function-data): Do not set expanding_p.
	(cxx_push_function_context): Do not clear expanding_p.
	* semantics.c (cxx_expand_function_start): Do not set expanding_p.

	PR c++/3907
	* g++.dg/parse/template12.C: New test.

	* g++.dg/abi/bitfield11.C: New test.
	* g++.dg/abi/bitfield12.C: Likewise.

From-SVN: r71393
2003-09-15 00:59:28 +00:00
Richard Henderson 25c84396dd cgraph.h (struct cgraph_node): Rename lowered to analyzed.
* cgraph.h (struct cgraph_node): Rename lowered to analyzed.
        * cgraphunit.c: Update to match.
        (record_call_1): Rearrange.  Call lang hook for language nodes.
        (cgraph_analyze_function): Don't call lower_function.
        * langhooks.h (struct lang_hooks_for_callgraph): Replace
        lower_function with analyze_expr.
        * langhooks-def.h: Update to match.
        * langhooks.c (lhd_callgraph_analyze_expr): New.

        * decl2.c (cxx_callgraph_analyze_expr): New, from corpse of
        mark_member_pointers.
        (lower_function): Remove.
        * cp-tree.h: Update to match.
        * cp-lang.c (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): New.
        (LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION): Remove.

From-SVN: r71277
2003-09-10 12:16:20 -07:00
Mark Mitchell 9649812aae langhooks-def.h (lhd_register_builtin_type): New function.
* langhooks-def.h (lhd_register_builtin_type): New function.
	(LANG_HOOKS_REGISTER_BUILTIN_TYPE): New macro.
	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Update.
	* langhooks.h (lang_hooks_for_types): Add register_builtin_type.
	* langhooks.c (lhd_register_builtin_type): New function.
	* c-common.h (c_register_builtin_type): Declare.
	* c-common.c (c_register_builtin_type): New function.
	* c-lang.c (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define to
	c_register_builtin_type.
	* config/ia64/hpux.h (TARGET_OS_CPP_BUILTINS): Remove __fpreg,
	__float80, and __float128 macros.
	* config/ia64/ia64.c (ia64_init_builtins): Create __fpreg,
	__float80, and __float128 types.

	* cp-lang.c (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define to
	c_register_builtin_type.

	* gcc.dg/ia64-types1.c: New test.
	* gcc.dg/ia64-types2.c: Likewise.

From-SVN: r71227
2003-09-09 03:35:31 +00:00
Gabriel Dos Reis dba65e798f langhooks.c (lhd_print_error_function): Move from diagnostic.c.
* langhooks.c (lhd_print_error_function): Move from diagnostic.c.
	* Makefile.in (langhooks.o): Depend on diagnostic.h

From-SVN: r71165
2003-09-07 10:11:28 +00:00
Andrew Pinski 16b0d23f1b Missed part of my patch:
* langhooks-def.h (lhd_decl_uninit): Declare.
        (LANG_HOOKS_DECL_UNINIT): New macro.
        (LANG_HOOKS_INITIALIZER): Adjust.
        * langhooks.h (struct lang_hooks): Add new field
        decl_uninit.
        * langhooks.c (lhd_decl_uninit): Define.

From-SVN: r70580
2003-08-19 16:04:36 -07:00
Gabriel Dos Reis 21ecc5a77d opts.c (decode_options): Do language-specific initialization for the global diagnostic context.
* opts.c (decode_options): Do language-specific initialization for
	the global diagnostic context.
	* langhooks-def.h (lhd_initialize_diagnostics): Declare.
	(LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): New macro.
	(LANG_HOOKS_INITIALIZER): Adjust.
	* langhooks.h (struct lang_hooks): Add new field
	initialize_diagnostics.
	* langhooks.c (lhd_initialize_diagnostics): Define.

From-SVN: r70129
2003-08-03 22:14:47 +00:00
Kaveh R. Ghazi 703ad42b4b alias.c [...]: Remove unnecessary casts.
* alias.c alloc-pool.c bitmap.c bitmap.h bt-load.c builtins.c
	c-common.c c-decl.c c-incpath.c c-lex.c c-opts.c c-parse.in
	c-pragma.c c-typeck.c calls.c cfg.c cfganal.c cfgloop.c cfgrtl.c
	collect2.c combine.c conflict.c coverage.c cppexp.c cppfiles.c
	cpphash.c cppinit.c cpplex.c cpplib.c cppmacro.c cppspec.c
	cpptrad.c cse.c cselib.c dbxout.c defaults.h df.c dominance.c
	dwarf2out.c dwarfout.c emit-rtl.c except.c expmed.c expr.c final.c
	fix-header.c flow.c fold-const.c function.c gcc.c gccspec.c gcov.c
	gcse.c genattr.c genattrtab.c genautomata.c genconditions.c
	genemit.c genextract.c genoutput.c genrecog.c gensupport.c
	ggc-page.c ggc-simple.c global.c graph.c haifa-sched.c hashtable.c
	integrate.c jump.c langhooks.c lcm.c line-map.c local-alloc.c
	loop.c mips-tdump.c mips-tfile.c mkdeps.c optabs.c params.c
	postreload.c prefix.c print-tree.c protoize.c ra-build.c
	ra-colorize.c ra-rewrite.c ra.c recog.c reg-stack.c regclass.c
	regmove.c regrename.c reload.c reload1.c reorg.c resource.c
	sbitmap.c sched-deps.c sched-rgn.c sched-vis.c sdbout.c
	simplify-rtx.c ssa-ccp.c ssa.c stmt.c stor-layout.c timevar.c
	tlink.c toplev.c tree-dump.c tree.c unroll.c unwind-dw2-fde.c
	varasm.c varray.c vmsdbgout.c xcoffout.c: Remove unnecessary
	casts.

From-SVN: r69587
2003-07-19 14:47:15 +00:00
Geoffrey Keating 26e0dcb326 re PR middle-end/11498 (asm can't be used to give a variable its own name)
PR 11498
	* Makefile.in (c-opts.o): Add $(LANGHOOKS_DEF_H).
	(langhooks.o): Add $(GGC_H), gt-langhooks.h.
	(GTFILES): Add langhooks.c.
	(gt-langhooks.h): New.
	* c-common.h (c_static_assembler_name): Prototype.
	* c-lang.c (LANG_HOOKS_SET_DECL_ASSEMBLER_NAME): Define.
	* objc/objc-lang.c (LANG_HOOKS_SET_DECL_ASSEMBLER_NAME): Define.
	* c-opts.c: Include langhooks-def.h.
	(c_static_assembler_name): New.
	* langhooks.c: Include ggc.h.  Include gt-langhooks.h.
	(var_labelno): New.
	(lhd_set_decl_assembler_name): Give static objects with context
	unique names.
	* varasm.c (var_labelno): Delete.
	(make_decl_rtl): Don't change the assembler name once it's set.

From-SVN: r69527
2003-07-17 21:52:51 +00:00
Andreas Jaeger 0c20a65f04 jump.c: Convert prototypes to ISO C90.
* jump.c: Convert prototypes to ISO C90.
	* langhooks-def.h: Likewise.  Add extern to prototypes.
	* langhooks.c: Likewise.
	* langhooks.h: Likewise.
	* lcm.c: Likewise.
	* local-alloc.c: Likewise.
	* loop-init.c: Likewise.
	* loop-unroll.c: Likewise.
	* loop-unswitch.c: Likewise.
	* loop.c: Likewise.
	* loop.h: Likewise. Add extern to prototypes.
	* machmode.h: Likewise.
	* main.c: Likewise.
	* mbchar.c: Likewise.
	* mbchar.h: Likewise.
	* mkdeps.c: Likewise.
	* mkdeps.h: Likewise.
	* optabs.c: Likewise.
	* optabs.h: Likewise.
	* output.h: Likewise.
	* gccspec.c: Likwise.
	* postreload.c: Likewise.
	* prefix.c: Likewise.
	* prefix.h: Likewise.
	* print-rtl.c: Likewise.
	* print-tree.c: Likewise.
	* profile.c: Likewise.
	* read-rtl.c: Likewise.
	* real.c: Likewise.
	* real.h: Likewise.
	* recog.c: Likewise.
	* recog.h: Likewise.
	* reg-stack.c: Likewise.
	* regclass.c: Likewise.
	* regmove.c: Likewise.
	* regrename.c: Likewise.
	* regs.h: Likewise.
	* reload.c: Likewise.
	* reload.h: Likewise.
	* reload1.c: Likewise.
	* reorg.c: Likewise.
	* resource.c: Likewise.
	* resource.h: Likewise.
	* rtl-error.c: Likewise.
	* rtl.c: Likewise.
	* rtl.h: Likewise.
	* rtlanal.c: Likewise.

From-SVN: r68998
2003-07-06 11:56:09 +02:00
Kaveh R. Ghazi 0eff02cdae c4x.c: Don't include "c-tree.h".
* config/c4x/c4x.c: Don't include "c-tree.h".
	* config/pa/pa.c: Likewise.
	* langhooks.c: Likewise.
	* tree.h (poplevel): Declare.

From-SVN: r68016
2003-06-16 13:41:28 +00:00
Neil Booth 7fb26bb001 hooks.c (hook_int_size_t_constcharptr_int_0): New.
* hooks.c (hook_int_size_t_constcharptr_int_0): New.
	* hooks.h (hook_int_size_t_constcharptr_int_0): New.
	* langhooks-def.h (lhd_decode_option, LANG_HOOKS_DECODE_OPTION): Die.
	(LANG_HOOKS_HANDLE_OPTION, LANG_HOOKS_INITIALIZER): Update.
	* langhooks.c (lhd_decode_option): Remove.
	* langhooks.h (struct lang_hooks): Remove decode_option.
	* opts.c (handle_option): No longer use decode_option.
java:
	* Make-lang.in: Handle mostlyclean.
treelang:
	* Make-lang.in: Update for option handling.
	* lang.opt: New.
	* tree1.c: Include opts.h and t-options.h.
	(treelang_decode_option): Remove.
	(treelang_handle_option): New.
	* treetree.c (LANG_HOOKS_DECODE_OPTION): Remove.
	(LANG_HOOKS_HANDLE_OPTION): Override.
	* treetree.h (treelang_decode_option): Remove.
	(treelang_handle_option): New.

From-SVN: r67799
2003-06-11 22:21:10 +00:00
Andrew Haley e076f71a38 langhooks-def.h (LANG_HOOKS_DECL_OK_FOR_SIBCALL): New.
2003-05-21  Andrew Haley  <aph@redhat.com>

	* langhooks-def.h (LANG_HOOKS_DECL_OK_FOR_SIBCALL): New.
	(LANG_HOOKS_DECLS): Add LANG_HOOKS_DECL_OK_FOR_SIBCALL.
	(lhd_decl_ok_for_sibcall): New.
	* langhooks.c (lhd_decl_ok_for_sibcall): New.
	* langhooks.h (lang_hooks_for_decls.ok_for_sibcall): New field.
	* calls.c (expand_call): Check lang_hook before generating a
	sibcall.

2003-05-21  Andrew Haley  <aph@redhat.com>

	* lang.c (LANG_HOOKS_DECL_OK_FOR_SIBCALL): New.
	(java_decl_ok_for_sibcall): New.

From-SVN: r67713
2003-06-10 16:43:39 +00:00
Zack Weinberg d78e771d46 tree.c (tree_size): For all 'c' and 'x' nodes...
* tree.c (tree_size): For all 'c' and 'x' nodes, look directly
        at the sizes of the relevant structures, rather than relying
        on TREE_CODE_LENGTH.  Call lang_hooks.tree_size to get the
        sizes of any such we don't know about.  Use
        lang_hooks.identifier_size for IDENTIFIER_NODE.

        (initializer_zerop): Use CONSTRUCTOR_ELTS.
        * tree.def: Update commentary.  Make fourth element of
        the definition for all 'c' and 'x' nodes zero.

        * langhooks.h: New hook, tree_size / LANG_HOOKS_TREE_SIZE.
        * langhooks-def.h: Update to match.
        * langhooks.c: New default, lhd_tree_size.

        * c-common.def (SRCLOC): Kill.
        * c-pretty-print.c (pp_c_postfix_expression [case SRCLOC]):
        Remove entirely - was already #if-ed out.

ada:
        * ada-tree.def: Make fourth element for GNAT_LOOP_ID zero.
        * misc.c (gnat_tree_size): New function.
        (LANG_HOOKS_TREE_SIZE): Override.
cp:
        * cp-tree.def: Make fourth element for all 'c' and 'x' nodes zero.
        * cp-lang.c (cp_tree_size): New function.
        (LANG_HOOKS_TREE_SIZE): Override.

        * cp-tree.h (SOURCE_LOCUS, SRCLOC_FILE, SRCLOC_LINE, struct
        tree_srcloc, TS_CP_COMMON, TS_CP_SRCLOC): Kill.
        (union lang_tree_node): Remove common and srcloc members.
        (build_srcloc_here): Don't prototype.
        * decl.c (cp_tree_node_structure): Kill SRCLOC case.
        * pt.c (pending_templates): Correct comment.
        * tree.c (build_srcloc, build_srcloc_here): Kill.

From-SVN: r65323
2003-04-07 06:03:17 +00:00
Nathanael Nerode 2bd3ecadd8 c-common.h (c_dump_tree), [...]): Change return type from 'int' to 'bool'.
(gcc)
	* c-common.h (c_dump_tree), c-dump.c (c_dump_tree),
	langhooks-def.h (lhd_tree_dump_dump_tree),
	langhooks.c (lhd_tree_dump_dump_tree), langhooks.h (*dump_tree):
	Change return type from 'int' to 'bool'.  Replace 0 and 1 with
	true and false in return statements.
(cp)
	* dump.c (cp_dump_tree), cp-tree.h (cp_dump_tree): Change return
	type from 'int' to 'bool'. Replace 0 and 1 with true and false in
	return statements.
(java)
	* lang.c (java_dump_tree): Change return type from 'int' to 'bool'.
	Replace 0 and 1 with true and false in return statements.

From-SVN: r64596
2003-03-19 20:34:10 +00:00
Nathanael Nerode 54a7b5732a c-pch.c, [...]: Replace "GNU CC" with "GCC".
* c-pch.c, dummy-conditions.c, genautomata.c, genconditions.c,
	langhooks.c, tree-inline.c, unwind-dw2-fde-darwin.c,
	unwind-dw2-fde-glibc.c, unwind-libunwind.c, vmsdbgout.c: Replace
	"GNU CC" with "GCC".

From-SVN: r64297
2003-03-13 03:48:31 +00:00
Neil Booth 4bfec48308 c-common.h (c_common_init, [...]): Update.
* c-common.h (c_common_init, c_common_post_options): Update.
	* c-objc-common.c (c_objc_common_init): Update for new prototype.
	* c-opts.c (saved_lineno): New.
	(c_common_post_options, c_common_init): Update prototypes,
	move call to cpp_read_main_file from latter to former.
	* c-tree.h (c_ojbc_common_init): Update.
	* langhooks-def.h (lhd_post_options): New.
	(LANG_HOOKS_INIT, LANG_HOOKS_POST_OPTIONS): Update.
	* langhooks.c (lhd_post_options): New.
	* langhooks.h (struct lang_hooks): Update post_options and init hooks.
	* toplev.c (no_backend): New.
	(process_options): Call post_options hook and set main_input_filename
	and input_filename here.
	(lang_dependent_init, do_compile): post_options hook moved to
	process_options.
	* objc/objc-act.c (objc_init): Update prototype.
	* objc/objc-act.h (objc_init): Update prototype.
ada:
	* misc.c (gnat_init): Update for new prototype.
cp:
	* cp-tree.h (cxx_init): Update prototype.
	* lex.c (cxx_init): Similarly.
f:
	* com.c (ffe_init): Update prototype; move code to ffe_post_options.
	(ffe_post_options): New.
java:
	* lang.c (java_init): Update prototype, move code to java_post_options.
	(java_post_options): Similarly.
treelang:
	* tree1.c (in_fname): Fix type.
	(treelang_init): Update prototype and use of in_fname.
	* treelang.h (in_fname): Fix type.
	* treetree.c (tree_code_if_start, tree_code_if_else,
	tree_code_if_end, tree_code_create_function_prototype,
	tree_code_create_function_initial, tree_code_create_funciton_wrapup,
	tree_code_create_variable, tree_code_output_expression_statement)
	: Fix prototypes and use of filenames.
	* treetree.h: Similarly.

From-SVN: r64001
2003-03-08 21:12:26 +00:00
Kazu Hirata 3dc575ffdb calls.c: Fix comment formatting.
* calls.c: Fix comment formatting.
	* cfgloopanal.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* combine.c: Likewise.
	* dwarf2out.c: Likewise.
	* ggc-common.c: Likewise.
	* langhooks.c: Likewise.
	* loop-unroll.c: Likewise.
	* loop.c: Likewise.
	* ra-build.c: Likewise.
	* sbitmap.c: Likewise.
	* toplev.c: Likewise.

From-SVN: r63966
2003-03-08 01:38:27 +00:00
Matt Austern 2f51bb1d5a toplev.c, [...]: Move write_global_declarations from toplev.c to langhooks.c.
* toplev.c, langhooks.c, langhooks-def.h: Move
	write_global_declarations from toplev.c to langhooks.c.

From-SVN: r63094
2003-02-19 05:39:06 +00:00
Zack Weinberg 4977bab6ed Merge basic-improvements-branch to trunk
From-SVN: r60174
2002-12-16 18:23:00 +00:00
Kazu Hirata cc2902df52 dbxout.c: Follow spelling conventions.
* dbxout.c: Follow spelling conventions.
	* defaults.h: Likewise.
	* df.c: Likewise.
	* diagnostic.h: Likewise.
	* doloop.c: Likewise.
	* dwarf2out.c: Likewise.
	* dwarfout.c: Likewise.
	* emit-rtl.c: Likewise.
	* except.c: Likewise.
	* explow.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* expr.h: Likewise.
	* flags.h: Likewise.
	* flow.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* function.h: Likewise.
	* gcc.c: Likewise.
	* gcov-io.h: Likewise.
	* gcov.c: Likewise.
	* gcse.c: Likewise.
	* genattrtab.c: Likewise.
	* genconfig.c: Likewise.
	* genrecog.c: Likewise.
	* ggc-page.c: Likewise.
	* ggc.h: Likewise.
	* global.c: Likewise.
	* gthr-win32.h: Likewise.
	* integrate.c: Likewise.
	* jump.c: Likewise.
	* langhooks.c: Likewise.
	* langhooks.h: Likewise.
	* line-map.h: Likewise.
	* local-alloc.c: Likewise.
	* longlong.h: Likewise.
	* loop.c: Likewise.
	* loop.h: Likewise.

From-SVN: r57406
2002-09-22 14:09:34 +00:00
Tom Tromey 57ce46bb22 For PR java/6005 and PR java/7611:
* fold-const.c (fold_truthop): Use can_use_bit_fields_p.
	(fold): Likewise.
	* langhooks.c (lhd_can_use_bit_fields_p): New function.
	* langhooks-def.h (lhd_can_use_bit_fields_p): Declare.
	(LANG_HOOKS_CAN_USE_BIT_FIELDS_P): New define.
	(LANG_HOOKS_INITIALIZER): Use it.
	* langhooks.h (struct lang_hooks) [can_use_bit_fields_p]: New
	field.

From-SVN: r56498
2002-08-22 00:42:40 +00:00
Jason Merrill a77a9a18c0 langhooks-def.h (LANG_HOOKS_EXPR_SIZE): New macro.
* langhooks-def.h (LANG_HOOKS_EXPR_SIZE): New macro.
        * langhooks.c (lhd_expr_size): Define default.
        * langhooks.h (struct lang_hooks): Add expr_size.
        * explow.c (expr_size): Call it.
        * expr.c (store_expr): Don't copy an expression of size zero.
        (expand_expr) [CONSTRUCTOR]: Use expr_size to calculate how much
        to store.
        * Makefile.in (builtins.o): Depend on langhooks.h.

        * cp-lang.c (LANG_HOOKS_EXPR_SIZE): Define.
        (cp_expr_size): New fn.
        * call.c (build_over_call): Lose empty class hackery.
        (convert_arg_to_ellipsis): Promote non-POD warning to error.
        * typeck.c (build_modify_expr): Don't use save_expr on an lvalue.

From-SVN: r55983
2002-08-02 07:57:22 -04:00
Kazu Hirata e11e816ec7 langhooks.c: Fix formatting.
* langhooks.c: Fix formatting.
	* langhooks.h: Likewise.
	* lcm.c: Likewise.
	* libgcc2.c: Likewise.
	* lists.c: Likewise.
	* local-alloc.c: Likewise.
	* loop.c: Likewise.
	* loop.h: Likewise.

From-SVN: r54070
2002-05-30 20:55:11 +00:00
Neil Booth ff45c01ef4 c-common.h (c_common_parse_file): Update.
* c-common.h (c_common_parse_file): Update.
	* c-lang.c (LANG_HOOKS_SET_YYDEBUG): Remove.
	* c-lex.c (YYDEBUG): Get from c-lex.h.
	(c_common_parse_file): Update.
	* c-lex.h (YYDEBUG, yydebug): New.
	* c-parse.in (YYDEBUG): Get from c-lex.h.
	(c_set_yydebug): Remove.
	* c-tree.h (c_set_yydebug): Remove.
	* langhooks-def.h (lhd_do_nothing_i): New.
	(lhd_set_yydebug, LANG_HOOKS_SET_YYDEBUG): Remove.
	(LANG_HOOKS_PARSE_FILE, LANG_HOOKS_INITIALIZER): Update.
	* langhooks.c  (lhd_do_nothing_i): New.
	(lhd_set_yydebug): Remove.
	* langhooks.h (struct lang_hooks): Update.
	* toplev.c (set_yydebug): New.
	(compile_file): Update call to parse_file hook.
	(decode_d_option): Update.
ada:
	* misc.c (gnat_parse_file): Update.
cp:
	* cp-lang.c (LANG_HOOKS_SET_YYDEBUG): Remove.
	* cp-tree.h (cxx_set_yydebug): Die.
	* lex.c (YYDEBUG): Get from c-lex.h.
	(cxx_set_yydebug): Remove.
	* parse.y: Include c-lex.h.
	(YYDEBUG): Get from c-lex.h.
f:
	* com.h (ffe_parse_file): Update.
	* lex.c (ffe_parse_file): Update.
java:
	* java-tree.h (java_parse_file): Update.
	(java_set_yydebug): Remove.
	* jcf-parse.c (yydebug): Remove.
	(java_set_yydebug): Die.
	(java_parse_file): Update.
	* lang.c (LANG_HOOKS_SET_YYDEBUG): Remove.
objc:
	* objc-lang.c (LANG_HOOKS_SET_YYDEBUG): Remove.

From-SVN: r52753
2002-04-25 06:24:41 +00:00
Neil Booth b03e38e17e Makefile.in: Update.
* Makefile.in: Update.
	* decl.c (push_c_function_context, pop_c_function_context,
	mark_c_function_context): Rename for consistency.
	* c-objc-common.c (c_objc_common_init): Langhooks set elsewhere.
	* c-tree.h (push_c_function_context, pop_c_function_context,
	mark_c_function_context): Rename for consistency.
	* c-lang.c (LANG_HOOKS_FUNCTION_ENTER_NESTED,
	LANG_HOOKS_FUNCTION_LEAVE_NESTED, LANG_HOOKS_FUNCTION_MARK): Redefine.
	* function.c (init_lang_status, save_lang_status,
	restore_lang_status, mark_lang_status, free_lang_status):
	Move to langhooks.h.
	(push_function_context_to, pop_function_context_from,
	free_after_parsing, prepare_function_start, ggc_mark_struct_function):
	Update.
	* function.h (init_lang_status, save_lang_status,
	restore_lang_status, mark_lang_status, free_lang_status):
	Move to langhooks.h.
	* langhooks-def.h (LANG_HOOKS_FUNCTION_INIT,
	LANG_HOOKS_FUNCTION_FREE, LANG_HOOKS_FUNCTION_ENTER_NESTED,
	LANG_HOOKS_FUNCTION_LEAVE_NESTED, LANG_HOOKS_FUNCTION_MARK,
	LANG_HOOKS_FUNCTION_INITIALIZER): New.
	(LANG_HOOKS_INITIALIZER): Update.
	(lhd_do_nothing_f): New.
	* langhooks.h (struct lang_hooks_for_functions): New.
	(struct lang_hooks): New hooks.
	* langhooks.c (lhd_do_nothing_f): New.
cp:
	* cp-lang.c (LANG_HOOKS_FUNCTION_INIT,
	LANG_HOOKS_FUNCTION_FREE, LANG_HOOKS_FUNCTION_MARK): Redefine.
	* cp-tree.h (cxx_push_function_context, cxx_pop_function_context,
	cxx_mark_function_context): New.
	* decl.c (push_cp_function_context, pop_cp_function_context,
	mark_cp_function_context): Rename for consistency.
	(cxx_init_decl_processing): Don't set old hooks.
objc:
	* objc-lang.c (LANG_HOOKS_FUNCTION_ENTER_NESTED,
	LANG_HOOKS_FUNCTION_LEAVE_NESTED, LANG_HOOKS_FUNCTION_MARK): Redefine.

From-SVN: r52551
2002-04-20 09:14:37 +00:00
Neil Booth ab393bf171 builtins.c: Include langhooks.h.
* builtins.c: Include langhooks.h.
	(lang_type_promotes_to): Remove.
	(expand_builtin_va_arg): Use new hook.
	* c-common.c (c_common_nodes_and_builtins): Don't set hook.
	(simple_type_promotes_to): Move to c-typeck.c.
	* c-common.h (simple_type_promotes_to): Remove.
	* c-decl.c (duplicate_decls, grokdeclarator): Update.
	* c-format.c: Include langhooks.h.
	(check_format_types): Update.
	* c-tree.h (c_type_promotes_to): New.
	* c-typeck.c (c_type_promotes_to): Move from c-common.c.
	(type_lists_compatible_p): Update.
	* langhooks-def.h (lhd_type_promotes_to): New.
	(LANG_HOOKS_TYPE_PROMOTES_TO): New.
	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Update.
	* langhooks.c (lhd_type_promotes_to): New.
	* langhooks.h (struct lang_hooks_for_types): New hook.
	* tree.h (lang_type_promotes_to): Remove.
cp:
	* call.c (convert_type_from_ellipsis): Rename, update.
	* cp-lang.c (LANG_HOOKS_TYPE_PROMOTES_TO): Redefine.
	* cp-tree.h (convert_type_from_ellipsis): Rename.
	* decl.c (cxx_init_decl_processing): Don't set hook.
objc:
	* objc-lang.c (LANG_HOOKS_TYPE_PROMOTES_TO): Redefine.

From-SVN: r52512
2002-04-19 06:22:18 +00:00
Neil Booth 7a2289181e c-lang.c (LANG_HOOKS_INCOMPLETE_TYPE_ERROR): Redefine.
* c-lang.c (LANG_HOOKS_INCOMPLETE_TYPE_ERROR): Redefine.
	* c-tree.h (c_incomplete_type_error): New.
	* c-typeck.c (require_complete_type, build_component_ref): Update.
	(incomplete_type_error): Rename.
	* langhooks-def.h (lhd_incomplete_type_error): New.
	(LANG_HOOKS_INCOMPLETE_TYPE_ERROR): New.
	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Update.
	* langhooks.c (lhd_incomplete_type_error): New.
	* langhooks.h (struct lang_hooks_for_types): New hook.
	* tree.c (size_in_bytes): Use new hook.
	* tree.h (incomplete_type_error): Remove.
ada:	* gigi.h (incomplete_type_error): Remove.
	* utils.c (incomplete_type_error): Remove.
cp:
	* call.c (build_new_method_call): Update.
	* cp-lang.c (LANG_HOOKS_INCOMPLETE_TYPE_ERROR): Redefine.
	* cp-tree.h (cxx_incomplete_type_error): New.
	* decl.c (grokdeclarator, grokparms): Update.
	* decl2.c (check_classfn): Update.
	* pt.c (tsubst): Update.
	* typeck.c (complete_type_or_else, expr_sizeof,
	decay_conversion): Update.
	* typeck2.c (incomplete_type_error): Rename.
	(add_exception_specifier): Update.
f:
	* com.c (incomplete_type_error): Remove.
java:
	* typeck.c (incomplete_type_error): Remove.
objc:
	* objc-lang.c (LANG_HOOKS_INCOMPLETE_TYPE_ERROR): Redefine.

From-SVN: r52480
2002-04-18 17:54:11 +00:00
Richard Henderson ef4f94ac97 re PR rtl-optimization/4330 (Optimizer generates illegal assembly code)
PR opt/4330
        * langhooks.h (lang_hooks.decls.warn_unused_global): New.
        * toplev.c (check_global_declarations): Use it.
        * langhooks-def.h (lhd_warn_unused_global_decl): Declare.
        (LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL): New.
        (LANG_HOOKS_DECLS): Add it.
        * langhooks.c (lhd_warn_unused_global_decl): New.
        * c-decl.c (LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL): New.
        * c-objc-common.c (c_warn_unused_global_decl): New.
        * c-tree.h (c_warn_unused_global_decl): Declare.
        * objc/objc-lang.c (LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL): New.

        * cp-lang.c (cxx_warn_unused_global_decl): New.
        (LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL): New.

	* g++.dg/warn/Wunused-2.C: New.
	* gcc.dg/unused-4.c: New.

From-SVN: r51818
2002-04-03 14:39:51 -08:00
Neil Booth 599bba86df langhooks-def.h (lhd_set_decl_assembler_name, [...]): New.
* langhooks-def.h (lhd_set_decl_assembler_name,
	LANG_HOOKS_SET_DECL_ASSEMBLER_NAME): New.
	(LANG_HOOKS_INITIALIZER): Update.
	* langhooks.c (lhd_set_decl_assembler_name): New, from tree.c
	* langhooks.h (struct lang_hooks): New hook.
	* tree.c (set_decl_assembler_name): Move to langhooks.c.
	(lang_set_decl_assembler_name): Remove.
	(init_obstacks): Don't set hook.
	(decl_assembler_name): New function.
	* tree.h (DECL_ASSEMBLER_NAME): Turn into a function call.
	(decl_assembler_name): New.
	(lang_set_decl_assembler_name): Remove.
cp:
	* cp-lang.c (LANG_HOOKS_SET_DECL_ASSEMBLER_NAME): Redefine.
	* tree.c (init_tree): Don't set hook.

From-SVN: r51817
2002-04-03 22:26:37 +00:00
Neil Booth 48a7a23514 c-common.c (c_unsafe_for_reeval): Rename.
* c-common.c (c_unsafe_for_reeval): Rename.
	* c-common.h (c_unsafe_for_reeval): Rename.
	* c-decl.c (finish_incomplete_decl): Rename.
	(c_init_decl_processing): Don't set langhook.
	* c-lang.c (LANG_HOOKS_FINISH_INCOMPLETE_DECL,
	LANG_HOOKS_UNSAFE_FOR_REEVAL): Redefine.
	* c-objc-common.c (c_objc_common_init): Don't set langhook.
	* c-tree.h (finish_incomplete_decl): Rename.
	* langhooks-def.h (lhd_unsafe_for_reeval): New.
	(LANG_HOOKS_FINISH_INCOMPLETE_DECL, LANG_HOOKS_UNSAFE_FOR_REEVAL): New.
	(LANG_HOOKS_INITIALIZER): Update.
	* langhooks.c (lhd_unsafe_For_reeval): New.
	* langhooks.h (struct langhooks): New hooks.
	* toplev.c (incomplete_decl_finalize_hook): Remove.
	(wrapup_global_declarations): Update.
	* tree.c (lang_unsafe_for_reeval): Remove.
	(unsafe_for_reeval): Update.
	* tree.h (lang_unsafe_for_reeval, incomplete_decl_finalize_hook):
	Remove.
ada:
	* gigi.h (finish_incomplete_decl): Rename.
	* misc.c (LANG_HOOKS_FINISH_INCOMPLETE_DECL): Redefine.
	* utils.c (gnat_init_decl_processing): Don't set hook.
	(finish_incomplete_decl): Rename.
cp:
	* cp-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Redefine.
	* lex.c (cxx_init): Don't set hook.
objc:
	* objc-lang.c (LANG_HOOKS_FINISH_INCOMPLETE_DECL,
	LANG_HOOKS_UNSAFE_FOR_REEVAL): Redefine.

From-SVN: r51673
2002-03-31 22:40:57 +00:00
Neil Booth c9d892a83f c-common.c (c_expand_expr): Fix prototype.
* c-common.c (c_expand_expr): Fix prototype.
	* c-common.h (c_expand_expr): Always declare, update.
	* c-lang.c (LANG_HOOKS_EXPAND_EXPR): Redefine.
	* c-objc-common.c (c_objc_common_init): No global hook.
	* expr.c (expand_expr): Use langhook.
	* expr.h (enum expand_modifier): Conditionally declare.
	* langhooks-def.h (lhd_expand_expr, LANG_HOOKS_EXPAND_EXPR): New.
	(LANG_HOOKS_INITIALIZER): Update.
	* langhooks.c (lhd_expand_expr): New.
	* langhooks.h (struct lang_hooks): New hook.
	* toplev.c (lang_expand_expr_t, lang_expand_expr): Delete.
	(lang_independent_init): Don't default hook.
ada:
	* misc.c (LANG_HOOKS_EXPAND_EXPR): Redefine.
	(gnat_init): Don't set hook.
	(gnat_expand_expr): Fix prototype.
cp:
	* cp-lang.c (LANG_HOOKS_EXPAND_EXPR): Redefine.
	* cp-tree.h (init_cplus_expand): Remove.
	(cxx_expand_expr): New.
	* expr.c (cplus_expand_expr): Rename cxx_expand_expr,
	fix prototype.
	(init_cplus_expand): Remove.
	* lex.c (cxx_init): Don't call init_cplus_expand.
java:
	* expr.c (java_lang_expand_expr): Rename java_expand_expr,
	fix prototype.
	* java-tree.h (java_lang_expand_expr): Similarly.
	* lang.c (LANG_HOOKS_EXPAND_EXPR): Redefine.
	(java_init): Don't set hook.
objc:
	* objc-lang.c (LANG_HOOKS_EXPAND_EXPR): Redefine.

From-SVN: r51462
2002-03-27 18:28:06 +00:00
Neil Booth c88770e9df c-decl.c (maybe_build_cleanup): Remove.
* c-decl.c (maybe_build_cleanup): Remove.
	* expr.c (expand_expr): Use langhook.
	* langhooks-def.h (lhd_return_null_tree,
	LANG_HOOKS_MAYBE_BUILD_CLEANUP): New.
	(LANGHOOKS_INITIALIZER): Update.
	* langhooks.c (lhd_return_null_tree): New.
	* langhooks.h (struct lang_hooks): New hook.
	* tree-inline.c (initialize_inlined_parameters): Use langhook.
	* tree.h (maybe_build_cleanup): Remove.
ada:
	* misc.c (maybe_build_cleanup): Remove.
cp:
	* cp-tree.h (cxx_maybe_build_cleanup): New.
	* decl.c (destroy_local_var, hack_incomplete_structures): Update.
	(maybe_build_cleanup): Rename cxx_maybe_build_cleanup.
	* tree.c (build_target_expr): Update.
f:
	* com.c (maybe_build_cleanup): Remove.
java:
	* decl.c (maybe_build_cleanup): Remove.

From-SVN: r51324
2002-03-25 19:11:13 +00:00
Aldy Hernandez 2cb921f417 langhooks.c (lhd_tree_inlining_cannot_inline_tree_fn): Check flag_really_no_inline instead of optimize == 0.
2002-03-21  Aldy Hernandez  <aldyh@redhat.com>

        * langhooks.c (lhd_tree_inlining_cannot_inline_tree_fn): Check
        flag_really_no_inline instead of optimize == 0.

        * c-objc-common.c (c_cannot_inline_tree_fn): Same.

        * cp/tree.c (cp_cannot_inline_tree_fn): Same.

        * flags.h (flag_really_no_inline): New.

        * c-common.c (c_common_post_options): Initialzie
        flag_really_no_inline.

        * toplev.c (flag_really_no_inline): New.

From-SVN: r51146
2002-03-21 23:15:38 +00:00
Neil Booth 43577e6bd7 Makefile.in (fold-const.o, [...]): Update.
* Makefile.in (fold-const.o, stor-layout.o, stmt.o,
	sdbout.o, profile.o): Update.
	* c-common.c (c_common_nodes_and_builtins): Use pushdecl
	langhook.
	* c-common.h (gettags): Move here from tree.h.
	* c-tree.h (pushdecl, pushlevel, poplevel, set_block,
	insert_block, getdecls, kept_level_p, global_bindings_p): New.
	* dbxout.c (dbxout_init): Use getdecls langhook.
	* expr.c (expand_expr): Use insert_block langhook.
	* fold-const.c: Include langhooks.h.
	(fold_range_test, fold_binary_op_with_conditional_arg,
	fold): Use global_bindings_p langhook.
	* integrate.c (expand_inline_function): Use insert_block langhook.
	* langhooks-def.h (LANG_HOOKS_DECLS, LANG_HOOKS_PUSHLEVEL,
	LANG_HOOKS_POPLEVEL, LANG_HOOKS_GLOBAL_BINDINGS_P,
	LANG_HOOKS_INSERT_BLOCK, LANG_HOOKS_SET_BLOCK, LANG_HOOKS_PUSHDECL,
	LANG_HOOKS_GETDECLS): New.
	(LANG_HOOKS_INITIALIZER): Update.
	* langhooks.c (lhd_clear_binding_stack): Use global_bindings_p
	langhook.
	* langhooks.h (struct lang_hooks_for_decls): New.
	(struct lang_hooks): Update.
	* profile.c: Include langhooks.h.
	(output_func_start_profiler): Use new langhooks.
	* sdbout.c: Include langhooks.h.
	(sdbout_init, sdbout_finish): Use getdecls langhook.
	* stmt.c: Include langhooks.h.
	(expand_fixup, fixup_gotos): Use new langhooks.
	* stor-layout.c: Include langhooks.h.
	(variable_size): Use global_bindings_p langhook.
	* toplev.c (compile_file): Use getdecls langhook.
	* tree-inline.c (remap_block): Use insert_block langhook.
	* tree.h (pushdecl, pushlevel, poplevel, set_block, gettags,
	insert_block, getdecls, kept_level_p, global_bindings_p): Remove.
cp:
	* cp-tree.h (pushdecl, pushlevel, poplevel, set_block,
	insert_block, getdecls, global_bindings_p): New.
java:
	* cp-tree.h (pushdecl, pushlevel, poplevel, set_block,
	insert_block, getdecls, kept_level_p, global_bindings_p): New.
f:
	* cp-tree.h (pushdecl, pushlevel, poplevel, set_block,
	insert_block, getdecls, global_bindings_p): New.

From-SVN: r51136
2002-03-21 18:39:29 +00:00
Neil Booth 7afff7cfb0 Makefile.in: Update.
* Makefile.in: Update.
	* c-common.c: Include langhooks.h.
	(inline_forbidden_p): Use new hook.
	* diagnostic.c: Include langhooks.h.
	(format_with_decl, announce_function,
	default_print_error_function): Use new hook.
	* dwarf2out.c (dwarf2_name): Use new hook.
	* function.c: Include langhooks.h.
	(init_function_start): Use new hook.
	* langhooks-def.h (lhd_decl_printable_name): New.
	(LANGHOOKS_DECL_PRINTABLE_NAME): New.
	(LANGHOOKS_INITIALIZER): Update.
	* langhooks.c (lhd_decl_printable_name): New.
	* langhooks.h (struct lang_hooks): New hook.
	* toplev.c (decl_name, decl_printable_name): Remove.
	(open_dump_file): Use new hook.
	(process_options): Remove old hook.
	* tree.h (decl_printable_name): Remove.
ada:
	* misc.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
	(gnat_init): Remove old hook.
cp:
	* cp-lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
	* cp-tree.h (lang_printable_name): Rename.
	* error.c (lang_decl_name): Use new hook.
	* lex.c (cxx_init): Remove old hook.
	* pt.c (tsubst_expr): Use new hook.
	* tree.c (lang_printable_name): Rename.
f:
	* com.c (lang_printable_name): Rename.
	(LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
	(ffe_init): Don't use old hook.
java:
	* decl.c (start_java_method): Use new hook.
	* lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
	(java_init): Remove old hook.
objc:
	* objc-act.c (objc_init): Remove old hook.
	(objc_printable_name): Export.
	* objc-act.h (objc_printable_name): New.
	* objc-lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.

From-SVN: r51066
2002-03-20 07:58:41 +00:00
Jakub Jelinek f735a15348 re PR c/5656 (ICE in emit_move_insn, at expr.c:2748, regression from gcc 3.0)
PR c/5656
	* langhooks.h (struct lang_hooks_for_tree_inlining): Add
	convert_parm_for_inlining.
	* c-lang.c (LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING):
	Define.
	* langhooks-def.h: Likewise.
	* objc/objc-lang.c: Likewise.
	* langhooks.c (lhd_tree_inlining_convert_parm_for_inlining): New
	function.
	* tree-inline.c (initialize_inlined_parameters):
	Call convert_parm_for_inlining lang hook if needed.
	* c-typeck.c (c_convert_parm_for_inlining): New function.
	* c-tree.h (c_convert_parm_for_inlining): Add prototype.

	* gcc.c-torture/compile/20020318-1.c: New test.

From-SVN: r51025
2002-03-19 09:47:14 +01:00
Neil Booth 63e1b1c4b0 Makefile.in (integrate.o): Update.
* Makefile.in (integrate.o): Update.
	* c-decl.c (copy_lang_decl): Rename.
	* c-lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine.
	* integrate.c: Include langhooks.h.
	(copy_decl_for_inlining): Update to use langhook.
	* langhooks-def.h (lhd_do_nothing_t,
	LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): New.
	(LANG_HOOKS_INITIALIZER): Update.
	* langhooks.c (lhd_do_nothing_t): New.
	* langhooks.h (struct lang_hooks): Add dup_lang_specific_decl.
	* tree.h (copy_lang_decl): Remove.
ada:
	* misc.c (copy_lang_decl): Remove.
cp:
	* class.c (build_clone): Update.
	* cp-lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine.
	* cp-tree.h (cxx_dup_lang_specific_decl): New.
	* lex.c (copy_lang_decl): Rename cxx_dup_lang_specific_decl.
	(copy_decl): Update.
	* method.c (make_thunk): Update.
f:
	* com.c (copy_lang_decl): Delete.
java:
	* decl.c (copy_lang_decl): Rename java_dup_lang_specific_decl.
	* java-tree.h (java_dup_lang_specific_decl): New.
	* lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine.
objc:
	* objc-lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine.

From-SVN: r50122
2002-02-28 07:39:44 +00:00
Diego Novillo 29ac78d5fe * langhooks.c: Include flags.h.
From-SVN: r49955
2002-02-21 23:23:21 -05:00
Aldy Hernandez 6aa77e6c39 attr-alwaysinline.c: New.
2002-02-21  Aldy Hernandez  <aldyh@redhat.com>

        * gcc.dg/attr-alwaysinline.c: New.

        * c-common.c (c_common_post_options): Set inline trees by
        default.

        * doc/extend.texi (Function Attributes): Document always_inline
        attribute.
        Update documentation about inlining when not optimizing.

        * cp/decl.c (duplicate_decls): Merge always_inline attribute.

        * cp/tree.c (cp_cannot_inline_tree_fn): Do not inline at -O0
        unless DECL_ALWAYS_INLINE.

        * c-objc-common.c (c_cannot_inline_tree_fn): Do not inline at -O0
        unless DECL_ALWAYS_INLINE.
        (c_disregard_inline_limits): Disregard if always_inline set.

        * langhooks.c (lhd_tree_inlining_disregard_inline_limits):
        Disregard if always_inline set.
        (lhd_tree_inlining_cannot_inline_tree_fn): Do not inline at -O0
        unless DECL_ALWAYS_INLINE.

        * attribs.c (handle_always_inline_attribute): New.
        (c_common_attribute_table): Add always_inline.

        * config/rs6000/altivec.h: Add prototypes for builtins
        requiring the always_inline attribute.

From-SVN: r49947
2002-02-22 00:09:04 +00:00
Kaveh R. Ghazi 990290e85d * langhooks.c (lhd_staticp): Mark parameter with ATTRIBUTE_UNUSED.
From-SVN: r47727
2001-12-06 18:15:46 +00:00
Jason Merrill 742a37d529 langhooks.h (struct lang_hooks_for_tree_inlining): Add start_inlining, end_inlining.
* langhooks.h (struct lang_hooks_for_tree_inlining): Add
        start_inlining, end_inlining.
        * tree-inline.c (expand_call_inline): Call them.
        * langhooks-def.h (LANG_HOOKS_TREE_INLINING_START_INLINING): Define.
        (LANG_HOOKS_TREE_INLINING_END_INLINING): Define.
        (LANG_HOOKS_TREE_INLINING_INITIALIZER): Add them.
        * langhooks.c (lhd_tree_inlining_start_inlining): New fn.
        (lhd_tree_inlining_end_inlining): New fn.

        * cp-lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING): Define.
        (LANG_HOOKS_TREE_INLINING_END_INLINING): Define.
        * tree.c (cp_start_inlining, cp_end_inlining): New fns.
        * pt.c (push_tinst_level): No longer static.
        * cp-tree.h: Declare them.

        * init.c (resolve_offset_ref): Don't check access for the base
        conversion to access a FIELD_DECL.

        * cp-tree.h (TYPE_REFFN_P): New macro.
        * decl.c (bad_specifiers): Check it, too.

        * rtti.c (create_pseudo_type_info): Set CLASSTYPE_INTERFACE_ONLY
        on the __*_type_info type if we haven't seen a definition.

From-SVN: r47703
2001-12-05 18:48:19 -05:00
Joseph Myers d062a680ab langhooks.h (struct lang_hooks): Add staticp.
* langhooks.h (struct lang_hooks): Add staticp.
	* langhooks-def.h (lhd_staticp, LANG_HOOKS_STATICP): New.
	(LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_STATICP.
	* langhooks.c (lhd_staticp): New function.
	* tree.c (staticp): Call lang_hooks.staticp for language-specific
	tree codes.

From-SVN: r47628
2001-12-04 22:49:20 +00:00
Richard Kenner f80230c1e8 * langhooks.c (lhd_safe_from_p): Add ATTRIBUTE_UNUSED.
From-SVN: r47413
2001-11-28 07:13:50 -05:00
Richard Kenner ac79cd5ab9 Makefile.in (c-lang.o): Depends on langhooks-def.h.
* Makefile.in (c-lang.o): Depends on langhooks-def.h.
	(expr.o, varasm.o): Depends on langhooks.h.
	* c-common.c (c_safe_from_p): Always declare.
	(c_expand_expr): Refine when declared.
	* c-lang.c (c-common.h): Now include.
	(LANG_HOOKS_SAFE_FROM_P): Define new hook.
	(c_init): Don't set lang_safe_from_expr.
	* expr.c (langhooks.h): Now include.
	(lang_safe_from_p): No longer define.
	(safe_from_p): Use lang hook.
	(expand_expr): Set IGNORE if VOID_TYPE result of VIEW_CONVERT_EXPR too.
	(expand_expr, case VIEW_CONVERT_EXPR): Pass ro_modifier down.
	* expr.h (lang_expand_constant, lang_safe_from_p): Delete.
	* langhooks-def.h (lhd_return_tree, lhd_safe_from_p): New decls.
	(LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_SAFE_FROM_P): New hooks.
	* langhooks.c (lhd_return_tree, lhd_safe_from_p): New functions.
	* langhooks.h (struct lang_hooks): New fields expand_constant
	and safe_from_p.
	* output.h (output_constant): Size arg is HOST_WIDE_INT.
	* stmt.c (expand_decl_init): No longer need to expand constant
	for CONST_DECL.
	* stor-layout.c (put_pending_size): Don't check for SAVE_EXPR.
	* toplev.c (lang_expand_constant): Delete var.
	* tree.c (save_expr): Don't put another SAVE_EXPR around simple
	operations on SAVE_EXPR.
	* varasm.c (langhooks.h): Now include.
	(compare_constant_1): Use lang_hooks, not lang_expand_constant.
	(record_constant_1, output_addressed_constants): Likewise.
	(initializer_constant_valid_p, output_constant): Likewise.
	(output_constant_def): Process no-defer of string constant.
	(output_addressed_constants, case ADDR_EXPR): Use handled_component_p.
	(output_constant): Strip more conversions.
	Track our size and pad for the rest.
	(array_size_for_constructor): Remove code for non-byte STRING_CST.
	(output_constructor): SIZE now HOST_WIDE_INT.
	* cp/Make-lang.in (cp-lang.o): Depends on c-common.h.
	* cp/cp-lang.c (c-common.h): Include.
	(LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_SAFE_FROM_P): New hooks.
	* cp/decl.c (cxx_init_decl_processing): Don't set lang_safe_from_p.
	* cp/expr.c (init_cplus_expand): Don't set lang_expand_constant.

From-SVN: r47376
2001-11-27 09:31:29 -05:00
Bryce McKinlay 89d684bba3 tree-dump.c: Rename from c-dump.c.
* tree-dump.c: Rename from c-dump.c. Include c-tree.h, not c-common.h.
	(lang_type_quals): Declare.
	(dequeue_and_dump): Use lang_hooks.tree_dump.type_quals function to
	retrieve language-specific qualifiers for a type node, instead of
	C_TYPE_QUALS. Likewise for lang_hooks.tree_dump.dump_tree instead of
	lang_dump_tree.
	* tree-dump.h: Rename from c-dump.h.
	* c-common.h (C_TYPE_QUALS): Removed.
	Move declarations for tree-dump.c interface to...
	* tree.h: ... here. Remove lang_dump_tree.
	* langhooks.h (struct lang_hooks_for_tree_dump): New.
	(struct lang_hooks): Add tree_dump hooks.
	* langhooks.c (lhd_tree_dump_dump_tree): New function.
	(lhd_tree_dump_type_quals): New function.
	* langhooks-def.h (lhd_tree_dump_dump_tree, lhd_tree_dump_type_quals):
	Declare.
	(LANG_HOOKS_INITIALIZER): Add tree_dump hooks.
	* Makefile.in: Move tree-dump.o to language-independent back-end.

cp:
	* cp-tree.h (CP_TYPE_QUALS): Removed.
	* decl.c (cxx_init_decl_processing): Don't set lang_dump_tree.
	* cp-lang.c: Set LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN and
	LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN.
	* dump.c (cp_dump_tree): Use void* dump_info argument to match
	lang-hooks prototype.
	* call.c, cp-tree.h, cvt.c, decl.c, init.c, mangle.c, method.c, pt.c,
	rtti.c, semantics.c, tree.c, typeck.c, typeck2.c: All references to
	CP_TYPE_QUALS changed to cp_type_quals.
	* Make-lang.in: References to c-dump.h changed to tree-dump.h.
	(CXX_C_OBJS): Remove c-dump.o.

From-SVN: r47257
2001-11-22 02:33:02 +00:00
Neil Booth 5d69f816bc Makefile.in: Update.
* Makefile.in: Update.
	* c-decl.c (print_lang_decl, print_lang_type): Remove.
	(print_lang_identifier): Rename c_print_identifier.
	* c-lang.c (LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_SET_YYDEBUG): New.
	(print_lang_statistics, lang_print_xnode): Remove.
	* c-parse.in (set_yydebug): Rename c_set_yydebug.
	* c-tree.h (c_set_yydebug, c_print_identifier): New.
	* langhooks-def.h (lhd_print_tree_nothing, lhd_set_yydebug): New.
	LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
	LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
	LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_SET_YYDEBUG): New.
	(LANG_HOOKS_INITIALIZER): Update.
	* langhooks.h (struct lang_hooks): New members.
	(lang_print_tree_hook): New.
	* langhooks.c (lhd_print_tree_nothing, lhd_set_yydebug): New.
	* print-tree.c: Include langhooks.h.
	(print_node): Update.
	* toplev.c (decode_d_option): Update.
	* tree.c: Include langhooks.h.
	(dump_tree_statistics): Update.
	* tree.h (print_lang_statistics, print_lang_decl, print_lang_type,
	print_lang_identifier, set_yydebug, lang_print_xnode): Remove.
ada:
	* misc.c (gnat_print_decl, gnat_print_type): Renamed.
	(LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE): Override.
	(print_lang_statistics, lang_print_xnode, print_lang_identifier,
	set_yydebug): Remove.
cp:
	* cp-lang.c (LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE,
	LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE,
	LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_SET_YYDEBUG): Override.
	* cp-tree.h (print_class_statistics): Remove.
	(cxx_print_statistics, cxx_print_xnode, cxx_print_decl, cxx_print_type,
	cxx_print_identifier, cxx_set_yydebug): New.
	* lex.c (set_yydebug): Rename c_set_yydebug.
	* ptree.c (print_lang_decl, print_lang_type, print_lang_identifier,
	lang_print_xnode): Rename.
	* tree.c (print_lang_statistics): Rename.
f:
	* com.c (ffe_print_identifier): Rename.
	(LANG_HOOKS_PRINT_IDENTIFIER): Override.
	(lang_print_xnode, print_lang_decl, print_lang_statistics,
	print_lang_type, set_yydebug): Remove.
java:
	* java-tree.h (java_set_yydebug): New.
	* jcf-parse.c (set_yydebug): Rename java_set_yydebug.
	* lang.c (LANG_HOOKS_SET_YYDEBUG): Override.
	(print_lang_decl, print_lang_type, print_lang_identifier,
	print_lang_statistics, lang_print_xnode): Remove.
objc:
	* objc-act.c (LANG_HOOKS_PRINT_IDENTIFIER,
	LANG_HOOKS_SET_YYDEBUG): Override.
	(lang_print_xnode, print_lang_statistics): Remove.

From-SVN: r46907
2001-11-09 23:30:44 +00:00
Neil Booth d23c55c28c Clean up langhooks
* alias.c:: Include langhooks.h.
	* emit-rtl.c: Similarly.
	* toplev.c: Similarly.
	* tree-inline.c: Similarly.
	* langhooks-def.h: New, the old langhooks.h.  Give the default
	hooks a common prefix.
	* langhooks.h: Contents extracted from toplev.h.
	* toplev.h: Move langhook stuff to langhooks.h.
	* langhooks.c: Give default hooks a common prefix.

	* c-lang.c: Include langhooks-def.h.
	* ada/misc.c: Similarly.
	* cp/cp-lang.c: Similarly.
	* f/com.c: Similarly.
	* java/lang.c: Similarly.
	* objc/objc-act.c: Similarly.

	* Makefile.in: Update.
	* ada/Makefile.in: Similarly.
	* cp/Make-lang.in: Similarly.
	* f/Make-lang.in: Similarly.
	* java/Make-lang.in: Similarly.
	* objc/Make-lang.in: Similarly.

From-SVN: r46813
2001-11-06 21:12:14 +00:00
Zack Weinberg 37207ee73d langhooks.c (lang_hook_default_clear_binding_stack): New.
* langhooks.c (lang_hook_default_clear_binding_stack): New.
	(lang_hook_default_get_alias_set): Move next to other alias
	hooks.
	* langhooks.h: Prototype lang_hook_default_clear_binding_stack.
	(LANG_HOOKS_CLEAR_BINDING_STACK): New macro.
	(LANG_HOOKS_INITIALIZER): Add it.
	* toplev.h (struct lang_hooks): Add clear_binding_stack.
	* toplev.c (compile_file):  Call lang_hooks.clear_binding_stack
	instead of a loop calling poplevel.
cp:
	* cp-lang.c: Redefine LANG_HOOKS_CLEAR_BINDING_STACK to
	pop_everything.

From-SVN: r46492
2001-10-25 17:57:03 +00:00
Richard Kenner 8ac61af705 alias.c (can_address_p): Compnonents are not addressable if the containing type has alias set 0.
* alias.c (can_address_p): Compnonents are not addressable if
	the containing type has alias set 0.
	(get_alias_set): Rework to use STRIP_NOPS.
	Only call front-end routine on object, type, or object with
	NOPs stripped, not inner values.
	Use language hook to call front-end routine.
	* builtins.c (get_memory_rtx): Always call set_mem_attributes.
	(expand_builtin_apply): Call set_mem_align on MEMs we make.
	Don't pass alignment to emit_block_move.
	(expand_builtin_memcpy, expand_builtin_va_copy): Likewise.
	(expand_builtin_memset): Likewise, but for clear_storage.
	* c-common.c (lang_get_alias_set): Renamed to c_common_alias_set
	and remove C++ specific parts.
	* c-common.h (c_common_get_alias_set): Add declaration.
	* c-lang.c (LANG_HOOKS_GET_ALIAS_SET): New macro.
	* calls.c (emit_call_1): Fix typo in sibcall_pop case.
	(save_fixed_argument_area): Call set_mem_align.
	Remove alignment in call to emit_block_move.
	(emit_library_call_value_1, store_one_arg): Likewise.
	(target_for_arg): Remove; disabled long ago.
	* emit-rtl.c (set_mem_attributes): Rework to only call get_mem_attrs
	once and similar cleanups.
	(offset_address): Use proper introductory comment.
	* expr.c (emit_block_move): Use alignment from that of MEM args, not
	from explicit operand; all callers changed.
	(clear_storage): Likewise.
	(expand_assignment): Don't call set_mem_alias_set on to_rtx.
	(store_field): Remove kludge on alias set used for to_rtx.
	(highest_pow2_factor, case *_DIV_EXPR): Never return 0.
	(expand_expr_unaligned): Call set_mem_attributes instead of
	set_mem_alias_set.
	* expr.h (emit_block_move, clear_storage): Remove ALIGN argument.
	* function.c (assign_stack_temp_for_type): Set MEM alignment.
	(expand_function_end): Track MEM attributes of trampolines.
	* ifcvt.c (noce_try_cmove_arith): Set alignment of new MEM.
	* integrate.c (copy_rtx_and_substitute, case CALL): Copy memory
	attributes from original.
	* langhooks.c (lang_hook_default_get_alias_set): New function.
	(hook_get_alias_set_0): New function.
	* langhooks.h (hook_get_alias_set_0): New declaration.
	(lang_hook_default_get_alias_set): Likewise.
	(LANG_HOOKS_GET_ALIAS_SET): New macro; add to initializer.
	* reload1.c (alter_reg): Use adjust_address_nv.
	* rtl.c (get_mode_alignment): Moved to here.
	* rtl.h (MEM_ALIGN): Take default from mode, if not BLKmode, and
	change default if unknown from 1 to BITS_PER_UNIT.
	* stor-layout.c (get_mode_alignment): Remove from here.
	* toplev.h (struct lang_hoks): Add get_alias_set field.
	* tree.h (lang_get_alias_set): Delete declaration.
	* config/arc/arc.c (arc_setup_incoming_varags): Set MEM alignment.
	* config/i386/i386.c (ix86_setup_incoming_varargs): Likewise.
	(ix86_va_arg): Likewise.
	* config/i960/i960.c (i960_setup_incoming_varargs): Likewise.
	* config/pa/pa.c (hppa_builtin_saveregs): Likewise.
	* config/sparc/sparc.c (sparc_va_arg): Likewise.
	* config/rs6000/rs6000.c (setup_incoming_varargs): Likewise.
	(expand_block_move_mem): Remove dead code.
	* cp/cp-lang.c (cxx_get_alias_set): New function.
	Point LANG_HOOKS_GET_ALIAS_SET to it.
	* f/com.c (LANG_HOOKS_GET_ALIAS_SET): New macro.
	(lang_get_alias_set): Delete.
	* java/lang.c (lang_get_alias_set): Deleted.

From-SVN: r46440
2001-10-23 14:51:18 -04:00