2016-10-02 15:50:34 +00:00
|
|
|
#ifndef BASICBLOCK_H
|
|
|
|
#define BASICBLOCK_H
|
|
|
|
|
2016-10-07 22:21:23 +00:00
|
|
|
struct phi
|
|
|
|
{
|
|
|
|
struct basicblock* prev; /* Predecessor that this phi is referring to */
|
|
|
|
struct ir* ir; /* IR of variable definition */
|
|
|
|
};
|
|
|
|
|
2016-10-02 15:50:34 +00:00
|
|
|
struct basicblock
|
|
|
|
{
|
|
|
|
const char* name;
|
|
|
|
ARRAYOF(struct em) ems;
|
|
|
|
ARRAYOF(struct ir) irs;
|
|
|
|
ARRAYOF(struct hop) hops;
|
|
|
|
|
|
|
|
ARRAYOF(struct basicblock) prevs;
|
|
|
|
ARRAYOF(struct basicblock) nexts;
|
2016-10-05 21:52:54 +00:00
|
|
|
int order; /* used by dominance graph code */
|
2016-10-02 15:50:34 +00:00
|
|
|
|
2016-10-07 22:21:23 +00:00
|
|
|
PMAPOF(struct vreg, struct phi) phis;
|
|
|
|
|
|
|
|
/* Used by liveness calculation. */
|
|
|
|
ARRAYOF(struct vreg) liveins;
|
|
|
|
ARRAYOF(struct vreg) liveouts;
|
2016-10-04 19:58:31 +00:00
|
|
|
|
2016-10-02 15:50:34 +00:00
|
|
|
bool is_fake : 1;
|
|
|
|
bool is_root : 1;
|
|
|
|
bool is_terminated : 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern void bb_init(void);
|
|
|
|
extern struct basicblock* bb_get(const char* name);
|
|
|
|
extern void bb_alias(struct basicblock* block, const char* name);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2016-10-05 19:07:29 +00:00
|
|
|
/* vim: set sw=4 ts=4 expandtab : */
|
|
|
|
|