diff options
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 64 |
1 files changed, 17 insertions, 47 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index dbcb1bf..d506b31 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -2249,7 +2249,7 @@ mark_decl_referenced (tree decl) struct cgraph_node *node = cgraph_get_create_node (decl); if (!DECL_EXTERNAL (decl) && !node->local.finalized) - cgraph_mark_needed_node (node); + cgraph_mark_force_output_node (node); } else if (TREE_CODE (decl) == VAR_DECL) { @@ -2257,7 +2257,7 @@ mark_decl_referenced (tree decl) varpool_mark_needed_node (node); /* C++ frontend use mark_decl_references to force COMDAT variables to be output that might appear dead otherwise. */ - node->force_output = true; + node->symbol.force_output = true; } /* else do nothing - we can get various sorts of CST nodes here, which do not need to be marked. */ @@ -5271,13 +5271,20 @@ weak_finish_1 (tree decl) #endif } +/* Fiven an assembly name, find the decl it is associated with. */ +static tree +find_decl (tree target) +{ + symtab_node node = symtab_node_for_asm (target); + if (node) + return node->symbol.decl; + return NULL_TREE; +} + /* This TREE_LIST contains weakref targets. */ static GTY(()) tree weakref_targets; -/* Forward declaration. */ -static tree find_decl_and_mark_needed (tree decl, tree target); - /* Emit any pending weak declarations. */ void @@ -5303,7 +5310,7 @@ weak_finish (void) # if defined ASM_WEAKEN_LABEL && ! defined ASM_WEAKEN_DECL ASM_WEAKEN_LABEL (asm_out_file, IDENTIFIER_POINTER (target)); # else - tree decl = find_decl_and_mark_needed (alias_decl, target); + tree decl = find_decl (target); if (! decl) { @@ -5406,43 +5413,6 @@ globalize_decl (tree decl) VEC(alias_pair,gc) *alias_pairs; -/* Given an assembly name, find the decl it is associated with. At the - same time, mark it needed for cgraph. */ - -static tree -find_decl_and_mark_needed (tree decl, tree target) -{ - struct cgraph_node *fnode = NULL; - struct varpool_node *vnode = NULL; - - if (TREE_CODE (decl) == FUNCTION_DECL) - { - fnode = cgraph_node_for_asm (target); - if (fnode == NULL) - vnode = varpool_node_for_asm (target); - } - else - { - vnode = varpool_node_for_asm (target); - if (vnode == NULL) - fnode = cgraph_node_for_asm (target); - } - - if (fnode) - { - cgraph_mark_needed_node (fnode); - return fnode->symbol.decl; - } - else if (vnode) - { - varpool_mark_needed_node (vnode); - vnode->force_output = 1; - return vnode->symbol.decl; - } - else - return NULL_TREE; -} - /* Output the assembler code for a define (equate) using ASM_OUTPUT_DEF or ASM_OUTPUT_DEF_FROM_DECLS. The function defines the symbol whose tree node is DECL to have the value of the tree node TARGET. */ @@ -5748,7 +5718,7 @@ finish_aliases_1 (void) { tree target_decl; - target_decl = find_decl_and_mark_needed (p->decl, p->target); + target_decl = find_decl (p->target); if (target_decl == NULL) { if (symbol_alias_set_contains (defined, p->target)) @@ -5854,7 +5824,7 @@ assemble_alias (tree decl, tree target) /* If the target has already been emitted, we don't have to queue the alias. This saves a tad of memory. */ if (cgraph_global_info_ready) - target_decl = find_decl_and_mark_needed (decl, target); + target_decl = find_decl (target); else target_decl= NULL; if (target_decl && TREE_ASM_WRITTEN (target_decl)) @@ -5960,12 +5930,12 @@ dump_tm_clone_pairs (VEC(tm_alias_pair,heap) *tm_alias_pairs) TM_GETTMCLONE. If neither of these are true, we didn't generate a clone, and we didn't call it indirectly... no sense keeping it in the clone table. */ - if (!dst_n || !dst_n->needed) + if (!dst_n || !dst_n->analyzed) continue; /* This covers the case where we have optimized the original function away, and only access the transactional clone. */ - if (!src_n || !src_n->needed) + if (!src_n || !src_n->analyzed) continue; if (!switched) |