OSDN Git Service

PR c++/27714
[pf3gnuchains/gcc-fork.git] / gcc / ipa-cp.c
index 18d5bc0..3837bfd 100644 (file)
@@ -16,8 +16,8 @@ for more details.
    
 You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING.  If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.  */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA.  */
 
 /* Interprocedural constant propagation.
    The aim of interprocedural constant propagation (IPCP) is to find which 
@@ -352,7 +352,7 @@ static inline void
 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.  */
@@ -853,7 +853,7 @@ ipcp_replace_map_create (enum cvalue_type type, tree parm_tree,
   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 )
     {
@@ -1005,7 +1005,8 @@ ipcp_insert_stage (void)
   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;
@@ -1045,15 +1046,14 @@ ipcp_insert_stage (void)
       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;
@@ -1079,7 +1079,7 @@ ipcp_insert_stage (void)
 }
 
 /* The IPCP driver.  */
-void
+unsigned int
 ipcp_driver (void)
 {
   if (dump_file)
@@ -1117,6 +1117,7 @@ ipcp_driver (void)
   if (dump_file)
     fprintf (dump_file, "\nIPA constant propagation end\n");
   cgraph_remove_unreachable_nodes (true, NULL);
+  return 0;
 }
 
 /* Gate for IPCP optimization.  */