/* Mark DECL as finalized. By finalizing the declaration, frontend instruct the middle end to output the variable to asm file, if needed or externally visible. */ void varpool_finalize_decl (tree decl) { struct varpool_node *node = varpool_node (decl); gcc_assert (TREE_STATIC (decl)); /* The first declaration of a variable that comes through this function decides whether it is global (in C, has external linkage) or local (in C, has internal linkage). So do nothing more if this function has already run. */ if (node->finalized) { if (cgraph_global_info_ready) varpool_assemble_pending_decls (); return; } if (node->needed) varpool_enqueue_needed_node (node); node->finalized = true; if (TREE_THIS_VOLATILE (decl) || DECL_PRESERVE_P (decl)) node->force_output = true; if (decide_is_variable_needed (node, decl)) varpool_mark_needed_node (node); if (cgraph_global_info_ready) varpool_assemble_pending_decls (); }
/* Mark DECL as finalized. By finalizing the declaration, frontend instruct the middle end to output the variable to asm file, if needed or externally visible. */ void varpool_finalize_decl (tree decl) { struct varpool_node *node = varpool_node (decl); gcc_assert (TREE_STATIC (decl)); /* The first declaration of a variable that comes through this function decides whether it is global (in C, has external linkage) or local (in C, has internal linkage). So do nothing more if this function has already run. */ if (node->finalized) { if (cgraph_global_info_ready) varpool_assemble_pending_decls (); return; } if (node->needed) varpool_enqueue_needed_node (node); node->finalized = true; if (TREE_THIS_VOLATILE (decl) || DECL_PRESERVE_P (decl) /* Traditionally we do not eliminate static variables when not optimizing and when not doing toplevel reoder. */ || (!flag_toplevel_reorder && !DECL_COMDAT (node->symbol.decl) && !DECL_ARTIFICIAL (node->symbol.decl))) node->symbol.force_output = true; if (decide_is_variable_needed (node, decl)) varpool_mark_needed_node (node); if (cgraph_global_info_ready) varpool_assemble_pending_decls (); }
/* Mark DECL as finalized. By finalizing the declaration, frontend instruct the middle end to output the variable to asm file, if needed or externally visible. */ void varpool_finalize_decl (tree decl) { struct varpool_node *node = varpool_node (decl); /* The first declaration of a variable that comes through this function decides whether it is global (in C, has external linkage) or local (in C, has internal linkage). So do nothing more if this function has already run. */ if (node->finalized) { if (cgraph_global_info_ready) varpool_assemble_pending_decls (); return; } if (node->needed) varpool_enqueue_needed_node (node); node->finalized = true; if (decide_is_variable_needed (node, decl)) varpool_mark_needed_node (node); /* Since we reclaim unreachable nodes at the end of every language level unit, we need to be conservative about possible entry points there. */ else if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl)) varpool_mark_needed_node (node); if (cgraph_global_info_ready) varpool_assemble_pending_decls (); }
/* Mark DECL as finalized. By finalizing the declaration, frontend instruct the middle end to output the variable to asm file, if needed or externally visible. */ void varpool_finalize_decl (tree decl) { struct varpool_node *node = varpool_node (decl); /* FIXME: We don't really stream varpool datastructure and instead rebuild it by varpool_finalize_decl. This is not quite correct since this way we can't attach any info to varpool. Eventually we will want to stream varpool nodes and the flags. For the moment just prevent analysis of varpool nodes to happen again, so we will re-try to compute "address_taken" flag of varpool that breaks in presence of clones. */ if (in_lto_p) node->analyzed = true; /* The first declaration of a variable that comes through this function decides whether it is global (in C, has external linkage) or local (in C, has internal linkage). So do nothing more if this function has already run. */ if (node->finalized) { if (cgraph_global_info_ready) varpool_assemble_pending_decls (); return; } if (node->needed) varpool_enqueue_needed_node (node); node->finalized = true; if (decide_is_variable_needed (node, decl)) varpool_mark_needed_node (node); /* Since we reclaim unreachable nodes at the end of every language level unit, we need to be conservative about possible entry points there. */ else if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl)) varpool_mark_needed_node (node); if (cgraph_global_info_ready) varpool_assemble_pending_decls (); }