/* Control flow graph manipulation code for GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GCC.
#include "output.h"
#include "function.h"
#include "except.h"
-#include "toplev.h"
+#include "diagnostic-core.h"
#include "tm_p.h"
#include "obstack.h"
#include "timevar.h"
init_flow (struct function *the_fun)
{
if (!the_fun->cfg)
- the_fun->cfg = GGC_CNEW (struct control_flow_graph);
+ the_fun->cfg = ggc_alloc_cleared_control_flow_graph ();
n_edges_for_function (the_fun) = 0;
ENTRY_BLOCK_PTR_FOR_FUNCTION (the_fun)
- = GGC_CNEW (struct basic_block_def);
+ = ggc_alloc_cleared_basic_block_def ();
ENTRY_BLOCK_PTR_FOR_FUNCTION (the_fun)->index = ENTRY_BLOCK;
EXIT_BLOCK_PTR_FOR_FUNCTION (the_fun)
- = GGC_CNEW (struct basic_block_def);
+ = ggc_alloc_cleared_basic_block_def ();
EXIT_BLOCK_PTR_FOR_FUNCTION (the_fun)->index = EXIT_BLOCK;
ENTRY_BLOCK_PTR_FOR_FUNCTION (the_fun)->next_bb
= EXIT_BLOCK_PTR_FOR_FUNCTION (the_fun);
alloc_block (void)
{
basic_block bb;
- bb = GGC_CNEW (struct basic_block_def);
+ bb = ggc_alloc_cleared_basic_block_def ();
return bb;
}
unchecked_make_edge (basic_block src, basic_block dst, int flags)
{
edge e;
- e = GGC_CNEW (struct edge_def);
+ e = ggc_alloc_cleared_edge_def ();
n_edges++;
e->src = src;
if (s->probability > REG_BR_PROB_BASE)
s->probability = REG_BR_PROB_BASE;
s->count += e->count;
- remove_edge (e);
redirect_edge_var_map_dup (s, e);
+ remove_edge (e);
e = s;
}
else
stream. This function is designed to be used from within the
debugger. */
-void
+DEBUG_FUNCTION void
debug_regset (regset r)
{
dump_regset (r, stderr);
putc ('\n', file);
}
-void
+DEBUG_FUNCTION void
debug_flow_info (void)
{
dump_flow_info (stderr, TDF_DETAILS);
/* Allocate a memory block of SIZE as BB->aux. The obstack must
be first initialized by alloc_aux_for_blocks. */
-inline void
+static void
alloc_aux_for_block (basic_block bb, int size)
{
/* Verify that aux field is clear. */
{
basic_block bb;
- FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
+ FOR_ALL_BB (bb)
alloc_aux_for_block (bb, size);
}
}
{
basic_block bb;
- FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
+ FOR_ALL_BB (bb)
bb->aux = NULL;
}
/* Allocate a memory edge of SIZE as BB->aux. The obstack must
be first initialized by alloc_aux_for_edges. */
-inline void
+static void
alloc_aux_for_edge (edge e, int size)
{
/* Verify that aux field is clear. */
clear_aux_for_edges ();
}
-void
+DEBUG_FUNCTION void
debug_bb (basic_block bb)
{
dump_bb (bb, stderr, 0);
}
-basic_block
+DEBUG_FUNCTION basic_block
debug_bb_n (int n)
{
basic_block bb = BASIC_BLOCK (n);