firm isa implementation
[libfirm] / ir / be / beifg.h
1 /**
2  * @file   beifg.h
3  * @date   18.11.2005
4  * @author Sebastian Hack
5  *
6  * Copyright (C) 2005 Universitaet Karlsruhe
7  * Released under the GPL
8  */
9
10 #ifndef _BEIFG_H
11 #define _BEIFG_H
12
13 #include "obst.h"
14 #include "bechordal_t.h"
15
16 typedef struct _be_ifg_impl_t   be_ifg_impl_t;
17 typedef struct _be_ifg_t                                be_ifg_t;
18
19 struct _be_ifg_impl_t {
20         void (*free)(void *self);
21
22         int (*connected)(void *self, const ir_node *a, const ir_node *b);
23         int (*neighbours_arr)(void *self, const ir_node *irn, ir_node **arr, size_t n);
24         int (*neighbours_obst)(void *self, const ir_node *irn, struct obstack *obst);
25         int (*degree)(void *self, const ir_node *irn);
26 };
27
28 struct _be_ifg_t {
29         const be_ifg_impl_t *impl;
30 };
31
32 #define be_ifg_free(self)                                                                               ((self)->impl->free(self))
33 #define be_ifg_connected(self,a,b)                                              ((self)->impl->connected(self, a, b))
34 #define be_ifg_neighbours_arr(self,irn,arr,n)   ((self)->impl->neighbours_arr(self, irn, arr, n))
35 #define be_ifg_neighbours_obst(self,irn,obst)   ((self)->impl->neighbours_arr(self, irn, obst))
36 #define be_ifg_degree(self,irn)                                                         ((self)->impl->degree(self, irn))
37
38 be_ifg_t *be_ifg_std_new(const be_chordal_env_t *env);
39
40 #endif /* _BEIFG_H */