summaryrefslogtreecommitdiff
path: root/opt/opt.h
blob: d8b29223db9abef690f71e37bf9ddbcbcb9259a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
typedef struct Cfg Cfg;
typedef struct Bb Bb;

struct  Cfg {
    Bb **bb;
    size_t nbb;

    /* for building bb */
    Htab *lblmap; /* label => Bb mapping */
    Node **fixjmp;
    size_t nfixjmp;
    Bb **fixblk;
    size_t nfixblk;
};

struct Bb {
    int id;
    char **lbls;
    size_t nlbls;
    Node **nl;
    size_t nnl;
    Bitset *pred;
    Bitset *succ;
};

/* Takes a reduced block, and returns a flow graph. */
Cfg *mkcfg(Node **nl, size_t nn);
void dumpcfg(Cfg *c, FILE *fd);
void flow(Cfg *cfg);