aboutsummaryrefslogtreecommitdiff
path: root/gcc/f
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2004-04-02 01:28:15 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2004-04-01 23:28:15 +0000
commit18c6ada9b2ee27a40db256f4c32779fc25872050 (patch)
tree77aa1595ee2a84a8ea2004429140d1fb8bcc2796 /gcc/f
parente86327772eaa1f4b2c352a411afa195b30ff0c8f (diff)
downloadgcc-18c6ada9b2ee27a40db256f4c32779fc25872050.zip
gcc-18c6ada9b2ee27a40db256f4c32779fc25872050.tar.gz
gcc-18c6ada9b2ee27a40db256f4c32779fc25872050.tar.bz2
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
Diffstat (limited to 'gcc/f')
-rw-r--r--gcc/f/ChangeLog6
-rw-r--r--gcc/f/Make-lang.in2
-rw-r--r--gcc/f/com.c7
3 files changed, 14 insertions, 1 deletions
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog
index be92b29..122e490 100644
--- a/gcc/f/ChangeLog
+++ b/gcc/f/ChangeLog
@@ -1,3 +1,9 @@
+2004-04-02 Jan Hubicka <jh@suse.cz>
+
+ * Make-lang.in (com.o): Add dependnecy on function.h
+ * com.c: Include function.h
+ (finish_function): Clear DECL_STRUCT_FUNCTION.
+
2004-04-01 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* com.c (ffe_truthvalue_conversion, case COMPONENT_REF):
diff --git a/gcc/f/Make-lang.in b/gcc/f/Make-lang.in
index 052adfc..80c870c 100644
--- a/gcc/f/Make-lang.in
+++ b/gcc/f/Make-lang.in
@@ -374,7 +374,7 @@ f/com.o: f/com.c f/proj.h $(CONFIG_H) $(SYSTEM_H) flags.h $(RTL_H) $(TREE_H) \
f/intrin.def f/lab.h f/symbol.h f/symbol.def f/equiv.h f/storag.h f/global.h \
f/name.h f/expr.h f/implic.h f/src.h f/st.h $(GGC_H) toplev.h diagnostic.h \
$(LANGHOOKS_DEF) langhooks.h intl.h real.h debug.h gt-f-com.h gtype-f.h \
- coretypes.h $(TM_H)
+ coretypes.h $(TM_H) function.h
f/data.o: f/data.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/data.h f/bld.h f/bld-op.def \
f/bit.h f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def \
f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def f/where.h glimits.h \
diff --git a/gcc/f/com.c b/gcc/f/com.c
index ab6fc1b..951e018 100644
--- a/gcc/f/com.c
+++ b/gcc/f/com.c
@@ -136,6 +136,7 @@ typedef struct { unsigned :16, :16, :16; } vms_ino_t;
#include "target.h"
#include "top.h"
#include "type.h"
+#include "function.h"
/* Externals defined here. */
@@ -13591,6 +13592,12 @@ finish_function (int nested)
/* Run the optimizers and output the assembler code for this function. */
rest_of_compilation (fndecl);
+ if (! DECL_DEFER_OUTPUT (fndecl))
+ {
+ free_after_compilation (cfun);
+ DECL_STRUCT_FUNCTION (fndecl) = 0;
+ }
+ cfun = 0;
/* Undo the GC context switch. */
if (nested)