/* 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
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"
/* 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)
{
while (node2->aux != &last)
{
- edge = node2->aux;
+ edge = (struct cgraph_edge *) node2->aux;
if (edge->next_caller)
node2->aux = edge->next_caller;
else
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 ();
{
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
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)
}
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
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 */
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 */
+ }
};