diff options
author | Jan Hubicka <jh@suse.cz> | 2008-07-16 23:38:15 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2008-07-16 21:38:15 +0000 |
commit | 7386e3ee260414735222ea6559f3bb94ecd011f9 (patch) | |
tree | e06ba8171841b599b4229f871ff4b5a27a61ccb2 /gcc/varpool.c | |
parent | de498dd486218343a3db23354de14e6da81ada81 (diff) | |
download | gcc-7386e3ee260414735222ea6559f3bb94ecd011f9.tar.gz |
cgraph.h (varpool_empty_needed_queue): Declare.
* cgraph.h (varpool_empty_needed_queue): Declare.
* cgraphunit.c (output_in_order): Mark all variables as needed;
empty the queue.
* varpool.c (varpool_assemble_node): Update debug queue.
(varpool_assemble_pending_decls): Don't do it here.
(varpool_empty_needed_queue): New function.
From-SVN: r137903
Diffstat (limited to 'gcc/varpool.c')
-rw-r--r-- | gcc/varpool.c | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/gcc/varpool.c b/gcc/varpool.c index 4149c1d1d21..c2410f664f5 100644 --- a/gcc/varpool.c +++ b/gcc/varpool.c @@ -357,7 +357,13 @@ varpool_assemble_decl (struct varpool_node *node) && (TREE_CODE (decl) != VAR_DECL || !DECL_HAS_VALUE_EXPR_P (decl))) { assemble_variable (decl, 0, 1, 0); - return TREE_ASM_WRITTEN (decl); + if (TREE_ASM_WRITTEN (decl)) + { + node->next_needed = varpool_assembled_nodes_queue; + varpool_assembled_nodes_queue = node; + node->finalized = 1; + return true; + } } return false; @@ -423,12 +429,7 @@ varpool_assemble_pending_decls (void) varpool_nodes_queue = varpool_nodes_queue->next_needed; if (varpool_assemble_decl (node)) - { - changed = true; - node->next_needed = varpool_assembled_nodes_queue; - varpool_assembled_nodes_queue = node; - node->finalized = 1; - } + changed = true; else node->next_needed = NULL; } @@ -438,6 +439,26 @@ varpool_assemble_pending_decls (void) return changed; } +/* Remove all elements from the queue so we can re-use it for debug output. */ +void +varpool_empty_needed_queue (void) +{ + /* EH might mark decls as needed during expansion. This should be safe since + we don't create references to new function, but it should not be used + elsewhere. */ + varpool_analyze_pending_decls (); + + while (varpool_nodes_queue) + { + struct varpool_node *node = varpool_nodes_queue; + varpool_nodes_queue = varpool_nodes_queue->next_needed; + node->next_needed = NULL; + } + /* varpool_nodes_queue is now empty, clear the pointer to the last element + in the queue. */ + varpool_last_needed_node = NULL; +} + /* Output all variables enqueued to be assembled. */ void varpool_output_debug_info (void) |