X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fipa.c;h=0e2cb2db9eb8596a276fe49fa4a27d2b176753dc;hb=abfd653784390498e51dd5b323f66f78a83be734;hp=9997f6cb79f8b5c38998e7ca0b194e972ed5f8ee;hpb=09a2e41255c0a0440f4ed6776545bbccc06a1e04;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/ipa.c b/gcc/ipa.c index 9997f6cb79f..0e2cb2db9eb 100644 --- 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 +. */ #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 */ + } };