diff options
author | Jan Hubicka <jh@suse.cz> | 2003-03-05 02:33:27 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2003-03-05 01:33:27 +0000 |
commit | dafc5b82d5d54972593f6270b7b1ed14e2c18bca (patch) | |
tree | c65a7c71518b86c824939e78d633204bce6006c7 /gcc/cgraph.c | |
parent | 75d8f260dfdb422996bb96fc3d120f451c009927 (diff) | |
download | gcc-dafc5b82d5d54972593f6270b7b1ed14e2c18bca.zip gcc-dafc5b82d5d54972593f6270b7b1ed14e2c18bca.tar.gz gcc-dafc5b82d5d54972593f6270b7b1ed14e2c18bca.tar.bz2 |
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
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r-- | gcc/cgraph.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 7df18f1..d947eb9 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -43,6 +43,9 @@ struct cgraph_node *cgraph_nodes; /* Number of nodes in existence. */ int cgraph_n_nodes; +/* Set when whole unit has been analyzed so we can access global info. */ +bool cgraph_global_info_ready = false; + static struct cgraph_edge *create_edge PARAMS ((struct cgraph_node *, struct cgraph_node *)); static void remove_edge PARAMS ((struct cgraph_node *, struct cgraph_node *)); @@ -175,6 +178,33 @@ cgraph_calls_p (caller_decl, callee_decl) return edge != NULL; } +/* Return local info for the compiled function. */ + +struct cgraph_local_info * +cgraph_local_info (decl) + tree decl; +{ + struct cgraph_node *node; + if (TREE_CODE (decl) != FUNCTION_DECL) + abort (); + node = cgraph_node (decl); + return &node->local; +} + +/* Return local info for the compiled function. */ + +struct cgraph_global_info * +cgraph_global_info (decl) + tree decl; +{ + struct cgraph_node *node; + if (TREE_CODE (decl) != FUNCTION_DECL || !cgraph_global_info_ready) + abort (); + node = cgraph_node (decl); + return &node->global; +} + + /* Dump the callgraph. */ void |