2 * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
6 * This file may be distributed and/or modified under the terms of the
7 * GNU General Public License version 2 as published by the Free Software
8 * Foundation and appearing in the file LICENSE.GPL included in the
9 * packaging of this file.
11 * Licensees holding valid libFirm Professional Edition licenses may use
12 * this file in accordance with the libFirm Commercial License.
13 * Agreement provided with the Software.
15 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * @author Sebastian Hack
25 * Copyright (C) 2005 Universitaet Karlsruhe
26 * Released under the GPL
32 #include "becopyopt.h"
34 #include "firm_types.h"
36 typedef struct _be_ifg_impl_t be_ifg_impl_t;
37 typedef struct _be_ifg_t be_ifg_t;
39 #define be_ifg_nodes_iter_alloca(self) (alloca(be_ifg_nodes_iter_size(self)))
40 #define be_ifg_neighbours_iter_alloca(self) (alloca(be_ifg_neighbours_iter_size(self)))
41 #define be_ifg_cliques_iter_alloca(self) (alloca(be_ifg_cliques_iter_size(self)))
43 size_t (be_ifg_nodes_iter_size)(const be_ifg_t *self);
44 size_t (be_ifg_neighbours_iter_size)(const be_ifg_t *self);
45 size_t (be_ifg_cliques_iter_size)(const be_ifg_t *self);
46 void (be_ifg_free)(be_ifg_t *self);
47 int (be_ifg_connected)(const be_ifg_t *self, const ir_node *a, const ir_node *b);
48 ir_node *(be_ifg_neighbours_begin)(const be_ifg_t *self, void *iter, const ir_node *irn);
49 ir_node *(be_ifg_neighbours_next)(const be_ifg_t *self, void *iter);
50 void (be_ifg_neighbours_break)(const be_ifg_t *self, void *iter);
51 ir_node *(be_ifg_nodes_begin)(const be_ifg_t *self, void *iter);
52 ir_node *(be_ifg_nodes_next)(const be_ifg_t *self, void *iter);
53 void (be_ifg_nodes_break)(const be_ifg_t *self, void *iter);
54 int (be_ifg_cliques_begin)(const be_ifg_t *self, void *iter, ir_node **buf);
55 int (be_ifg_cliques_next)(const be_ifg_t *self, void *iter);
56 void (be_ifg_cliques_break)(const be_ifg_t *self, void *iter);
57 int (be_ifg_degree)(const be_ifg_t *self, const ir_node *irn);
59 #define be_ifg_foreach_neighbour(self, iter, irn, pos) \
60 for(pos = be_ifg_neighbours_begin(self, iter, irn); (pos); pos = be_ifg_neighbours_next(self, iter))
62 #define be_ifg_foreach_node(self, iter, pos) \
63 for(pos = be_ifg_nodes_begin(self, iter); (pos); pos = be_ifg_nodes_next(self, iter))
65 #define be_ifg_foreach_clique(self, iter, buf, count) \
66 for(*(count) = be_ifg_cliques_begin(self, iter, buf); \
68 *(count) = be_ifg_cliques_next(self, iter))
76 void be_ifg_stat(be_irg_t *birg, be_ifg_t *ifg, be_ifg_stat_t *stat);
78 be_ifg_t *be_create_ifg(const be_chordal_env_t *env);
82 | _ \ _ _ _ __ ___ _ __ (_)_ __ __ _
83 | | | | | | | '_ ` _ \| '_ \| | '_ \ / _` |
84 | |_| | |_| | | | | | | |_) | | | | | (_| |
85 |____/ \__,_|_| |_| |_| .__/|_|_| |_|\__, |
89 typedef struct _be_ifg_dump_dot_cb_t {
90 int (*is_dump_node)(void *self, ir_node *irn);
91 void (*graph_attr)(FILE *f, void *self);
92 void (*node_attr)(FILE *f, void *self, ir_node *irn);
93 void (*edge_attr)(FILE *f, void *self, ir_node *from, ir_node *to);
94 void (*at_begin)(FILE *file, void *self);
95 void (*at_end)(FILE *file, void *self);
96 } be_ifg_dump_dot_cb_t;
98 void be_ifg_dump_dot(be_ifg_t *ifg, ir_graph *irg, FILE *file, const be_ifg_dump_dot_cb_t *cb, void *self);
99 void be_ifg_check_sorted(const be_ifg_t *ifg);
100 void be_ifg_check_sorted_to_file(const be_ifg_t *ifg, FILE *f);
101 void be_ifg_check_performance(be_chordal_env_t *chordal_env);
104 #endif /* _BEIFG_H */