ipcp_formal_create (struct cgraph_node *mt)
{
IPA_NODE_REF (mt)->ipcp_cval =
- xcalloc (ipa_method_formal_count (mt), sizeof (struct ipcp_formal));
+ XCNEWVEC (struct ipcp_formal, ipa_method_formal_count (mt));
}
/* Set cval structure of I-th formal of MT to CVAL. */
struct ipa_replace_map *replace_map;
tree const_val;
- replace_map = xcalloc (1, sizeof (struct ipa_replace_map));
+ replace_map = XCNEW (struct ipa_replace_map);
gcc_assert (ipcp_type_is_const (type));
if (type == CONST_VALUE_REF )
{
struct cgraph_node *node, *node1 = NULL;
int i, const_param;
union parameter_info *cvalue;
- varray_type redirect_callers, replace_trees;
+ VEC(cgraph_edge_p,heap) *redirect_callers;
+ varray_type replace_trees;
struct cgraph_edge *cs;
int node_callers, count;
tree parm_tree;
node_callers = 0;
for (cs = node->callers; cs != NULL; cs = cs->next_caller)
node_callers++;
- VARRAY_GENERIC_PTR_INIT (redirect_callers, node_callers,
- "redirect_callers");
+ redirect_callers = VEC_alloc (cgraph_edge_p, heap, node_callers);
for (cs = node->callers; cs != NULL; cs = cs->next_caller)
- VARRAY_PUSH_GENERIC_PTR (redirect_callers, cs);
+ VEC_quick_push (cgraph_edge_p, redirect_callers, cs);
/* Redirecting all the callers of the node to the
new versioned node. */
node1 =
cgraph_function_versioning (node, redirect_callers, replace_trees);
- VARRAY_CLEAR (redirect_callers);
+ VEC_free (cgraph_edge_p, heap, redirect_callers);
VARRAY_CLEAR (replace_trees);
if (node1 == NULL)
continue;
}
/* The IPCP driver. */
-void
+unsigned int
ipcp_driver (void)
{
if (dump_file)
if (dump_file)
fprintf (dump_file, "\nIPA constant propagation end\n");
cgraph_remove_unreachable_nodes (true, NULL);
+ return 0;
}
/* Gate for IPCP optimization. */