+2016-07-26 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
+
+ * tree-outof-ssa.c (struct elim_graph): Remove typedef.
+ (new_elim_graph): Adjust.
+ (clear_elim_graph): Likewise.
+ (delete_elim_graph): Likewise.
+ (elim_graph_size): Likewise.
+ (elim_graph_add_node): Likewise.
+ (elim_graph_add_edge): Likewise.
+ (elim_graph_remove_succ_edge): Likewise.
+ (eliminate_name): Likewise.
+ (eliminate_build): Likewise.
+ (elim_forward): Likewise.
+ (elim_unvisited_predecessor): Likewise.
+ (elim_backward): Likewise.
+ (elim_create): Likewise.
+ (eliminate_phi): Likewise.
+ (expand_phi_nodes): Likewise.
+
2016-07-26 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* bt-load.c (compute_out): Use auto_sbitmap class.
rarely more than 6, and in the bootstrap of gcc, the maximum number
of nodes encountered was 12. */
-typedef struct _elim_graph {
+struct elim_graph
+{
/* Size of the elimination vectors. */
int size;
/* Source locations for any constant copies. */
vec<source_location> copy_locus;
-} *elim_graph;
+};
/* For an edge E find out a good source location to associate with
/* Create an elimination graph with SIZE nodes and associated data
structures. */
-static elim_graph
+static elim_graph *
new_elim_graph (int size)
{
- elim_graph g = (elim_graph) xmalloc (sizeof (struct _elim_graph));
+ elim_graph *g = (elim_graph *) xmalloc (sizeof (struct elim_graph));
g->nodes.create (30);
g->const_dests.create (20);
/* Empty elimination graph G. */
static inline void
-clear_elim_graph (elim_graph g)
+clear_elim_graph (elim_graph *g)
{
g->nodes.truncate (0);
g->edge_list.truncate (0);
/* Delete elimination graph G. */
static inline void
-delete_elim_graph (elim_graph g)
+delete_elim_graph (elim_graph *g)
{
sbitmap_free (g->visited);
g->stack.release ();
/* Return the number of nodes in graph G. */
static inline int
-elim_graph_size (elim_graph g)
+elim_graph_size (elim_graph *g)
{
return g->nodes.length ();
}
/* Add NODE to graph G, if it doesn't exist already. */
static inline void
-elim_graph_add_node (elim_graph g, int node)
+elim_graph_add_node (elim_graph *g, int node)
{
int x;
int t;
/* Add the edge PRED->SUCC to graph G. */
static inline void
-elim_graph_add_edge (elim_graph g, int pred, int succ, source_location locus)
+elim_graph_add_edge (elim_graph *g, int pred, int succ, source_location locus)
{
g->edge_list.safe_push (pred);
g->edge_list.safe_push (succ);
return the successor node. -1 is returned if there is no such edge. */
static inline int
-elim_graph_remove_succ_edge (elim_graph g, int node, source_location *locus)
+elim_graph_remove_succ_edge (elim_graph *g, int node, source_location *locus)
{
int y;
unsigned x;
/* Add T to elimination graph G. */
static inline void
-eliminate_name (elim_graph g, int T)
+eliminate_name (elim_graph *g, int T)
{
elim_graph_add_node (g, T);
}
G->e. */
static void
-eliminate_build (elim_graph g)
+eliminate_build (elim_graph *g)
{
tree Ti;
int p0, pi;
/* Push successors of T onto the elimination stack for G. */
static void
-elim_forward (elim_graph g, int T)
+elim_forward (elim_graph *g, int T)
{
int S;
source_location locus;
/* Return 1 if there unvisited predecessors of T in graph G. */
static int
-elim_unvisited_predecessor (elim_graph g, int T)
+elim_unvisited_predecessor (elim_graph *g, int T)
{
int P;
source_location locus;
/* Process predecessors first, and insert a copy. */
static void
-elim_backward (elim_graph g, int T)
+elim_backward (elim_graph *g, int T)
{
int P;
source_location locus;
region, and create a temporary to break the cycle if one is found. */
static void
-elim_create (elim_graph g, int T)
+elim_create (elim_graph *g, int T)
{
int P, S;
source_location locus;
/* Eliminate all the phi nodes on edge E in graph G. */
static void
-eliminate_phi (edge e, elim_graph g)
+eliminate_phi (edge e, elim_graph *g)
{
int x;
expand_phi_nodes (struct ssaexpand *sa)
{
basic_block bb;
- elim_graph g = new_elim_graph (sa->map->num_partitions);
+ elim_graph *g = new_elim_graph (sa->map->num_partitions);
g->map = sa->map;
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR_FOR_FN (cfun)->next_bb,