summaryrefslogtreecommitdiff
path: root/opt
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2012-06-14 00:12:35 -0400
committerOri Bernstein <ori@eigenstate.org>2012-06-14 00:12:35 -0400
commit6a7f16a2b8e1be9639a79726d8195fc6cfae27f1 (patch)
tree753a599dd4f47e946892e7ce876fa38294cf80e1 /opt
parentc910735b4604acd14bffe223d8fc378b9d6f417b (diff)
downloadmc-6a7f16a2b8e1be9639a79726d8195fc6cfae27f1.tar.gz
Move towards generating flow graphs properly.
Diffstat (limited to 'opt')
-rw-r--r--opt/cfg.c20
-rw-r--r--opt/opt.h4
2 files changed, 12 insertions, 12 deletions
diff --git a/opt/cfg.c b/opt/cfg.c
index ec09216..209a1fa 100644
--- a/opt/cfg.c
+++ b/opt/cfg.c
@@ -21,8 +21,8 @@ static Bb *mkbb(Cfg *cfg)
bb = zalloc(sizeof(Bb));
bb->id = nextbbid++;
- bb->in = mkbs();
- bb->out = mkbs();
+ bb->pred = mkbs();
+ bb->succ = mkbs();
lappend(&cfg->bb, &cfg->nbb, bb);
return bb;
}
@@ -101,15 +101,15 @@ Cfg *mkcfg(Node **nl, size_t nn)
targ = htget(cfg->lblmap, a->lbl.name);
if (!targ)
die("No bb with label %s", a->lbl.name);
- bsput(bb->out, targ->id);
- bsput(targ->in, bb->id);
+ bsput(bb->succ, targ->id);
+ bsput(targ->pred, bb->id);
}
if (b) {
targ = htget(cfg->lblmap, b->lbl.name);
if (!targ)
die("No bb with label %s", b->lbl.name);
- bsput(bb->out, targ->id);
- bsput(targ->in, bb->id);
+ bsput(bb->succ, targ->id);
+ bsput(targ->pred, bb->id);
}
}
return cfg;
@@ -134,8 +134,8 @@ void dumpcfg(Cfg *cfg, FILE *fd)
/* in edges */
fprintf(fd, "In: ");
sep = "";
- for (i = 0; i < bsmax(bb->in); i++) {
- if (bshas(bb->in, i)) {
+ for (i = 0; i < bsmax(bb->pred); i++) {
+ if (bshas(bb->pred, i)) {
fprintf(fd, "%s%zd", sep, i);
sep = ",";
}
@@ -145,8 +145,8 @@ void dumpcfg(Cfg *cfg, FILE *fd)
/* out edges */
fprintf(fd, "Out: ");
sep = "";
- for (i = 0; i < bsmax(bb->out); i++) {
- if (bshas(bb->out, i)) {
+ for (i = 0; i < bsmax(bb->succ); i++) {
+ if (bshas(bb->succ, i)) {
fprintf(fd, "%s%zd", sep, i);
sep = ",";
}
diff --git a/opt/opt.h b/opt/opt.h
index d875dbd..d8b2922 100644
--- a/opt/opt.h
+++ b/opt/opt.h
@@ -19,8 +19,8 @@ struct Bb {
size_t nlbls;
Node **nl;
size_t nnl;
- Bitset *in;
- Bitset *out;
+ Bitset *pred;
+ Bitset *succ;
};
/* Takes a reduced block, and returns a flow graph. */