Lines Matching refs:node

194 decide_is_function_needed (struct cgraph_node *node, tree decl)  in decide_is_function_needed()  argument
200 node->local.externally_visible = true; in decide_is_function_needed()
205 if (node->local.externally_visible) in decide_is_function_needed()
221 if (node->needed) in decide_is_function_needed()
233 || (!optimize && !node->local.disregard_inline_limits in decide_is_function_needed()
235 && !node->origin)) in decide_is_function_needed()
264 || (!node->local.disregard_inline_limits in decide_is_function_needed()
268 && (!node->local.inlinable || !cgraph_default_inline_p (node, NULL)))) in decide_is_function_needed()
317 struct cgraph_varpool_node *next, *node = cgraph_varpool_nodes_queue; in cgraph_varpool_remove_unreferenced_decls() local
324 while (node) in cgraph_varpool_remove_unreferenced_decls()
326 tree decl = node->decl; in cgraph_varpool_remove_unreferenced_decls()
327 next = node->next_needed; in cgraph_varpool_remove_unreferenced_decls()
328 node->needed = 0; in cgraph_varpool_remove_unreferenced_decls()
330 if (node->finalized in cgraph_varpool_remove_unreferenced_decls()
333 || node->force_output in cgraph_varpool_remove_unreferenced_decls()
334 || decide_is_variable_needed (node, decl) in cgraph_varpool_remove_unreferenced_decls()
341 cgraph_varpool_mark_needed_node (node); in cgraph_varpool_remove_unreferenced_decls()
343 node = next; in cgraph_varpool_remove_unreferenced_decls()
406 cgraph_reset_node (struct cgraph_node *node) in cgraph_reset_node() argument
414 gcc_assert (!node->output); in cgraph_reset_node()
417 memset (&node->local, 0, sizeof (node->local)); in cgraph_reset_node()
418 memset (&node->global, 0, sizeof (node->global)); in cgraph_reset_node()
419 memset (&node->rtl, 0, sizeof (node->rtl)); in cgraph_reset_node()
420 node->analyzed = false; in cgraph_reset_node()
421 node->local.redefined_extern_inline = true; in cgraph_reset_node()
422 node->local.finalized = false; in cgraph_reset_node()
431 if (n->global.inlined_to == node) in cgraph_reset_node()
436 cgraph_node_remove_callees (node); in cgraph_reset_node()
440 if (node->reachable && !flag_unit_at_a_time) in cgraph_reset_node()
445 if (n == node) in cgraph_reset_node()
448 node->reachable = 0; in cgraph_reset_node()
453 cgraph_lower_function (struct cgraph_node *node) in cgraph_lower_function() argument
455 if (node->lowered) in cgraph_lower_function()
457 tree_lowering_passes (node->decl); in cgraph_lower_function()
458 node->lowered = true; in cgraph_lower_function()
482 struct cgraph_node *node = cgraph_node (decl); in cgraph_finalize_function() local
484 if (node->local.finalized) in cgraph_finalize_function()
485 cgraph_reset_node (node); in cgraph_finalize_function()
488 node->decl = decl; in cgraph_finalize_function()
489 node->local.finalized = true; in cgraph_finalize_function()
490 node->lowered = DECL_STRUCT_FUNCTION (decl)->cfg != NULL; in cgraph_finalize_function()
491 if (node->nested) in cgraph_finalize_function()
494 gcc_assert (!node->nested); in cgraph_finalize_function()
500 cgraph_analyze_function (node); in cgraph_finalize_function()
501 cgraph_decide_inlining_incrementally (node, false); in cgraph_finalize_function()
504 if (decide_is_function_needed (node, decl)) in cgraph_finalize_function()
505 cgraph_mark_needed_node (node); in cgraph_finalize_function()
511 cgraph_mark_reachable_node (node); in cgraph_finalize_function()
583 cgraph_create_edges (struct cgraph_node *node, tree body) in cgraph_create_edges() argument
603 cgraph_create_edge (node, cgraph_node (decl), stmt, in cgraph_create_edges()
607 record_reference, node, visited_nodes); in cgraph_create_edges()
610 record_reference, node, visited_nodes); in cgraph_create_edges()
613 walk_tree (bsi_stmt_ptr (bsi), record_reference, node, visited_nodes); in cgraph_create_edges()
627 walk_tree (&DECL_INITIAL (decl), record_reference, node, visited_nodes); in cgraph_create_edges()
638 initialize_inline_failed (struct cgraph_node *node) in initialize_inline_failed() argument
642 for (e = node->callers; e; e = e->next_caller) in initialize_inline_failed()
646 if (node->local.redefined_extern_inline) in initialize_inline_failed()
649 else if (!node->local.inlinable) in initialize_inline_failed()
662 struct cgraph_node *node = cgraph_node (current_function_decl); in rebuild_cgraph_edges() local
665 cgraph_node_remove_callees (node); in rebuild_cgraph_edges()
667 node->count = ENTRY_BLOCK_PTR->count; in rebuild_cgraph_edges()
677 cgraph_create_edge (node, cgraph_node (decl), stmt, in rebuild_cgraph_edges()
681 initialize_inline_failed (node); in rebuild_cgraph_edges()
682 gcc_assert (!node->global.inlined_to); in rebuild_cgraph_edges()
705 verify_cgraph_node (struct cgraph_node *node) in verify_cgraph_node() argument
709 struct function *this_cfun = DECL_STRUCT_FUNCTION (node->decl); in verify_cgraph_node()
718 for (e = node->callees; e; e = e->next_callee) in verify_cgraph_node()
725 if (node->count < 0) in verify_cgraph_node()
730 for (e = node->callers; e; e = e->next_caller) in verify_cgraph_node()
739 if (node->global.inlined_to in verify_cgraph_node()
746 if (node->callers->next_caller) in verify_cgraph_node()
753 if (node->global.inlined_to) in verify_cgraph_node()
759 if (!node->callers && node->global.inlined_to) in verify_cgraph_node()
764 if (node->global.inlined_to == node) in verify_cgraph_node()
770 for (main_clone = cgraph_node (node->decl); main_clone; in verify_cgraph_node()
772 if (main_clone == node) in verify_cgraph_node()
774 if (!cgraph_node (node->decl)) in verify_cgraph_node()
780 if (node->analyzed in verify_cgraph_node()
781 && DECL_SAVED_TREE (node->decl) && !TREE_ASM_WRITTEN (node->decl) in verify_cgraph_node()
782 && (!DECL_EXTERNAL (node->decl) || node->global.inlined_to)) in verify_cgraph_node()
799 struct cgraph_edge *e = cgraph_edge (node, stmt); in verify_cgraph_node()
833 for (e = node->callees; e; e = e->next_callee) in verify_cgraph_node()
848 dump_cgraph_node (stderr, node); in verify_cgraph_node()
858 struct cgraph_node *node; in verify_cgraph() local
863 for (node = cgraph_nodes; node; node = node->next) in verify_cgraph()
864 verify_cgraph_node (node); in verify_cgraph()
869 cgraph_varpool_assemble_decl (struct cgraph_varpool_node *node) in cgraph_varpool_assemble_decl() argument
871 tree decl = node->decl; in cgraph_varpool_assemble_decl()
874 && !node->alias in cgraph_varpool_assemble_decl()
901 struct cgraph_varpool_node *node = cgraph_varpool_nodes_queue; in cgraph_varpool_assemble_pending_decls() local
904 if (cgraph_varpool_assemble_decl (node)) in cgraph_varpool_assemble_pending_decls()
907 node->next_needed = cgraph_varpool_assembled_nodes_queue; in cgraph_varpool_assemble_pending_decls()
908 cgraph_varpool_assembled_nodes_queue = node; in cgraph_varpool_assemble_pending_decls()
909 node->finalized = 1; in cgraph_varpool_assemble_pending_decls()
912 node->next_needed = NULL; in cgraph_varpool_assemble_pending_decls()
927 struct cgraph_varpool_node *node = cgraph_varpool_assembled_nodes_queue; in cgraph_varpool_output_debug_info() local
931 if (DECL_CONTEXT (node->decl) in cgraph_varpool_output_debug_info()
932 && (TREE_CODE (DECL_CONTEXT (node->decl)) == BLOCK in cgraph_varpool_output_debug_info()
933 || TREE_CODE (DECL_CONTEXT (node->decl)) == FUNCTION_DECL) in cgraph_varpool_output_debug_info()
935 (*debug_hooks->global_decl) (node->decl); in cgraph_varpool_output_debug_info()
936 cgraph_varpool_assembled_nodes_queue = node->next_needed; in cgraph_varpool_output_debug_info()
937 node->next_needed = 0; in cgraph_varpool_output_debug_info()
959 cgraph_analyze_function (struct cgraph_node *node) in cgraph_analyze_function() argument
961 tree decl = node->decl; in cgraph_analyze_function()
965 cgraph_lower_function (node); in cgraph_analyze_function()
968 cgraph_create_edges (node, decl); in cgraph_analyze_function()
970 node->local.inlinable = tree_inlinable_function_p (decl); in cgraph_analyze_function()
972 node->local.self_insns = estimate_num_insns (decl); in cgraph_analyze_function()
973 if (node->local.inlinable) in cgraph_analyze_function()
974 node->local.disregard_inline_limits in cgraph_analyze_function()
976 initialize_inline_failed (node); in cgraph_analyze_function()
977 if (flag_really_no_inline && !node->local.disregard_inline_limits) in cgraph_analyze_function()
978 node->local.inlinable = 0; in cgraph_analyze_function()
980 node->global.insns = node->local.self_insns; in cgraph_analyze_function()
982 node->analyzed = true; in cgraph_analyze_function()
1015 struct cgraph_node *node; in process_function_and_variable_attributes() local
1018 for (node = cgraph_nodes; node != first; node = node->next) in process_function_and_variable_attributes()
1020 tree decl = node->decl; in process_function_and_variable_attributes()
1024 if (node->local.finalized) in process_function_and_variable_attributes()
1025 cgraph_mark_needed_node (node); in process_function_and_variable_attributes()
1029 if (! TREE_PUBLIC (node->decl)) in process_function_and_variable_attributes()
1032 node->decl); in process_function_and_variable_attributes()
1035 if (node->local.finalized) in process_function_and_variable_attributes()
1036 cgraph_mark_needed_node (node); in process_function_and_variable_attributes()
1037 node->local.externally_visible = true; in process_function_and_variable_attributes()
1071 struct cgraph_node *node, *next; in cgraph_finalize_compilation_unit() local
1106 for (node = cgraph_nodes; node != first_analyzed; node = node->next) in cgraph_finalize_compilation_unit()
1107 if (node->needed && DECL_SAVED_TREE (node->decl)) in cgraph_finalize_compilation_unit()
1108 fprintf (cgraph_dump_file, " %s", cgraph_node_name (node)); in cgraph_finalize_compilation_unit()
1121 node = cgraph_nodes_queue; in cgraph_finalize_compilation_unit()
1123 node->next_needed = NULL; in cgraph_finalize_compilation_unit()
1130 cgraph_reset_node (node); in cgraph_finalize_compilation_unit()
1134 gcc_assert (!node->analyzed && node->reachable); in cgraph_finalize_compilation_unit()
1137 cgraph_analyze_function (node); in cgraph_finalize_compilation_unit()
1139 for (edge = node->callees; edge; edge = edge->next_callee) in cgraph_finalize_compilation_unit()
1156 for (node = cgraph_nodes; node != first_analyzed; node = node->next) in cgraph_finalize_compilation_unit()
1157 if (node->needed && DECL_SAVED_TREE (node->decl)) in cgraph_finalize_compilation_unit()
1158 fprintf (cgraph_dump_file, " %s", cgraph_node_name (node)); in cgraph_finalize_compilation_unit()
1166 for (node = cgraph_nodes; node != first_analyzed; node = next) in cgraph_finalize_compilation_unit()
1168 tree decl = node->decl; in cgraph_finalize_compilation_unit()
1169 next = node->next; in cgraph_finalize_compilation_unit()
1171 if (node->local.finalized && !DECL_SAVED_TREE (decl)) in cgraph_finalize_compilation_unit()
1172 cgraph_reset_node (node); in cgraph_finalize_compilation_unit()
1174 if (!node->reachable && DECL_SAVED_TREE (decl)) in cgraph_finalize_compilation_unit()
1177 fprintf (cgraph_dump_file, " %s", cgraph_node_name (node)); in cgraph_finalize_compilation_unit()
1178 cgraph_remove_node (node); in cgraph_finalize_compilation_unit()
1182 node->next_needed = NULL; in cgraph_finalize_compilation_unit()
1183 gcc_assert (!node->local.finalized || DECL_SAVED_TREE (decl)); in cgraph_finalize_compilation_unit()
1184 gcc_assert (node->analyzed == node->local.finalized); in cgraph_finalize_compilation_unit()
1200 struct cgraph_node *node; in cgraph_mark_functions_to_output() local
1202 for (node = cgraph_nodes; node; node = node->next) in cgraph_mark_functions_to_output()
1204 tree decl = node->decl; in cgraph_mark_functions_to_output()
1207 gcc_assert (!node->output); in cgraph_mark_functions_to_output()
1209 for (e = node->callers; e; e = e->next_caller) in cgraph_mark_functions_to_output()
1217 && !node->global.inlined_to in cgraph_mark_functions_to_output()
1218 && (node->needed in cgraph_mark_functions_to_output()
1219 || (e && node->reachable)) in cgraph_mark_functions_to_output()
1222 node->output = 1; in cgraph_mark_functions_to_output()
1227 if (!node->global.inlined_to && DECL_SAVED_TREE (decl) in cgraph_mark_functions_to_output()
1230 dump_cgraph_node (stderr, node); in cgraph_mark_functions_to_output()
1234 gcc_assert (node->global.inlined_to || !DECL_SAVED_TREE (decl) in cgraph_mark_functions_to_output()
1245 cgraph_expand_function (struct cgraph_node *node) in cgraph_expand_function() argument
1247 tree decl = node->decl; in cgraph_expand_function()
1250 gcc_assert (!node->global.inlined_to); in cgraph_expand_function()
1255 cgraph_lower_function (node); in cgraph_expand_function()
1262 gcc_assert (TREE_ASM_WRITTEN (node->decl)); in cgraph_expand_function()
1265 if (!cgraph_preserve_function_body_p (node->decl)) in cgraph_expand_function()
1267 DECL_SAVED_TREE (node->decl) = NULL; in cgraph_expand_function()
1268 DECL_STRUCT_FUNCTION (node->decl) = NULL; in cgraph_expand_function()
1269 DECL_INITIAL (node->decl) = error_mark_node; in cgraph_expand_function()
1272 cgraph_node_remove_callees (node); in cgraph_expand_function()
1302 struct cgraph_node *node; in cgraph_expand_all_functions() local
1318 node = order[i]; in cgraph_expand_all_functions()
1319 if (node->output) in cgraph_expand_all_functions()
1321 gcc_assert (node->reachable); in cgraph_expand_all_functions()
1322 node->output = 0; in cgraph_expand_all_functions()
1323 cgraph_expand_function (node); in cgraph_expand_all_functions()
1334 node = cgraph_expand_queue; in cgraph_expand_all_functions()
1336 node->next_needed = NULL; in cgraph_expand_all_functions()
1337 node->output = 0; in cgraph_expand_all_functions()
1338 node->lowered = DECL_STRUCT_FUNCTION (node->decl)->cfg != NULL; in cgraph_expand_all_functions()
1339 cgraph_expand_function (node); in cgraph_expand_all_functions()
1449 struct cgraph_node *node; in cgraph_function_and_variable_visibility() local
1452 for (node = cgraph_nodes; node; node = node->next) in cgraph_function_and_variable_visibility()
1454 if (node->reachable in cgraph_function_and_variable_visibility()
1455 && (DECL_COMDAT (node->decl) in cgraph_function_and_variable_visibility()
1457 && TREE_PUBLIC (node->decl) && !DECL_EXTERNAL (node->decl)))) in cgraph_function_and_variable_visibility()
1458 node->local.externally_visible = true; in cgraph_function_and_variable_visibility()
1459 if (!node->local.externally_visible && node->analyzed in cgraph_function_and_variable_visibility()
1460 && !DECL_EXTERNAL (node->decl)) in cgraph_function_and_variable_visibility()
1462 gcc_assert (flag_whole_program || !TREE_PUBLIC (node->decl)); in cgraph_function_and_variable_visibility()
1463 TREE_PUBLIC (node->decl) = 0; in cgraph_function_and_variable_visibility()
1465 node->local.local = (!node->needed in cgraph_function_and_variable_visibility()
1466 && node->analyzed in cgraph_function_and_variable_visibility()
1467 && !DECL_EXTERNAL (node->decl) in cgraph_function_and_variable_visibility()
1468 && !node->local.externally_visible); in cgraph_function_and_variable_visibility()
1494 for (node = cgraph_nodes; node; node = node->next) in cgraph_function_and_variable_visibility()
1495 if (node->local.local) in cgraph_function_and_variable_visibility()
1496 fprintf (cgraph_dump_file, " %s", cgraph_node_name (node)); in cgraph_function_and_variable_visibility()
1499 for (node = cgraph_nodes; node; node = node->next) in cgraph_function_and_variable_visibility()
1500 if (node->local.externally_visible) in cgraph_function_and_variable_visibility()
1501 fprintf (cgraph_dump_file, " %s", cgraph_node_name (node)); in cgraph_function_and_variable_visibility()
1512 struct cgraph_node *node; in cgraph_preserve_function_body_p() local
1518 for (node = cgraph_node (decl); node; node = node->next_clone) in cgraph_preserve_function_body_p()
1519 if (node->global.inlined_to) in cgraph_preserve_function_body_p()
1619 struct cgraph_node *node; in cgraph_optimize() local
1622 for (node = cgraph_nodes; node; node = node->next) in cgraph_optimize()
1623 if (node->analyzed in cgraph_optimize()
1624 && (node->global.inlined_to in cgraph_optimize()
1625 || DECL_SAVED_TREE (node->decl))) in cgraph_optimize()
1628 dump_cgraph_node (stderr, node); in cgraph_optimize()
1895 save_inline_function_body (struct cgraph_node *node) in save_inline_function_body() argument
1899 gcc_assert (node == cgraph_node (node->decl)); in save_inline_function_body()
1901 cgraph_lower_function (node); in save_inline_function_body()
1910 first_clone = cgraph_clone_node (node, node->count, 0, false); in save_inline_function_body()
1919 first_clone = node->next_clone; in save_inline_function_body()
1921 first_clone->decl = copy_node (node->decl); in save_inline_function_body()
1922 node->next_clone = NULL; in save_inline_function_body()
1924 node->inline_decl = first_clone->decl; in save_inline_function_body()
1930 tree_function_versioning (node->decl, first_clone->decl, NULL, true); in save_inline_function_body()
1937 for (node = first_clone->next_clone; node; node = node->next_clone) in save_inline_function_body()
1938 node->decl = first_clone->decl; in save_inline_function_body()