Commit Graph

89 Commits

Author SHA1 Message Date
Richard Henderson 84936f6f88 langhooks-def.h (LANG_HOOKS_GIMPLE_BEFORE_INLINING): Remove.
* langhooks-def.h (LANG_HOOKS_GIMPLE_BEFORE_INLINING): Remove.
        * langhooks.h (struct lang_hooks): Remove gimple_before_inlining.
        * tree-inline.c (copy_body_r, setup_one_parameter,
        initialize_inlined_parameters, expand_call_inline,
        declare_inline_vars): Don't check it.
        (expand_calls_inline): Remove old version, rename new version
        from gimple_expand_calls_inline.
        * tree-optimize.c (execute_gimple): Remove.
        (pass_gimple): Don't run anything.

From-SVN: r84190
2004-07-06 20:19:55 -07:00
Richard Kenner 5377d5ba39 langhooks-def.h (LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P): Extra arg.
* langhooks-def.h (LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P): Extra arg.
	* langhooks.h (var_mod_type_p): Likewise.
	* c-decl.c (finish_decl): Add extra arg to variably_modified_type_p.
	* expr.c (count_type_elements): Properly handle return from
	array_type_nelts and properly test for overflow.
	* gimplify.c (gimplify_init_constructor): Properly handle return
	from array_type_nelts.
	(gimplify_addr_expr): Remove redundant clear of TREE_SIDE_EFFECTS.
	* integrate.c (copy_decl_for_inlining): Correct comments.
	* tree-inline.c (remap_decl): Update comments, remove dead code,
	and copy DECL_FIELD_OFFSET and DECL_QUALIFIER, if they exist.
	(remap_type): Only remap if variably modified by vars in function
	being inlined.
	(copy_body_r): Use compatible_type langhooks to see when can fold.
	(setup_one_parameter): Don't remap type.
	(inline_forbidden_p_1): Add arg to variably_modified_type_p.
	* tree.c (recompute_tree_invarant_for_addr_expr): Properly
	compute TREE_INVARIANT for decl case.
	(find_var_from_fn): New function.
	(variably_modified_type_p): Add arg and call new function.
	* tree.h (variably_modified_type_p): Add extra arg.

	* cp/cp-lang.c (cp_var_mod_type_p): Add extra arg.
	* cp/decl.c (grokdeclarator): Extra arg to variably_modified_type_p.
	* cp/pt.c (check_instantiated_args, unify): Likewise.

From-SVN: r84144
2004-07-05 22:20:16 -04:00
Richard Kenner 8963a5172c function.c, [...]: Move max_size hook to type hooks; remove bogus PARAMS.
* function.c, langhooks-def.h, langhooks.h: Move max_size hook
	to type hooks; remove bogus PARAMS.

From-SVN: r84113
2004-07-05 10:22:28 -04:00
Richard Kenner e30bb772cb langhooks-def.h (LANG_HOOKS_TYPE_MAX_SIZE): New langhook.
* langhooks-def.h (LANG_HOOKS_TYPE_MAX_SIZE): New langhook.
	* langhooks.h (strct lang_hooks): New field type_max_size.
	* function.c (assign_temp): Call it.

From-SVN: r84053
2004-07-03 09:40:47 -04:00
Richard Henderson 0f59171d71 tree.def (VTABLE_REF): Remove.
* tree.def (VTABLE_REF): Remove.
        (OBJ_TYPE_REF): New.
        (TRY_CATCH_EXPR, TRY_FINALLY_EXPR): Set type 's'.
        * expr.c (expand_expr_real_1): Replace VTABLE_REF with OBJ_TYPE_REF.
        * fold-const.c (non_lvalue): Likewise.
        * gimplify.c (gimplify_expr): Likewise.
        (gimplify_call_expr): Use is_gimple_call_addr.
        * langhooks-def.h (LANG_HOOKS_FOLD_OBJ_TYPE_REF): New.
        * langhooks.h (fold_obj_type_ref): New.
        * tree-gimple.c (is_gimple_call_addr): New.
        * tree-gimple.h (is_gimple_call_addr): Declare.
        * tree-inline.c (inlinable_function_p): Fix merge error.
        (estimate_num_insns_1): Replace VTABLE_REF with OBJ_TYPE_REF.
        * tree-pretty-print.c (dump_generic_node): Likewise.
        (print_call_name): Handle OBJ_TYPE_REF.
        * tree-ssa-ccp.c (fold_stmt): Fold OBJ_TYPE_REF.
        * tree-ssa-operands.c (get_expr_operands): Handle OBJ_TYPE_REF.
        * tree.h (OBJ_TYPE_REF_EXPR): New.
        (OBJ_TYPE_REF_OBJECT, OBJ_TYPE_REF_TOKEN): New.
        * doc/c-tree.texi (VTABLE_REF): Remove.
        * objc/objc-act.c (build_objc_method_call): Build an OBJ_TYPE_REF.
cp/
        * class.c (build_vfn_ref): Take a pointer not object.  Build
        an OBJ_TYPE_REF.
        (cp_fold_obj_type_ref): New.
        * call.c (build_over_call): Update build_vfn_ref call.
        * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): New.
        * cp-tree.h (cp_fold_obj_type_ref): Declare.
testsuite/
        * g++.dg/opt/devirt1.C: New.

From-SVN: r83531
2004-06-22 17:26:04 -07:00
Richard Henderson 325c369115 c-common.c (lang_gimplify_stmt): Remove next_p argument.
* c-common.c (lang_gimplify_stmt): Remove next_p argument.
	(if_elt, if_stack, if_stack_space, c_expand_start_cond, c_finish_then,
	c_expand_end_cond, c_expand_start_else, c_finish_else, c_begin_if_stmt,
	c_begin_while_stmt, c_finish_while_stmt_cond): Move to c-typeck.c.
	(finish_fname_decls, fname_decl): Use statement_lists.
	(c_expand_expr_stmt): Don't set last_expr_type.
	(c_type_hash): Fix indentation.
	(c_safe_from_p): Don't follow TREE_CHAIN.
	(c_tree_chain_matters_p): Remove.
	* c-common.def (SCOPE_STMT): Remove.
	(CLEANUP_STMT): Redefine to contain its own body.
	* c-common.h (struct stmt_tree_s): Remove x_last_stmt,
	x_last_expr_type, x_last_expr_filename, x_scope_stmt_stack.
	Add x_cur_stmt_list.
	(last_tree, last_expr_type, last_expr_filename, RECHAIN_STMTS): Remove.
	(cur_stmt_list): New.
	(STATEMENT_LIST_STMT_EXPR): New.
	(SCOPE_BEGIN_P, SCOPE_END_P, SCOPE_STMT_BLOCK, SCOPE_NULLIFIED_P,
	SCOPE_NO_CLEANUPS_P, SCOPE_PARTIAL_P, NEW_FOR_SCOPE_P): Remove.
	(CLEANUP_BODY): New.
	(CLEANUP_DECL): Move to operand 2.
	(c_common_stmt_codes): Remove SCOPE_STMT.
	(COMPOUND_STMT_NO_SCOPE, COMPOUND_STMT_BODY_BLOCK): Remove.
	* c-decl.c (c_scope_stmt_stack, current_scope_stmt_stack): Remove.
	(c_push_function_context, c_pop_function_context): Don't save it.
	(finish_decl): Set TREE_USED on the decl for a cleanup.
	Use push_cleanup.
	(store_parm_decls): Use statement lists.
	(finish_function): Remove compstmt rule workaround.  Use statement
	lists.  Call finish_fname_decls after finalizing the body.
	(c_begin_compound_stmt): Move to c-typeck.c.
	* c-dump.c (c_dump_tree): Remove SCOPE_STMT.
	* c-gimplify.c (gimplify_cleanup_stmt, gimplify_cleanup_stmts): New.
	(c_genericize): Invoke them.
	(c_gimplify_stmt): Don't look through TREE_CHAIN.  Kill SCOPE_STMT.
	(c_build_bind_expr): Export.
	(gimplify_block, gimplify_cleanup): Remove.
	(gimplify_condition): Use gimplify_stmt.
	(gimplify_for_stmt): Remove FOR_INIT_STMT chaining hack.
	(gimplify_if_stmt): Remove recursion hack.
	(c_gimplify_expr): Remove STMT_EXPR handling.
	(stmt_expr_last_stmt, gimplify_stmt_expr): Remove.
	(is_last_stmt_of_scope): Remove.
	* c-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove.
	* c-mudflap.c (mflang_flush_calls): Use c_begin_compound_stmt,
	c_end_compound_stmt.
	* c-objc-common.c (build_cdtor): Likewise.
	* c-parse.in (primary): Use c_finish_stmt_expr.
	(push_scope, pop_scope): Remove.
	(c99_block_start, compstmt_start): Use c_begin_compound_stmt.
	(c99_block_end, compstmt): Use c_end_compound_stmt.
	(c99_block_lineno_labeled_stmt): Likewise.
	(compstmt_primary_start): Use c_begin_stmt_expr.
	(simple_if, select_or_iter_stmt): Update calls to stmt builders.
	(do_stmt_start): Fill in body directly.
	(lineno_stmt): Avoid setting lineno on constants.
	* c-pretty-print.c (pp_c_statement): Handle STATEMENT_LIST.
	Remove SCOPE_STMT.
	* c-semantics.c (begin_stmt_tree): Remove.
	(push_stmt_list, re_push_stmt_list, pop_stmt_list): New.
	(add_stmt): Use statement lists.
	(add_scope_stmt, finish_stmt_tree): Remove.
	(push_cleanup): New.
	* c-tree.h: Move some decls from c-common.h.
	* c-typeck.c (c_tree_expr_nonnegative_p): Simplify for statement lists.
	(do_case, c_finish_case): Likewise.
	(c_finish_then): Take body for then as argument.
	(c_finish_else): Similarly.
	(c_begin_for_stmt, c_finish_for_stmt_init, c_finish_for_stmt_cond,
	c_finish_for_stmt_incr, c_finish_for_stmt): New.
	(c_begin_stmt_expr, c_finish_stmt_expr): New.
	(c_begin_compound_stmt): Do scope management.
	(c_end_compound_stmt): New.
	* fold-const.c (tree_expr_nonnegative_p): Fix BIND_EXPR.
	* gimplify.c (voidify_wrapper_expr): Accept temporary argument.
	Look through exception handling constructs.
	(gimplify_bind_expr): Accept temporary argument.
	(gimplify_target_expr): Special case BIND_EXPR bodies.
	(gimplify_expr): Handle fallback == fb_none like a statement.
	* langhooks-def.h (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Kill.
	* langhooks.c (lhd_tree_inlining_tree_chain_matters_p): Remove.
	* langhooks.h (tree_chain_matters_p): Remove.
	* stub-objc.c (objc_clear_super_receiver): New.
	* tree-gimple.h (voidify_wrapper_expr): Update decl.
	(append_to_statement_list, append_to_statement_list_force): Move
	to tree-iterator.h.
	* tree-inline.c (expand_call_inline): Update call.
	(clone_body): Use statement lists.
	(walk_tree): Don't check tree_chain_matters_p.
	(copy_tree_r): Likewise.
	* tree-iterator.c (alloc_stmt_list): Clear lang bits.
	(tsi_link_before, tsi_link_after): Set TREE_SIDE_EFFECTS properly.
	* tree-iterator.h (append_to_statement_list,
	append_to_statement_list_force): Moved from tree-gimple.h.
	* tree-pretty-print.c (dump_generic_node): Clean up TARGET_EXPR dump.
	* objc/objc-act.c (build_module_descriptor): Use c_begin_compound_stmt.
	(objc_enter_block): Likewise.
	(objc_exit_block): Use c_end_compound_stmt.
	(objc_build_try_enter_fragment): Add #error and comment for
	rewriting for OBJCPLUS.
	(objc_build_extract_fragment, objc_build_try_epilogue,
	objc_build_catch_stmt, objc_build_finally_prologue,
	objc_build_finally_epilogue): Update for C statement builders.
	* objc/objc-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P):
	Remove.
cp/
	* call.c (initialize_reference): Don't build CLEANUP_STMT here.
	* cp-gimplify.c (cp_gimplify_stmt): Remove next_p argument.
	(genericize_try_block): Use gimplify_stmt.
	(genericize_catch_block, genericize_eh_spec_block): Likewise.
	(cp_gimplify_init_expr): Remove STMT_EXPR special case.
	(gimplify_must_not_throw_expr): Update voidify_wrapper_expr call.
	* cp-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove.
	(cp_tree_chain_matters_p): Remove.
	* cp-tree.h (COMPOUND_STMT_TRY_BLOCK): New.
	(COMPOUND_STMT_BODY_BLOCK): New.
	(STATEMENT_LIST_NO_SCOPE, STATEMENT_LIST_TRY_BLOCK): New.
	(EXPR_STMT_STMT_EXPR_RESULT): New.
	(building_stmt_tree): Check cur_stmt_list.
	(tf_stmt_expr_cmpd, tf_stmt_expr_body): Remove.
	(BCS_NO_SCOPE, BCS_TRY_BLOCK, BCS_FN_BODY): New.
	* decl.c (poplevel): Use pop_stmt_list for minding cleanups.
	(cp_finish_decl): Use push_cleanup.
	(start_function, finish_function): Use statement lists.
	(finish_stmt): Do nothing.
	* except.c (begin_eh_spec_block): Use statement lists.
	(check_handlers_1, check_handlers): Likewise.
	* init.c (construct_virtual_base): Don't add extra compound stmts.
	(build_vec_init): Likewise.
	* name-lookup.c (maybe_push_cleanup_level): Use statement lists.
	* name-lookup.h (struct cp_binding_level): Add statement_list.
	* parser.c (cp_parser_statement): Take the STMT_EXPR node, not a bool.
	(cp_parser_labeled_statement, cp_parser_expression_statement,
	cp_parser_statement_seq_opt): Likewise.
	(cp_parser_compound_statement): Likewise.  Take bool for try block.
	(cp_parser_selection_statement): Tidy if processing.
	(cp_parser_already_scoped_statement): Rewrite to do what it says.
	* pt.c (tsubst_copy): Move STMT_EXPR to tsubst_expr.
	(tsubst_expr): Rewrite STMT_EXPR processing.  Handle STATEMENT_LIST.
	Mind COMPOUND_STMT_TRY_BLOCK, EXPR_STMT_STMT_EXPR_RESULT.
	* semantics.c (do_poplevel, do_pushlevel): Use statement lists.
	(finish_cond): New, rewritten from FINISH_COND.
	(simplify_loop_decl_cond): New.
	(finish_expr_stmt): Avoid nested EXPR_STMTs.
	(begin_if_stmt, finish_if_stmt_cond, finish_then_clause,
	begin_else_clause, finish_else_clause, finish_if_stmt,
	begin_while_stmt, finish_while_stmt_cond, finish_while_stmt,
	begin_do_stmt, finish_do_body, begin_for_stmt, finish_for_init_stmt,
	finish_for_cond, finish_for_stmt, begin_switch_stmt,
	finish_switch_cond, finish_switch_stmt, begin_try_block,
	finish_try_block, finish_cleanup_try_block, finish_function_try_block,
	finish_handler_sequence, finish_function_handler_sequence,
	begin_handler, finish_handler_parms, finish_handler,
	begin_stmt_expr, finish_stmt_expr_expr, finish_stmt_expr): Rewrite
	using statement lists.
	(begin_compound_stmt): Replace has_no_scope argument with flags.
	Update all callers.  Use statement lists.
	(finish_compound_stmt): Likewise.
	(finish_decl_cleanup, finish_eh_cleanup): Use push_cleanup.
	(current_scope_stmt_stack): Remove.
	(simplify_aggr_init_expr): Don't muck with TREE_CHAIN.
	* typeck2.c (split_nonconstant_init_1, split_nonconstant_init):
	Rewrite with statement lists.
testsuite/
	* g++.dg/ext/stmtexpr1.C: XFAIL.
	* gcc.dg/20030612-1.c: XFAIL.

From-SVN: r83221
2004-06-15 18:21:38 -07:00
Diego Novillo 6de9cd9a88 Merge tree-ssa-20020619-branch into mainline.
From-SVN: r81764
2004-05-13 02:41:07 -04:00
Jan Hubicka 18c6ada9b2 cgraph.c: Add overall comment.
* cgraph.c: Add overall comment.
	(cgraph_inline_hash): New global variable.
	(cgraph_create_node): Break out from ...
	(cgraph_node): ... here.
	(cgraph_edge): New function.
	(cgraph_create_edge): New CALL_EXPR argument; some sanity checking.
	(cgraph_remove_edge): Accept edge, intead of source and destination.
	(cgraph_redirect_edge_callee): New.
	(cgraph_remove_node): Update all new datastructures.
	(cgraph_record_call, cgraph_remove_call): Kill.
	(dump_cgraph_node): Break out from ... ; dump new datastructures.
	(dump_cgraph): ... here.
	(cgraph_function_possibly_inlined_p): Use new hashtable.
	(cgraph_clone_edge, cgraph_clone_node): New.
	* cgraph.h: Include hashtab.h
	(struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output
	fields, add inlined_to pointer.
	(cgraph_node): Add pointer to next_clone.
	(cgraph_remove_edge, cgraph_create_edge): Update prototype.
	(cgraph_remove_call, cgraph_record_call): Kill.
	(cgraph_inline_hash): Declare.
	(dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node,
	cgraph_redirect_edge_callee): Declare.
	(cgraph_create_edges, cgraph_inline_p): Update prorotype.
	(cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node,
	cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare.
	* cgraphunit.c: Add overall comment.
	(cgraph_optimize_function): Kill.
	(cgraph_assemble_pending_functions): Do not assemble inline clones.
	(cgraph_finalize_function): Update call of cgraph_remove_node
	(record_call_1): Record call sites.
	(cgraph_create_edges): Accept node instead of decl argument.
	(error_found): New static variable.
	(verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions.
	(cgraph_analyze_function): Update for new datastructures.
	(cgraph_finalize_compilation_unit): Plug memory leak.
	(cgraph_optimize_function): Kill.
	(cgraph_expand_function): Do not use cgraph_optimize_function.
	(INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into,
	cgraph_inlined_callees): Kill.
	(cgraph_remove_unreachable_nodes): Verify cgraph; update handling of
	clones.
	(estimate_growth): Simplify.
	(cgraph_clone_inlined_nodes): New function.
	(cgraph_mark_inline_edge): Re-implement.
	(cgraph_mark_inline): Likewise.
	(cgraph_check_inline_limits): Simplify.
	(cgraph_recursive_inlining_p): New.
	(update_callee_keys): Break out from ...
	(cgraph_decide_inlining_of_small_functions): ... here; simplify.
	(cgraph_decide_inlining, cgraph_decide_inlining_incrementally):
	Likewise.
	(cgraph_expand_all_functions):  Remove inline clones from the ordered
	list.
	(cgraph_preserve_function_body_p): New predicate.
	(cgraph_optimize): Verify cgraph.
	* function.h (struct function): Add fields saved_tree/saved_args.
	* timevar.def (TV_CGRAPH_VERIFY): Use verifier.
	* toplev.c (rest_of_compilation): Do not free cfun.
	* tree-inline.c: Include function.h
	(struct inline_data): Add saving_p field; replace decl/current_decl by
	node/current_node.
	(insert_decl_map): New function.
	(copy_body_r): Handle saving; update cgraph datastructure.
	(copy_body): Handle recursive inlining.
	(initialize_inlined_parameters): Likewise.
	(expand_call_inline): Propagate node attributes; update cgraph.
	(optimize_inline_calls): Verify that datastructure still match.
	(save_body): New function.
	* tree-inline.h (save_body): New.
	* tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining.
	* langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New.
	* langhooks.c (lang_hooks): Add update_decl_after_saving.

	* cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define.
	* cp-tree.h (cp_update_decl_after_saving): Declare.
	* tree.c (cp_update_decl_after_saving): Define.

	* Make-lang.in (com.o): Add dependnecy on function.h
	* com.c: Include function.h
	(finish_function): Clear DECL_STRUCT_FUNCTION.

	* utils.c: Include function.h
	(end_subprog_body): Clear DECL_STRUCT_FUNCTION.

From-SVN: r80334
2004-04-01 23:28:15 +00:00
Richard Kenner 7548281d73 langhooks-def.h (LANG_HOOKS_HASH_TYPES): New macro and hook.
* langhooks-def.h (LANG_HOOKS_HASH_TYPES): New macro and hook.
	* langhooks.h (struct lang_hooks_for_types): New field hash_types.
	* tree.c (debug_no_type_hash): Deleted.
	(type_hash_canon): Abort if passed a variant.
	Check lang_hooks.types.hash_types.
	(build_type_no_quals): Copy mode of POINTER_TYPE and REFERENCE_TYPE.
	(build_array_type): Remove unnecessary allocation of pointer type.
	(build_complex_type): Properly qualify resulting type.

	* ada/decl.c (debug_no_type_hash): Remove.
	(gnat_to_gnu_entity, case E_Array_Type): Don't set and clear it.
	* ada/misc.c (LANG_HOOK_HASH_TYPE): Redefine.

From-SVN: r79684
2004-03-19 09:34:47 -05:00
Zack Weinberg 21d13d8372 debug.h (struct gcc_debug_hooks): Add type_decl field.
* debug.h (struct gcc_debug_hooks): Add type_decl field.
	(debug_nothing_tree_int): Prototype.
	(dwarf_debug_hooks): Delete, unused.
	* debug.c (do_nothing_debug_hooks): Update.
	(debug_nothing_tree_int): New function.
	* langhooks.h (struct lang_hooks_for_decls):
	Remove builtin_type_decls field.
	* langhooks-def.h (LANG_HOOKS_BUILTIN_TYPE_DECLS): Delete.
	(LANG_HOOKS_DECLS): Update.
	* toplev.c (rest_of_decl_compilation, rest_of_type_compilation):
	Use debug_hooks->type_decl.
	* dbxout.c (preinit_symbols): New static.
	(dbx_debug_hooks, xcoff_debug_hooks): Update.
	(dbxout_init): Don't call DBX_OUTPUT_STANDARD_TYPES or
	lang_hooks.decls.builtin_type_decls.  Do scan preinit_symbols
	for symbols to output.
	(dbxout_type_decl): New function.
	(dbxout_symbol): If called before dbxout_init has run, queue
	the symbol for later.  Apply DBX_ASSIGN_FUNDAMENTAL_TYPE_NUMBER
	to TYPE_DECLs before emitting them.
	* xcoffout.c (assign_type_number): Delete.
	(xcoff_type_numbers): New static table.
	(xcoff_assign_fundamental_type_number): New function.
	* xcoffout.h: Define DBX_ASSIGN_FUNDAMENTAL_TYPE_NUMBER, not
	DBX_OUTPUT_STANDARD_TYPES.  Remove unnecessary #ifdefs.
	* sdbout.c: Include varray.h.
	(deferred_global_decls): New static.
	(sdb_debug_hooks): Update.
	(sdbout_global_decl): If we can't emit something right now,
	remember it in deferred_global_decls.
	(sdbout_finish): Just scan deferred_global_decls; don't call getdecls.
	(sdbout_init): Initialize deferred_global_decls.
	* Makefile.in: Update dependencies of sdbout.o.
	* dwarf2out.c (dwarf2out_type_decl): New function.
	(dwarf2_debug_hooks): Update.
	* vmsdbgout.c (vmsdbg_debug_hooks): Update.
	* c-decl.c (getdecls): Just return 0.
	(check_for_loop_decls): Don't use getdecls.
	(record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL.
	* c-objc-common.c (c_objc_common_finish_file): Don't use getdecls.
cp:
	* cp-lang.c: Don't define LANG_HOOKS_BUILTIN_TYPE_DECLS.
	* cp-tree.h: Don't declare cxx_builtin_type_decls.
	* decl.c (builtin_type_decls, cxx_builtin_type_decls): Delete.
	(record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL.

From-SVN: r77730
2004-02-12 21:42:28 +00:00
Kazu Hirata d9221e016b alias.c, [...]: Update copyright.
* alias.c, basic-block.h, c-common.c, c-common.h,
	c-cppbuiltin.c, c-opts.c, c-pragma.c, c-pretty-print.c,
	calls.c, cfg.c, cfgcleanup.c, cfgrtl.c, cgraph.h, collect2.c,
	combine.c, cppcharset.c, cpphash.h, cppinit.c, cpplib.c,
	cpplib.h, cppmacro.c, crtstuff.c, cselib.c, cselib.h,
	defaults.h, df.c, dominance.c, et-forest.c, expmed.c, expr.c,
	expr.h, fix-header.c, function.h, gcc.c, gcse.c, genattrtab.c,
	genautomata.c, genconditions.c, genemit.c, genflags.c,
	gengtype.c, gengtype.h, genopinit.c, genrecog.c, gensupport.c,
	ggc-zone.c, graph.c, haifa-sched.c, input.h, integrate.c,
	langhooks-def.h, langhooks.c, langhooks.h, line-map.c,
	line-map.h, local-alloc.c, optabs.c, optabs.h, postreload.c,
	ra.h, recog.c, reg-stack.c, regmove.c, reload.c, reorg.c,
	rtl.c, sched-deps.c, sched-ebb.c, sdbout.c, system.h,
	target.h, targhooks.c, toplev.h, tree-inline.c, unwind-pe.h,
	unwind.h, varray.c, varray.h: Update copyright.

From-SVN: r76302
2004-01-21 20:40:04 +00:00
Mark Mitchell 0fab64a344 expr.h (expand_expr): Make it a macro, not a function.
* expr.h (expand_expr): Make it a macro, not a function.
	(expand_expr_real): New function.
	* expr.c (store_expr): Adjust logic for deciding whether or not to
	copy the value returned by expand_expr.
	(expand_expr): Rename to ...
	(expand_expr_real): ... this.  Add alt_rtl parameter.  Adjust
	calls to language hooks.
	* c-common.h (c_expand_expr): Adjust prototype.
	* c-common.c (c_expand_expr): Add alt_rtl parameter.
	* langhooks-def.h (lhd_expand_expr): Change prototype.
	* langhooks.c (lhd_expand_expr): Add all_rtl parameter.
	* langhooks.h (lang_hooks): Change type of expand_expr.
	* stmt.c (stmt_status): Add x_last_expr_alt_rtl.
	(last_expr_alt_rtl): Likewise.
	(expand_expr_stmt_value): Set last_expr_alt_rtl.
	(clear_last_expr): Clear it.
	(expand_end_stmt_expr): Set RTL_EXPR_ATL_RTL.
	(expand_end_bindings): Save and restor last_expr_alt_rtl.
	* tree.def (RTL_EXPR): Give it an additional operand.
	* tree.h (RTL_EXPR_ALT_RTL): New macro.

	* misc.c (gnat_expand_expr): Add alt_rtl parameter.

	* cp-tree.h (cxx_expand_expr): Change prototype.
	* expr.c (cxx_expand_expr): Add alt_rtl parameter.

	* java-tree.h (java_expand_expr): Change prototype.
	* expr.c (java_expand_expr): Add alt_rtl parameter.

From-SVN: r75594
2004-01-09 19:55:13 +00:00
Mike Stump d5123baefb c-typeck.c (c_convert_parm_for_inlining): Add argnum...
* c-typeck.c (c_convert_parm_for_inlining): Add argnum, which
	is the argumnt we are processing so that warnings and errors
	will have that information.
	* c-tree.h (c_convert_parm_for_inlining): Add argnum.
	* lang-hooks-def.h
	(lhd_tree_inlining_convert_parm_for_inlining): Likewse.
	* langhooks.c (lhd_tree_inlining_convert_parm_for_inlining): Likewise.
	* langhooks.h (convert_parm_for_inlining): Likewise.
	* tree-inline.c (initialize_inlined_parameters): Compute and
	pass argnum down.

From-SVN: r73507
2003-11-12 19:53:17 +00:00
Andrew Haley 83d865c57c tree.c (get_callee_fndecl): Call lang_hooks.lang_get_callee_fndecl.
2003-10-06  Andrew Haley  <aph@redhat.com>

	* tree.c (get_callee_fndecl): Call
	lang_hooks.lang_get_callee_fndecl.
	* langhooks-def.h (LANG_HOOKS_GET_CALLEE_FNDECL): New.
	(lhd_get_callee_fndecl): New.

From-SVN: r72150
2003-10-06 13:50:41 +00:00
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
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
Richard Henderson 4985cde3ef tree-optimize.c: New file.
gcc/
        * tree-optimize.c: New file.
        * Makefile.in (OBJS-archive): Add tree-optimize.o.
        (tree-optimize.o): New.
        * c-decl.c (store_parm_decls): Use allocate_struct_function.
        (finish_function): Don't free_after_parsing or free_after_compilation.
        (set_save_expr_context): Move to tree-optimize.c.
        (c_expand_body_1): Use tree_rest_of_compilation.
        * c-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): New.
        * objc/objc-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): New.
        * c-objc-common.c (expand_deferred_fns): Don't emit unused inlines;
        iterate until closure.
        * langhooks-def.h (LANG_HOOKS_RTL_EXPAND_START,
        LANG_HOOKS_RTL_EXPAND_STMT, LANG_HOOKS_RTL_EXPAND_END): New.
        (LANG_HOOKS_RTL_EXPAND_INITIALIZER): New.
        * langhooks.h (struct lang_hooks_for_rtl_expansion): New.
        * toplev.h (tree_rest_of_compilation): Declare it.

gcc/cp/
        * cp-lang.c (LANG_HOOKS_RTL_EXPAND_START): New.
        (LANG_HOOKS_RTL_EXPAND_STMT): New.
        * cp-tree.h (cxx_expand_function_start): Declare.
        * decl.c (start_function): Use allocate_struct_function.
        Move stmts_are_full_exprs_p assertion from expand_body.
        Do not free_after_parsing or free_after_compilation.
        (cxx_push_function_context): Move code to set struct function
        data from genrtl_start_function.
        * optimize.c (optimize_function): Don't inc/dec function_depth.
        * semantics.c (expand_body): Use tree_rest_of_compilation.
        (cxx_expand_function_start): Rename from genrtl_start_function,
        omit bits done by tree_rest_of_compilation.
        (genrtl_finish_function): Remove.
        (clear_decl_rtl): Move to ../tree-optimize.c.

Co-Authored-By: Jason Merrill <jason@redhat.com>

From-SVN: r70933
2003-08-29 16:21:13 -07:00
Kazu Hirata 2b72593e40 builtin-attrs.def: Fix comment formatting.
* builtin-attrs.def: Fix comment formatting.
	* c-pretty-print.c: Likewise.
	* diagnostic.h: Likewise.
	* langhooks.h: Likewise.
	* recog.c: Likewise.
	* simplify-rtx.c: Likewise.
	* tree.def: Likewise.

From-SVN: r70676
2003-08-22 06:25:09 +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
Roger Sayle 03aa99d49f c-common.c (flag_noniso_default_format_attributes): Delete.
* c-common.c (flag_noniso_default_format_attributes): Delete.
	(built_in_attribute): Don't define/undefine DEF_FN_ATTR.
	(c_attrs_initialized): Delete.
	(c_common_nodes_and_builtins): Don't test c_attrs_initialized,
	always call c_init_attributes.
	(c_init_attributes): Don't define/undefine DEF_FN_ATTR.  Don't
	set c_attrs_initialized when done.
	(c_common_insert_default_attributes): Delete.
	* c-common.h (flag_noniso_default_format_attributes): Delete.
	(c_coomon_insert_default_attributes): Delete prototype.
	* c-opts.c (set_std_c89, set_std_c99, set_std_cxx98): Dont set
	flag_noniso_default_format_attributes.

	* c-decl.c (c_insert_default_attributes): Delete.
	* c-tree.h (c_insert_default_attributes): Delete prototype.

	* attribs.c (decl_attributes): Don't call insert_default_attributes
	langhook.  Update function description comment.
	* langhooks.h (lang_hooks): Remove insert_default_attributes field.
	* langhooks-def.h (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Delete.
	* c-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define.
	* system.h: Poison LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES macro.

cp/
	* decl.c (cxx_insert_default_attributes): Delete.
	* cp-tree.h (cxx_insert_default_attributes): Don't prototype.
	* cp-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define.

objc/
	* objc-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define.

From-SVN: r70155
2003-08-04 20:44:20 +00: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
Per Bothner 40e941afc1 opts.c (in_fnames, [...]): Moved here from c-opts.
* opts.c (in_fnames, num_in_fnames):  Moved here from c-opts.
	(add_input_filename):  New function.
	(handle_options):  Call add_input_filename directly instead of
	with a lang hook.
	* opts.h (in_fnames, num_in_fnames):  Moved here.
	(add_input_filename):  Declare.
	* c-decl.c:  Need to #include opts.h.
	* Makefile.in (c-decl.o):  Also depends on opts.h.
	* c-opts.c (in_fnames, num_in_fnames):  Moved to opts.c.
	(c_common_handle_filename):  Replaced by add_input_filename.
	* c-common.h (in_fnames, num_in_fnames, c_common_handle_filename):
	Remove.
	* langhooks.h (struct lang_hooks):  Remove handle_filename hook.
	* langhooks-def.h (LANG_HOOKS_HANDLE_FILENAME):  Remove macro.
	(LANG_HOOKS_INITIALIZER):  Remove use of LANG_HOOKS_HANDLE_FILENAME.
	* c-lang.c (LANG_HOOKS_HANDLE_FILENAME):  Remove macro.

From-SVN: r70012
2003-07-31 12:26:17 -07:00
Steven Bosscher bcda12f4f4 ggc.h, [...]: Use `rtx' instead of `struct rtx_def *'...
2003-07-10  Steven Bosscher  <steven@gcc.gnu.org>

	* ggc.h, integrate.h, langhooks.h, real.h, toplev.h:
	Use `rtx' instead of `struct rtx_def *', `rtvec' instead of
	`struct rtvec_dev *' and `tree' instead of `union tree_node *'
	in function prototypes.
	* varray.h (const_equiv_data): Likewise for fields.
	(varray_data_tag): Likewise.
	* output.h: Likewise, and don't forward declare union tree_node.
	* emit_rtl.c (const_int_htab_hash): Cast to `rtx' instead of
	`struct rtxvec *'.
	* print-tree.c (print_node): Likewise.
	* reload1.c: Don't redeclare current_function_decl, tree.h is
	included in this file.

From-SVN: r69183
2003-07-10 11:38:18 +00:00
Jan Hubicka 084c177908 java-tree.h (DECL_NUM_STMTS): Rename to...
* java-tree.h (DECL_NUM_STMTS): Rename to...
	(DECL_ESTIMATED_INSNS): ... this.
	* lang.c (java_estimate_num_insns, java_estimate_num_insns_1):
	New static functions.
	(LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Define.
	* parser.y (add_stmt_to_compound): Do not account statements.

	* cp-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): New.
	* decl.c (duplicate_decls): Use DECL_ESTIMATED_INSNS.
	(start_function): Use DECL_ESTIMATED_INSNS.
	* optimize.c (maybe_clone_body): Use DECL_ESTIMATED_INSNS.

	* decl2.c (maybe_emit_vtables): Fix marking vtables as needed in
	unit-at-a-time

	* c-common.c (c_estimate_num_insns_1): New static function.
	(c_estimate_num_insns): New global function.
	* c-common.h (DECL_NUM_STMTS): Rename to...
	(DECL_ESTIMATED_INSNS): ... this.
	(c_estimate_num_insns): Declare.
	* c-decl.c (duplicate_decls): Use DECL_ESTIMATED_INSNS.
	* c-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): New.
	* c-semantics.c (add_stmt): Do not account statements.
	* langhooks-def.h (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS):
	New.
	* langhooks.h (lang_hooks_for_tree_inlining): Add
	estimate_num_insns
	* params.def (max-inline-insns-auto, max-inline-insns-auto): set
	to 100.
	(max-inline-insns): set to 300.
	(min-inline-insns): set to 10.
	* tree-inline.c (struct inline_data): Rename inlined_stmts to
	inlined-insns.
	(INSNS_PER_STMT): Kill.
	(inlinable_function_p): Compute and store body size.
	(expand_call_inline): Likewise.
	(optimize_inline_calls): Likewise.

From-SVN: r69113
2003-07-09 00:31:20 +00:00
Neil Booth cb66e38590 c-common.h (c_comon_handle_filename, [...]): New.
* c-common.h (c_comon_handle_filename,
	c_common_missing_arguement): New.
	* c-lang.c (LANG_HOOKS_HANDLE_FILENAME,
	LANG_HOOKS_MISSING_ARGUMENT): New.
	* c-opts.c (missing_arg): Rename c_common_missing_argument,
	update to be an appropriate langhook.
	(c_common_handle_option): Don't handle filenames.
	(c_common_handle_filename): New.
	* hooks.c (hook_void_constcharptr,
	hook_bool_constcharptr_size_t_false): New.
	* hooks.h (hook_void_constcharptr,
	hook_bool_constcharptr_size_t_false): New.
	* langhooks-def.h (LANG_HOOKS_HANDLE_FILENAME,
	LANG_HOOKS_MISSING_ARGUMENT): New.
	(LANG_HOOKS_INITIALIZER): Update.
	* langhooks.h (struct lang_hooks): Add handle_filename and
	missing_argument.
	* opts.c (handle_option): Don't handle filenames here, but ...
	(handle_options): ... here.
	(common_handle_option): Don't handle missing arguments here.
	* objc/objc-lang.c (LANG_HOOKS_HANDLE_FILENAME,
	LANG_HOOKS_MISSING_ARGUMENT): New.
ada:
	* misc.c (gnat_handle_option): Don't handle filenames.
cp:
	* cp-lang.c (LANG_HOOKS_HANDLE_FILENAME,
	LANG_HOOKS_MISSING_ARGUMENT): Override.
f:
	* top.c (ffe_handle_option): Don't handle filenames.
java:
	* lang.c (java_handle_option): Don't handle filenames.

From-SVN: r69011
2003-07-06 19:01:21 +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
Kazu Hirata 4d6922ee32 bt-load.c: Fix comment typos.
* bt-load.c: Fix comment typos.
	* c-incpath.c: Likewise.
	* cfg.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfgloop.h: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* diagnostic.h: Likewise.
	* dwarfout.c: Likewise.
	* emit-rtl.c: Likewise.
	* et-forest.c: Likewise.
	* et-forest.h: Likewise.
	* expr.c: Likewise.
	* gcse.c: Likewise.
	* genattr.c: Likewise.
	* jump.c: Likewise.
	* langhooks.h: Likewise.
	* local-alloc.c: Likewise.
	* loop-unroll.c: Likewise.
	* loop-unswitch.c: Likewise.
	* ra-build.c: Likewise.
	* regclass.c: Likewise.
	* regmove.c: Likewise.
	* rtl.def: Likewise.
	* rtlanal.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-rgn.c: Likewise.
	* simplify-rtx.c: Likewise.
	* ssa.c: Likewise.
	* tracer.c: Likewise.
	* tree.c: Likewise.

From-SVN: r68975
2003-07-05 15:17:36 +00:00
Neil Booth b86f6cd9ab c-common.h (c_common_init_options): New prototype.
* c-common.h (c_common_init_options): New prototype.
	* c-opts.c (deferred_size): Remove.
	(defer_opt): Array is now pre-allocated.
	(c_common_init_options): Pre-allocate deferred_opts.  Make
	lang_flags unsigned.
	(push_command_line_options): Free deferred_opts.
	* hooks.c (hook_uint_uint_constcharptrptr_0): New.
	* hooks.h (hook_uint_uint_constcharptrptr_0): New.
	* langhooks-def.h (LANG_HOOKS_INIT_OPTIONS): Update.
	* langhooks.h (struct lang_hooks): New prototype for init_options.
	* main.c (main): Cast argv.
	* opts.c (handle_option, handle_options): Update prototypes.
	(decode_options): save_argc, save_argv are not global.  Constify.
	* opts.h (decode_options): New prototype.
	* toplev.c (general_init): New protoype.
	(save_argv): Make static.
	(save_argc): Remove.
	(print_switch_values, general_init): Constify.
	(toplev_main): Save argv.
	* toplev.h (toplev_main): Update prototype.
	(save_argc, save_argv): Remove.
ada:
	* misc.c (save_argc, save_argv): Make static.
	(gnat_init_options): New prototype.
	(gnat_init_options): Update.
f:
	* top.c (ffe_init_options): Update prototype.
	* top.h (ffe_init_options): Update prototype.
java:
	* lang.c (java_init_options): Update prototype.
treelang:
	* tree1.c (treelang_init_options): Update prototype.
	* treelang.h (treelang_init_options): Update prototype.

From-SVN: r68850
2003-07-02 20:15:46 +00:00
Zack Weinberg 2896d05649 re PR c/10178 (ICE in tree_low_cst)
PR 10178
	* langhooks.h (struct lang_hooks): Add no_body_blocks bool.
	* langhooks-def.h (LANG_HOOKS_NO_BODY_BLOCKS): New; default false.
	* c-lang.c, objc/objc-lang.c: Override LANG_HOOKS_NO_BODY_BLOCKS
	to true.
	* stmt.c (is_body_block): If lang_hooks.no_body_blocks, always
	return 0.

From-SVN: r68483
2003-06-25 17:29:14 +00:00
Jan Hubicka d35543c0dd langhooks-def.h (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): New macro.
* langhooks-def.h (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): New macro.
	* langhooks.h (lang_hooks_for_decls): Add prepare_assemble_variable.
	* varasm.c (assemble_variable): Call prepare_assemble_variable.
	* class.c (build_vtable): Make vtables.
	* cp-tree.h (DECL_VTABLE_OR_VTT_P): New macro.
	* decl2.c (output_vtable_inherit): Rename to ...
	(prepare_assemble_variable): ... this one; change interface.
	(maybe_emit_vtables): Do not call output_vtable_inherit.
	* cp-lang.c (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): Define.
	* cp-tree.h (prepare_assemble_variable): New.

From-SVN: r68418
2003-06-24 11:54:01 +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
Neil Booth 2772ef3ef3 Makefile.in (OJBS, c-opts.o): Update.
* Makefile.in (OJBS, c-opts.o): Update.
	(c-options.c, c-options.h): Rename options.h and options.c.
	(options.h): Rename options_.h.
	(opts.o): New.
	* c-common.h (c_common_handle_option): Replace c_common_decode_option.
	(c_common_init_options): Update prototype.
	* c-lang.c (c_init_options): Update prototype.
	(LANG_HOOKS_HANDLE_OPTION): Override.
	(LANG_HOOKS_DECODE_OPTION): Drop.
	* c-opts.c: Include opts.h and options.h instead of c-options.h
	and c-options.c.
	(lang_flags): Move to file scope.
	(find_opt, c_common_decode_option): Remove.
	(CL_C, CL_OBJC, CL_CXX, CL_OBJCXX, CL_JOINED, CL_SEPARATE,
	CL_REJECT_NEGATIVE): Move to opts.h.
	(missing_arg): Update prototype.
	(c_common_init_options): Update for new prototype.
	(c_common_handle_options): Filenames are passed as N_OPTS.
	* hooks.c (hook_int_void_0): New.
	* hooks.h (hook_int_void_0): New.
	* langhooks-def.h (LANG_HOOKS_INIT_OPTIONS): New default.
	(LANG_HOOKS_HANDLE_OPTION): Default to NULL for now.
	(LANG_HOOKS_INITIALIZER): Update.
	* langhooks.h (init_options): Update.
	(handle_option): New.
	* opts.c, opts.h: New files.
	* opts.sh: Update c file to include opts.h and options.h.
	* toplev.c: Include opts.h; change options.h to options_.h.
	(parse_options_and_default_flags): Get lang_mask, use
	handle_option for language-specific handling.
	* objc/objc-lang.c (LANG_HOOKS_DECODE_OPTON): Drop.
	(LANG_HOOKS_HANDLE_OPTION): Override.
	(objc_init_options): Update.
ada:
	* misc.c (gnat_init_options): Update.
cp:
	* cp-lang.c (LANG_HOOKS_DECODE_OPTON): Drop.
	(LANG_HOOKS_HANDLE_OPTION): Override.
	* cp-tree.h (cxx_init_options): Update.
	* lex.c (cxx_init_options): Update.
f:
	* com.c (ffe_init_options): Update.
java:
	* lang.c (java_init_options): Update.

From-SVN: r67584
2003-06-07 11:10:46 +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 63b025a5c3 genattrtab.h, [...]: Replace "GNU CC" with "GCC".
* genattrtab.h, hosthooks-def.h, hosthooks.h, langhooks-def.h,
	langhooks.h, tree-inline.h: Replace "GNU CC" with "GCC".

From-SVN: r64298
2003-03-13 03:51:01 +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
Matt Austern 2b59501bf6 langhooks.h, [...]: introduce new langhook...
* langhooks.h, langhooks-def.h: introduce new langhook,
       final_write_globals, with write_global_declarations as default.
       * toplev.c: Move invocation of wrapup_global_declarations from
       compile_file to new function, write_global_declarations.  Change
       compile_file to use final_write_globals hook.  Change
       wrapup_global_declarations so writing to DECL_DEFER_OUTPUT is
       conditional.

       * cp/cp-lang.c: Change lang hooks so that final_write_globals does
       nothing for C++.
       * cp/decl.c (wrapup_globals_for_namespace): Remove special
       handling of global namespace.

From-SVN: r63051
2003-02-18 18:50:05 +00:00
Jan Hubicka e72fcfe8e4 Makefile.in (CRTSTUFF_CFLAGS): Add -fno-unit-at-a-time
* Makefile.in (CRTSTUFF_CFLAGS): Add -fno-unit-at-a-time
	(OBJS): Add callgraph.o
	(callgraph.o): New.
	* c-decl.c (expand_body_1): Break out from ...
	(expand_body): This one;  change calling convention
	(finish_function): Move some of expand_body logic here.
	(c_expand_deferred_function): Update call of expand_body
	(c_expand_stmt): Use c_expand_body_1.
	* c-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Define.
	* c-objc-commin.c (c_objc_common_finish_file): Use callgraph code.
	* c-tree.h (c_expand_body): Declare.
	* callgraph.c: New file.
	* flags.h (flag_unit_at_a_time): Declare.
	* langhooks.h (LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION,
	LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION,
	LANG_HOOKS_CALLGRAPH_INITIALIZER): New macros.
	* langhooks.h (struct lang_hooks_for_callgraph): New.
	(struct lang_hooks): Add callgraph field.
	* toplev.c (flag_unit_at_a_time): New.
	(lang_independent_options): Add flag_unit_at_a_time.
	(process_options): Disable unit-at-a-time mode for frontends not
	supporting callgraph.
	* tree-inline.c (typedef struct inline_data): Add "decl"
	(expand_call_inline): Update callgraph.
	(optimize_inline_calls): Set id.decl.
	* tree.h (cgraph_finalize_function, cgraph_finalize_compilation_unit,
	cgraph_create_edges, dump_cgraph, cgraph_optimize, cgraph_remove_call
	cgraph_calls_p): Declare.
	* invoke.texi (-funit-at-a-time): Document

From-SVN: r62789
2003-02-12 21:48:59 +00:00
Zack Weinberg 4977bab6ed Merge basic-improvements-branch to trunk
From-SVN: r60174
2002-12-16 18:23:00 +00:00
Zack Weinberg 8bcefb43cc langhooks.h (struct lang_hooks_for_tree_inlining): Add var_mod_type_p.
* langhooks.h (struct lang_hooks_for_tree_inlining): Add
	var_mod_type_p.
	* langhooks-def.h: Default for tree_inlining.var_mod_type_p is
	hook_tree_bool_false.

	* tree.c (variably_modified_type_p): Moved here from
	cp/tree.c.  Use lang_hooks.tree_inlining.var_mod_type_p for
	language-specific cases.  Due to this, must weaken some 'if
	and only if' checks to merely 'if'.
	* tree.h: Prototype variably_modified_type_p.

	* tree-inline.c (walk_tree): #undef WALK_SUBTREE_TAIL at end.

cp:
	* cp-lang.c (cp_var_mod_type_p): New: C++ hook for
	variably_modified_type_p.
	* cp-tree.h: Remove prototype of variably_modified_type_p.
	* tree.c (variably_modified_type_p): Remove; now implemented
	in language-independent code.

From-SVN: r58460
2002-10-23 17:13:18 +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
Kazu Hirata 05713b80e0 ChangeLog: Follow spelling conventions.
* ChangeLog: Follow spelling conventions.
	* ChangeLog.0: Likewise.
	* ChangeLog.1: Likewise.
	* ChangeLog.2: Likewise.
	* ChangeLog.3: Likewise.
	* ChangeLog.4: Likewise.
	* ChangeLog.5: Likewise.
	* ChangeLog.6: Likewise.
	* FSFChangeLog.10: Likewise.
	* FSFChangeLog.11: Likewise.
	* c-common.c: Likewise.
	* c-common.h: Likewise.
	* c-format.c: Likewise.
	* c-opts.c: Likewise.
	* cpplib.c: Likewise.
	* langhooks.h: Likewise.
	* real.c: Likewise.
	* reg-stack.c: Likewise.
	* toplev.c: Likewise.
	* config/arm/arm.c: Likewise.
	* config/arm/arm.md: Likewise.
	* config/arm/linux-gas.h: Likewise.
	* config/arm/netbsd.h: Likewise.
	* config/c4x/c4x.c: Likewise.
	* config/c4x/c4x.h: Likewise.
	* config/c4x/c4x.md: Likewise.
	* config/c4x/libgcc.S: Likewise.
	* config/fr30/fr30.md: Likewise.
	* config/frv/frv.md: Likewise.
	* config/ia64/ia64.md: Likewise.
	* config/mips/mips.h: Likewise.
	* config/mn10300/mn10300.c: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/v850/v850.md: Likewise.
	* doc/extend.texi: Likewise.
	* doc/invoke.texi: Likewise.
	* doc/md.texi: Likewise.

From-SVN: r57166
2002-09-15 18:24:08 +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
Neil Booth 5351f1ca74 c-common.c (c_common_post_options): Update prototype; don't init backends if preprocessing only.
* c-common.c (c_common_post_options): Update prototype;
	don't init backends if preprocessing only.
	* langhooks-def.h (LANG_HOOKS_POST_OPTIONS): Update.
	* langhooks.h (struct lang_hooks): Update post_options to
	return a boolean.
	* toplev.c (parse_options_and_default_flags, do_compile,
	lang_independent_init): Update prototypes.  Allow the
	front end to specify that there is no need to initialize
	the back end.
	(general_init): Move call to hex_init here...
	(toplev_main): ...from here.  Pass flag for back end init
	suppression.
java:
	* lang.c (java_post_options): Update prototype.

From-SVN: r55306
2002-07-07 22:10:18 +00:00
Geoffrey Keating e2500fedef Merge from pch-branch up to tag pch-commit-20020603.
From-SVN: r54232
2002-06-04 07:11:05 +00: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 e5f3b786ed re PR preprocessor/6517 (gcc hangs on C compile with multiple "-I-")
PR preprocessor/6517
	* Makefile.in: Update.
	* c-common.c (c_common_post_options): Add preprocessor
	errors to the error count.
	* c-lang.c (c_post_options): Kill.
	(LANG_HOOKS_POST_OPTIONS): Use c_common_post_options.
	* hooks.h: Add header guards.
	* langhooks-def.h: Include hooks.h.
	(LANG_HOOKS_POST_OPTIONS): Update.
	* langhooks.h (struct lang_hooks): Update post_options.
	* toplev.c (parse_options_and_default_flags): Update.
cp:
	* cp-lang.c (LANG_HOOKS_POST_OPTIONS): Use c_common_post_options.
	* cp-tree.h (cxx_post_options): Kill.
	* cp-lex.c (cxx_post_options): Kill.
objc:
	* objc-lang.c (objc_post_options): Kill.
	(LANG_HOOKS_POST_OPTIONS): Use c_common_post_options.

From-SVN: r53724
2002-05-22 05:40:22 +00:00