aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index c558a00..e84c700 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -884,15 +884,15 @@ walk_polymorphic_call_targets (hash_set<void *> *reachable_call_targets,
/* Discover all functions and variables that are trivially needed, analyze
them as well as all functions and variables referred by them */
+static cgraph_node *first_analyzed;
+static varpool_node *first_analyzed_var;
static void
analyze_functions (void)
{
/* Keep track of already processed nodes when called multiple times for
intermodule optimization. */
- static cgraph_node *first_analyzed;
cgraph_node *first_handled = first_analyzed;
- static varpool_node *first_analyzed_var;
varpool_node *first_handled_var = first_analyzed_var;
hash_set<void *> reachable_call_targets;
@@ -2292,6 +2292,22 @@ symbol_table::finalize_compilation_unit (void)
timevar_pop (TV_CGRAPH);
}
+/* Reset all state within cgraphunit.c so that we can rerun the compiler
+ within the same process. For use by toplev::finalize. */
+
+void
+cgraphunit_c_finalize (void)
+{
+ gcc_assert (cgraph_new_nodes.length () == 0);
+ cgraph_new_nodes.truncate (0);
+
+ vtable_entry_type = NULL;
+ queued_nodes = &symtab_terminator;
+
+ first_analyzed = NULL;
+ first_analyzed_var = NULL;
+}
+
/* Creates a wrapper from cgraph_node to TARGET node. Thunk is used for this
kind of wrapper method. */