summaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-12 21:48:59 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-12 21:48:59 +0000
commit833eb72438b0a66929179b0402b48da4632d6af5 (patch)
tree145028e0c53cc6c7857dc24db0335535b3ff24ab /gcc/toplev.c
parent919d789fe70b97397da681856f8269a4e7967b6a (diff)
downloadgcc-833eb72438b0a66929179b0402b48da4632d6af5.tar.gz
* 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 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62789 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 38cff5b12d7..0e05323503e 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -883,6 +883,10 @@ int flag_new_regalloc = 0;
int flag_tracer = 0;
+/* Nonzero if we perform whole unit at a time compilation. */
+
+int flag_unit_at_a_time = 0;
+
/* Values of the -falign-* flags: how much to align labels in code.
0 means `use default', 1 means `don't align'.
For each variable, there is an _log variant which is the power
@@ -989,6 +993,8 @@ static const lang_independent_options f_options[] =
N_("Optimize sibling and tail recursive calls") },
{"tracer", &flag_tracer, 1,
N_("Perform superblock formation via tail duplication") },
+ {"unit-at-a-time", &flag_unit_at_a_time, 1,
+ N_("Compile whole compilation unit at a time") },
{"cse-follow-jumps", &flag_cse_follow_jumps, 1,
N_("When running CSE, follow jumps to their targets") },
{"cse-skip-blocks", &flag_cse_skip_blocks, 1,
@@ -5124,6 +5130,11 @@ process_options ()
if (flag_asynchronous_unwind_tables)
flag_unwind_tables = 1;
+ /* Disable unit-at-a-time mode for frontends not supporting callgraph
+ interface. */
+ if (flag_unit_at_a_time && ! lang_hooks.callgraph.expand_function)
+ flag_unit_at_a_time = 0;
+
/* Warn about options that are not supported on this machine. */
#ifndef INSN_SCHEDULING
if (flag_schedule_insns || flag_schedule_insns_after_reload)