OSDN Git Service

* ChangeLog: Update entry.
[pf3gnuchains/gcc-fork.git] / gcc / cgraphunit.c
index 22b3381..1effef6 100644 (file)
@@ -1,5 +1,5 @@
 /* Callgraph based intraprocedural optimizations.
-   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
    Contributed by Jan Hubicka
 
 This file is part of GCC.
@@ -346,8 +346,17 @@ cgraph_finalize_function (tree decl, bool nested)
       memset (&node->rtl, 0, sizeof (node->rtl));
       node->analyzed = false;
       node->local.redefined_extern_inline = true;
-      while (node->callees)
-       cgraph_remove_edge (node->callees);
+
+      if (!flag_unit_at_a_time)
+       {
+         struct cgraph_node *n;
+
+         for (n = cgraph_nodes; n; n = n->next)
+           if (n->global.inlined_to == node)
+             cgraph_remove_node (n);
+       }
+
+      cgraph_node_remove_callees (node);
 
       /* We may need to re-queue the node for assembling in case
          we already proceeded it and ignored as not needed.  */
@@ -833,8 +842,7 @@ cgraph_expand_function (struct cgraph_node *node)
       DECL_INITIAL (node->decl) = error_mark_node;
       /* Eliminate all call edges.  This is important so the call_expr no longer
         points to the dead function body.  */
-      while (node->callees)
-       cgraph_remove_edge (node->callees);
+      cgraph_node_remove_callees (node);
     }
 }
 
@@ -996,8 +1004,7 @@ cgraph_remove_unreachable_nodes (void)
                      DECL_STRUCT_FUNCTION (node->decl) = NULL;
                      DECL_INITIAL (node->decl) = error_mark_node;
                    }
-                 while (node->callees)
-                   cgraph_remove_edge (node->callees);
+                 cgraph_node_remove_callees (node);
                  node->analyzed = false;
                }
              else