OSDN Git Service

* id.po: Update.
[pf3gnuchains/gcc-fork.git] / gcc / ipa.c
index 9997f6c..0e2cb2d 100644 (file)
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -1,11 +1,12 @@
 /* Basic IPA optimizations and utilities.
-   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.  
+   Copyright (C) 2003, 2004, 2005, 2007, 2008 Free Software Foundation,
+   Inc.
 
 This file is part of GCC.
 
 GCC is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
+Software Foundation; either version 3, or (at your option) any later
 version.
 
 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
@@ -14,9 +15,8 @@ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 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, 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301, USA.  */
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
 
 #include "config.h"
 #include "system.h"
@@ -43,7 +43,7 @@ cgraph_postorder (struct cgraph_node **order)
   /* We have to deal with cycles nicely, so use a depth first traversal
      output algorithm.  Ignore the fact that some functions won't need
      to be output and put them into order as well, so we get dependencies
-     right through intline functions.  */
+     right through inline functions.  */
   for (node = cgraph_nodes; node; node = node->next)
     node->aux = NULL;
   for (node = cgraph_nodes; node; node = node->next)
@@ -58,7 +58,7 @@ cgraph_postorder (struct cgraph_node **order)
          {
            while (node2->aux != &last)
              {
-               edge = node2->aux;
+               edge = (struct cgraph_edge *) node2->aux;
                if (edge->next_caller)
                  node2->aux = edge->next_caller;
                else
@@ -98,10 +98,9 @@ cgraph_postorder (struct cgraph_node **order)
 bool
 cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
 {
-  struct cgraph_node *first = (void *) 1;
+  struct cgraph_node *first = (struct cgraph_node *) (void *) 1;
   struct cgraph_node *node, *next;
   bool changed = false;
-  int insns = 0;
 
 #ifdef ENABLE_CHECKING
   verify_cgraph ();
@@ -131,7 +130,7 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
     {
       struct cgraph_edge *e;
       node = first;
-      first = first->aux;
+      first = (struct cgraph_node *) first->aux;
 
       for (e = node->callees; e; e = e->next_callee)
        if (!e->callee->aux
@@ -158,14 +157,7 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
       next = node->next;
       if (!node->aux)
        {
-         int local_insns;
-         tree decl = node->decl;
-
           node->global.inlined_to = NULL;
-         if (DECL_STRUCT_FUNCTION (decl))
-           local_insns = node->local.self_insns;
-         else
-           local_insns = 0;
          if (file)
            fprintf (file, " %s", cgraph_node_name (node));
          if (!node->analyzed || !DECL_EXTERNAL (node->decl)
@@ -193,19 +185,16 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
                    }
                  cgraph_node_remove_callees (node);
                  node->analyzed = false;
+                 node->local.inlinable = false;
                }
              else
                cgraph_remove_node (node);
            }
-         if (!DECL_SAVED_TREE (decl))
-           insns += local_insns;
          changed = true;
        }
     }
   for (node = cgraph_nodes; node; node = node->next)
     node->aux = NULL;
-  if (file)
-    fprintf (file, "\nReclaimed %i insns", insns);
 #ifdef ENABLE_CHECKING
   verify_cgraph ();
 #endif
@@ -278,8 +267,10 @@ function_and_variable_visibility (void)
   return 0;
 }
 
-struct tree_opt_pass pass_ipa_function_and_variable_visibility = 
+struct simple_ipa_opt_pass pass_ipa_function_and_variable_visibility = 
 {
+ {
+  SIMPLE_IPA_PASS,
   "visibility",                                /* name */
   NULL,                                        /* gate */
   function_and_variable_visibility,    /* execute */
@@ -291,6 +282,6 @@ struct tree_opt_pass pass_ipa_function_and_variable_visibility =
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
-  TODO_remove_functions | TODO_dump_cgraph,/* todo_flags_finish */
-  0                                    /* letter */
+  TODO_remove_functions | TODO_dump_cgraph/* todo_flags_finish */
+ }
 };