Commit Graph

18 Commits

Author SHA1 Message Date
Jan Hubicka a194aa56e6 cgraph.c (cgraph_node_name): New function.
* cgraph.c (cgraph_node_name): New function.
	(dump_cgraph): Use it.
	* cgraph.h (cgraph_dump_file): Declare.
	(cgraph_node_name): Declare.
	* cgraphunit.c: Include timevar.h
	(cgraph_finalize_compilation_unit): Use timevar; reorganize dumps.
	(cgraph_optimize_function): Use TV_INTEGRATION.
	(cgraph_mark_local_functions): reorganize dumps.
	(cgraph_mark_functions_to_inline_once): Likewise.
	(cgraph_optimize): Likewise; use timevar.
	* timevar.def (TV_CGRAPH, TV_CGRAPHOPT): New.
	* toplev.c (dump_file_index): Add DFI_cgraph.
	(dump_file_info): Likewise.
	(cgraph_dump_file): New global variable.
	(do_compile): Open and close cgraph dump.
	* invoke.texi (-d): Document new flag; renumber.

From-SVN: r69120
2003-07-09 01:20:24 +00:00
Jan Hubicka 8bd87c4e73 cgraph.c (cgraph_mark_needed_node, [...]): Use next_needed field instead of aux to maintain the queue.
* cgraph.c (cgraph_mark_needed_node, cgraph_varpool_mark_needed_node,
	cgraph_varpool_finalize_decl, cgraph_varpool_assemble_pending_decls):
	Use next_needed field instead of aux to maintain the queue.
	* cgraph.h (cgraph_node): Add next_needed.
	(cgraph_varpool_node): Add next_needed; remove aux.
	* cgraphunit.c (cgraph_finalize_compilation_unit): Use next_needed.

From-SVN: r68807
2003-07-02 00:17:38 +00:00
Jan Hubicka ed2df68b4b Makefile.in (GTFILES): Add cgraph.h.
* Makefile.in (GTFILES): Add cgraph.h.
	* cgraph.c (known_decls): Remove.
	(cgraph_hash, cgraph_nodes, cgraph_nodes_queue,
	cgraph_varpool_hash, cgraph_varpool_nodes_queue): GTYize.
	(cgraph_node): Do not allocate known_decls; use polutate hashtable.
	(cgraph_varpool_node): Likewise; add next pointer.
	(cgraph_varpool_nodes): New static variable.
	* cgraph.h (cgraph_local_info, cgraph_global_info, cgraph_rtl_info,
	cgraph_node, cgraph_edge, cgraph_varpool_node, cgraph_nodes, cgraph_n_nodes,
	cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): GTYize.
	* gengtype.c (open_base_files): Include cgraph.h

From-SVN: r68742
2003-06-30 21:56:46 +00:00
Kazu Hirata f1ba665bc7 builtins.c: Follow spelling conventions.
* builtins.c: Follow spelling conventions.
	* cgraph.c: Likewise.
	* cpplex.c: Likewise.
	* config/arm/arm.c: Likewise.
	* config/arm/iwmmxt.md: Likewise.
	* config/c4x/c4x-modes.def: Likewise.
	* config/c4x/c4x.c: Likewise.
	* config/c4x/c4x.h: Likewise.
	* config/c4x/c4x.md: Likewise.
	* config/i386/i386-interix.h: Likewise.
	* config/mips/mips.h: Likewise.

From-SVN: r68648
2003-06-28 19:43:01 +00:00
Jan Hubicka 67f2899de2 cgraph.c (cgraph_node, [...]): Avoid re-initializing of known_decls.
* cgraph.c (cgraph_node, cgraph_varpool_node): Avoid re-initializing
	of known_decls.

From-SVN: r68573
2003-06-27 15:42:48 +00:00
Jan Hubicka e69529cd53 Makefile.in (cgraph.o): Depend on output.h, not depend on tree-inline.h
* Makefile.in (cgraph.o): Depend on output.h, not depend on
	tree-inline.h
	* cgraph.c: Do not include tree-inline.h; include output.h
	(known_fns): Rename to ...
	(known_decls): ... this one; update all uses.
	(cgraph_varpool_hash): New static variable.
	(cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): New global
	variables.
	(cgraph_varpool_hash_node, eq_cgraph_varpool_node, cgraph_varpool_node,
	cgraph_varpool_node_for_identifier, cgraph_varpool_mark_needed_node,
	cgraph_varpool_finalize_decl, cgraph_varpool_assemble_pending_decls):
	New functions.
	* cgraph.h (cgraph_varpool_node): New structure.
	(cgraph_varpool_n_nodes, cgraph_varpool_nodes_queue): Declare.
	(cgraph_varpool_node, cgraph_varpool_node_for_identifier,
	cgraph_varpool_finalize_decl, cgraph_varpool_mark_needed_node,
	cgraph_varpool_asemble_pending_decls): Declare.
	* cgraphunit.c (record_call_1): Notice variable references.
	(cgraph_finalize_compilation_unit): Assemble pending variables.
	* toplev.c (wrapup_global_declarations): Use varpool.
	(compile_file): Assemble pending declarations.
	(rest_of_decl_compilation): Use varpool in unit-at-a-time mode.
	* varasm.c (assemble_name): Notice varpool references.

From-SVN: r68426
2003-06-24 16:50:29 +00:00
Jan Hubicka 1668aabc22 cgraph.c (cgraph_nodes_queue): Declare.
* cgraph.c (cgraph_nodes_queue): Declare.
	(eq_node): Take identifier as p2.
	(cgraph_node): Update htab_find_slot_with_hash call.
	(cgraph_node_for_identifier): New.
	(cgraph_mark_needed_node): Move here from cgraphunit.c.
	* cgraph.h (cgraph_nodes_queue): Declare.
	(cgraph_node_for_identifier): Declare.
	* cgraphunit.c (cgraph_finalize_function): Collect entry points here
	instead of in cgraph_finalize_compilation_unit; constructors and
	destructors are entry points.
	(cgraph_finalize_compilation_unit): Reorganize debug outout;
	examine nested functions after lowerng; call collect_functions hook.
	(cgraph_mark_local_functions): DECL_COMDAT functions are not local.
	(cgraph_finalize_compilation_unit): Do not collect entry points.
	* varasm.c: Include cgraph.h
	(assemble_name): Mark referenced identifier as needed.

	* cgraphunit.c (record_call_1): Use get_callee_fndecl.

From-SVN: r68390
2003-06-23 21:11:44 +00:00
Kaveh R. Ghazi fad205ffba decl.c, [...]: Don't use the PTR macro.
cp:
	* cp/decl.c, cp/pt.c, cp/search.c, cp/tree.c: Don't use the PTR
	macro.

gcc:
	* bitmap.c, builtins.c, c-incpath.c, cgraph.c, config/frv/frv.c,
	config/mips/mips.c, cppfiles.c, cpphash.c, cppinit.c, cpplib.c,
	dwarf2out.c, dwarfout.c, except.c, expr.c, expr.h, fold-const.c,
	function.c, gcc.c, genoutput.c, gensupport.c, global.c,
	haifa-sched.c, hashtable.c, ifcvt.c, integrate.c, local-alloc.c,
	loop.c, mips-tdump.c, mips-tfile.c, mkdeps.c, protoize.c,
	read-rtl.c, recog.h, reload1.c, sbitmap.c, ssa-dce.c,
	stringpool.c, tlink.c, tree.c, varasm.c, varray.c: Don't use
	the PTR macro.

From-SVN: r68043
2003-06-16 21:41:10 +00:00
Kazu Hirata 6356f89288 ChangeLog: Follow spelling conventions.
* ChangeLog: Follow spelling conventions.
	* ChangeLog.2: Likewise.
	* c-decl.c: Likewise.
	* cfgloop.h: Likewise.
	* cgraph.c: Likewise.
	* coverage.c: Likewise.
	* cppcharset.c: Likewise.
	* cpphash.h: Likewise.
	* cpplex.c: Likewise.
	* cpplib.c: Likewise.
	* dbxout.c: Likewise.
	* df.c: Likewise.
	* dwarf2out.c: Likewise.
	* dwarfout.c: Likewise.
	* emit-rtl.c: Likewise.
	* explow.c: Likewise.
	* gcov-io.c: Likewise.
	* gcov-io.h: Likewise.
	* gcov.c: Likewise.
	* gengtype.c: Likewise.
	* ggc.h: Likewise.
	* opts.c: Likewise.
	* real.c: Likewise.
	* reload.c: Likewise.
	* stmt.c: Likewise.

From-SVN: r67849
2003-06-12 19:01:08 +00:00
Jan Hubicka 988d165386 Makefile.in (cgraph.o): Depend on gt-cgraph.h and varray.h.
* Makefile.in (cgraph.o): Depend on gt-cgraph.h and varray.h.
	* gt-cgraph.h: New GC file.
	* cgraph.c (known_fns): New static variable.
	(cgraph_node): Add the decl into varray.

From-SVN: r63998
2003-03-08 18:24:22 +00:00
Jan Hubicka 18d13f3417 inline-3.c: New test.
* gcc.dg/inline-3.c: New test.

	* c-decl.c: (finish_function): Update call of tree_inlinable_function_p.
	* cgraph.h: (cgraph_local_info): Add can_inline_once
	(cgraph_global_info): Add inline_once.
	(cgraph_node): Add previous.
	(cgraph_remove_node): New.
	* cgraphunit.c (cgraph_mark_functions_to_inline_once): New static
	function.
	(cgraph_optimize): Call it.
	(cgraph_finalize_function):  Set inlinable flags.
	(cgraph_finalize_compilation_unit):  Actually remove the reclaimed nodes.
	(cgraph_mark_functions_to_output):  Use new inlining heuristics flags.
	(cgraph_expand_function): Likewise.
	* cgraph.c
	(cgraph_node): Put nodes into doubly linked chain.
	(cgraph_remove_node): New function.
	* flags.h (flag_inline_functions_called_once): Declare.
	* tree-inline.c: Include cgraph.h
	(inlinable_functions_p): Add extra argument to bypass limits.
	(expand_call_inline):  Obey cgraph flag.
	* tree-inline.h (tree_inlinable_function_p): Update prototype.

From-SVN: r63983
2003-03-08 13:26:37 +00:00
Jan Hubicka 5c2e00ee5a * cgraph.c (cgraph_node): Do not confuse nested functions and methods.
From-SVN: r63889
2003-03-06 13:30:22 +00:00
Jan Hubicka b255a03659 Makefile.in (calls.o, [...]): Depend on cgraph.h
* Makefile.in (calls.o, toplev.o alias.o): Depend on cgraph.h
	* alias.c:  Include cgraph.h
	(mark_constant_function): Use cgraph_rtl_info.
	* calls.c:  Include cgraph.h
	(flags_from_decl_or_type): Use cgraph_rtl_info to find pure and const
	calls.
	(expand_call): Use cgraph_rtl_info to set preferred stack boundary.
	* cgraph.c (cgraph_rtl_info): New function.
	* cgraph.h (cgraph_rtl_info): Declare
	(cgraph_rtl_info): Likewise.
	* function.h (struct function): Add recursive_call_emit.
	* toplev.c: Include cgraph.h.
	(rest_of_compilation): Set preferred_incoming_stack_boundary.

	* gcc.dg/i386-local2.c: New.

From-SVN: r63868
2003-03-05 22:19:33 +00:00
Jan Hubicka dafc5b82d5 i386-local.c: New.
* gcc.dg/i386-local.c: New.

	* toplev.c (rest_of_compilation):  Deffer RTL compilation only when
	RTL inlining is done.

	* cgraphunit.c (cgraph_mark_local_functions): New local function.
	(cgraph_optimize): Mark local functions.
	* i386-protos.h (init_cumulative_args): Update prototype.
	* i386.c (init_cumulative_args): Use register passing convention for
	local functions.

	* cgraph.c (cgraph_global_info_ready): New global variable
	(cgraph_local_info, cgraph_global_info): New functions.
	* cgraph.h (struct cgraph_local_info, cgraph_global_info): New
	structures.
	(cgraph_local_info, cgraph_global_info, cgraph_global_info_ready):
	Declare.
	* cgraphunit.c (cgraph_finalize_function): Set inline_many.
	(cgraph_mark_functions_to_output): Use inline_many.
	(cgraph_expand_function): Free DECL_SAVED_TREE uncondtionally.
	(cgraph_expand_functions): Expand inline functions last.
	(cgraph_optimize): Do not emit uneeded functions.

From-SVN: r63822
2003-03-05 01:33:27 +00:00
Jan Hubicka 1c4a429ab0 expmed.c (expand_divmod): Undo sign extensions for unsigned operands
* expmed.c (expand_divmod): Undo sign extensions for unsigned operands

	* cfgcleanup.c (try_forward_edges):  Don't check loop structures
	when not optimizing.
	(cleanup_cfg): Do not iterate trought delete_trivially_dead_insns
	when not expensive.
	* toplev.c (rest_of_compilation):  Duplicate loop headers only when
	optimizing;  Delete trivially dead insns early; fix optimize check.

	* Makefile.in (c-decl.o, c-objc-common.o, cgraph.o, tree-inline.o): Add
	dependency on cgraph.h
	* c-decl.c: Include cgraph.h
	(finish_function): Update call of tree_inlinable_function_p.
	* c-objc-common.c: Include cgraph.h
	* cgraph.h: New file.
	* cgraphunit.c: New file.
	* cgraph.c (cgraph_node, cgraph_edge): Move into cgraph.h
	(cgraph_nodes, cgraph_n_nodes): Globalize.
	(cgraph_finalize_function, cgraph_finalize_compilation_unit
	cgraph_create_edges, cgraph_optimize, cgraph_mark_needed_node):
	Move into cgraphunit.c
	* tree-inline.c: Include cgraph.h
	* tree-inline.c: Include cgraph.h

From-SVN: r63281
2003-02-22 10:02:31 +00:00
Jan Hubicka c001c39bbb cgraph.c (NPREDECESORC, [...]): Kill.
* cgraph.c (NPREDECESORC, SET_NPREDECESORS): Kill.
	(cgraph_expand_function): Rewrite.

	* gcc.dg/funcorder.c: New test.

From-SVN: r63098
2003-02-19 10:24:56 +00:00
Andreas Schwab 9fb93b00b0 cgraph.c (SET_NPREDECESORS): Add intermediate cast to size_t.
* cgraph.c (SET_NPREDECESORS): Add intermediate cast to size_t.
	Parenthesize properly.
	(NPREDECESORS): Parenthesize properly.

From-SVN: r62838
2003-02-13 12:28:26 +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