aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-section-in.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2013-08-30 09:33:06 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2013-08-30 07:33:06 +0000
commit256eefa9a9497fae8dcc8bb96c8a28dd9c3e6dc8 (patch)
tree64eb6436c13bf84949443327cd89e6ca2e8bee1c /gcc/lto-section-in.c
parent3f0fdc34ffab3a288401fd51c95851f1e8d445bf (diff)
downloadgcc-256eefa9a9497fae8dcc8bb96c8a28dd9c3e6dc8.zip
gcc-256eefa9a9497fae8dcc8bb96c8a28dd9c3e6dc8.tar.gz
gcc-256eefa9a9497fae8dcc8bb96c8a28dd9c3e6dc8.tar.bz2
lto-symtab.c (lto_cgraph_replace_node): Free decl_in_state.
* lto-symtab.c (lto_cgraph_replace_node): Free decl_in_state. * cgraph.c (cgraph_release_function_body): Free decl_in_state. * lto-section-in.c (lto_free_function_in_decl_state): New function. (lto_free_function_in_decl_state_for_node): New function. * lto.c (read_cgraph_and_symbols): Remove ggc_collect; clear section node; add comment why we do not collect. From-SVN: r202093
Diffstat (limited to 'gcc/lto-section-in.c')
-rw-r--r--gcc/lto-section-in.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/lto-section-in.c b/gcc/lto-section-in.c
index 0ef421f..5821030 100644
--- a/gcc/lto-section-in.c
+++ b/gcc/lto-section-in.c
@@ -414,6 +414,41 @@ lto_get_function_in_decl_state (struct lto_file_decl_data *file_data,
return slot? ((struct lto_in_decl_state*) *slot) : NULL;
}
+/* Free decl_states. */
+
+void
+lto_free_function_in_decl_state (struct lto_in_decl_state *state)
+{
+ int i;
+ for (i = 0; i < LTO_N_DECL_STREAMS; i++)
+ ggc_free (state->streams[i].trees);
+ ggc_free (state);
+}
+
+/* Free decl_states associated with NODE. This makes it possible to furhter
+ release trees needed by the NODE's body. */
+
+void
+lto_free_function_in_decl_state_for_node (symtab_node node)
+{
+ struct lto_in_decl_state temp;
+ void **slot;
+
+ if (!node->symbol.lto_file_data)
+ return;
+
+ temp.fn_decl = node->symbol.decl;
+ slot = htab_find_slot (node->symbol.lto_file_data->function_decl_states,
+ &temp, NO_INSERT);
+ if (slot && *slot)
+ {
+ lto_free_function_in_decl_state ((struct lto_in_decl_state*) *slot);
+ htab_clear_slot (node->symbol.lto_file_data->function_decl_states,
+ slot);
+ }
+ node->symbol.lto_file_data = NULL;
+}
+
/* Report read pass end of the section. */