diff options
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r-- | gcc/ipa.c | 50 |
1 files changed, 25 insertions, 25 deletions
@@ -447,7 +447,7 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file) #endif /* If we removed something, perhaps profile could be improved. */ - if (changed && optimize && inline_edge_summary_vec) + if (changed && optimize && inline_edge_summary_vec.exists ()) FOR_EACH_DEFINED_FUNCTION (node) cgraph_propagate_frequency (node); @@ -735,16 +735,16 @@ function_and_variable_visibility (bool whole_program) alias_pair *p; /* Discover aliased nodes. */ - FOR_EACH_VEC_ELT (alias_pair, alias_pairs, i, p) + FOR_EACH_VEC_SAFE_ELT (alias_pairs, i, p) { if (dump_file) - fprintf (dump_file, "Alias %s->%s", - IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (p->decl)), - IDENTIFIER_POINTER (p->target)); + fprintf (dump_file, "Alias %s->%s", + IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (p->decl)), + IDENTIFIER_POINTER (p->target)); if ((node = cgraph_node_for_asm (p->target)) != NULL - && !DECL_EXTERNAL (node->symbol.decl)) - { + && !DECL_EXTERNAL (node->symbol.decl)) + { if (!node->analyzed) continue; cgraph_mark_force_output_node (node); @@ -752,18 +752,18 @@ function_and_variable_visibility (bool whole_program) if (dump_file) fprintf (dump_file, " node %s/%i", cgraph_node_name (node), node->uid); - } + } else if ((vnode = varpool_node_for_asm (p->target)) != NULL && !DECL_EXTERNAL (vnode->symbol.decl)) - { + { vnode->symbol.force_output = 1; pointer_set_insert (aliased_vnodes, vnode); if (dump_file) fprintf (dump_file, " varpool node %s", varpool_node_name (vnode)); - } + } if (dump_file) - fprintf (dump_file, "\n"); + fprintf (dump_file, "\n"); } FOR_EACH_FUNCTION (node) @@ -1215,9 +1215,9 @@ cgraph_build_static_cdtor (char which, tree body, int priority) } /* A vector of FUNCTION_DECLs declared as static constructors. */ -static VEC(tree, heap) *static_ctors; +static vec<tree> static_ctors; /* A vector of FUNCTION_DECLs declared as static destructors. */ -static VEC(tree, heap) *static_dtors; +static vec<tree> static_dtors; /* When target does not have ctors and dtors, we call all constructor and destructor by special initialization/destruction function @@ -1230,9 +1230,9 @@ static void record_cdtor_fn (struct cgraph_node *node) { if (DECL_STATIC_CONSTRUCTOR (node->symbol.decl)) - VEC_safe_push (tree, heap, static_ctors, node->symbol.decl); + static_ctors.safe_push (node->symbol.decl); if (DECL_STATIC_DESTRUCTOR (node->symbol.decl)) - VEC_safe_push (tree, heap, static_dtors, node->symbol.decl); + static_dtors.safe_push (node->symbol.decl); node = cgraph_get_node (node->symbol.decl); DECL_DISREGARD_INLINE_LIMITS (node->symbol.decl) = 1; } @@ -1243,10 +1243,10 @@ record_cdtor_fn (struct cgraph_node *node) they are destructors. */ static void -build_cdtor (bool ctor_p, VEC (tree, heap) *cdtors) +build_cdtor (bool ctor_p, vec<tree> cdtors) { size_t i,j; - size_t len = VEC_length (tree, cdtors); + size_t len = cdtors.length (); i = 0; while (i < len) @@ -1261,7 +1261,7 @@ build_cdtor (bool ctor_p, VEC (tree, heap) *cdtors) do { priority_type p; - fn = VEC_index (tree, cdtors, j); + fn = cdtors[j]; p = ctor_p ? DECL_INIT_PRIORITY (fn) : DECL_FINI_PRIORITY (fn); if (j == i) priority = p; @@ -1283,7 +1283,7 @@ build_cdtor (bool ctor_p, VEC (tree, heap) *cdtors) for (;i < j; i++) { tree call; - fn = VEC_index (tree, cdtors, i); + fn = cdtors[i]; call = build_call_expr (fn, 0); if (ctor_p) DECL_STATIC_CONSTRUCTOR (fn) = 0; @@ -1362,17 +1362,17 @@ compare_dtor (const void *p1, const void *p2) static void build_cdtor_fns (void) { - if (!VEC_empty (tree, static_ctors)) + if (!static_ctors.is_empty ()) { gcc_assert (!targetm.have_ctors_dtors || in_lto_p); - VEC_qsort (tree, static_ctors, compare_ctor); + static_ctors.qsort (compare_ctor); build_cdtor (/*ctor_p=*/true, static_ctors); } - if (!VEC_empty (tree, static_dtors)) + if (!static_dtors.is_empty ()) { gcc_assert (!targetm.have_ctors_dtors || in_lto_p); - VEC_qsort (tree, static_dtors, compare_dtor); + static_dtors.qsort (compare_dtor); build_cdtor (/*ctor_p=*/false, static_dtors); } } @@ -1392,8 +1392,8 @@ ipa_cdtor_merge (void) || DECL_STATIC_DESTRUCTOR (node->symbol.decl)) record_cdtor_fn (node); build_cdtor_fns (); - VEC_free (tree, heap, static_ctors); - VEC_free (tree, heap, static_dtors); + static_ctors.release (); + static_dtors.release (); return 0; } |