diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-12-05 02:09:48 -0500 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-12-12 22:16:57 -0500 |
commit | 12f9d16c7b000030ce332778fa4d51d455ae819f (patch) | |
tree | 6adbe9f3cc7e79e5d1616d9faf4650f5a2e3ba58 /util.c | |
parent | 2380b5786a515af7149f7648d9e9c22a663e3a9c (diff) | |
download | roux-12f9d16c7b000030ce332778fa4d51d455ae819f.tar.gz |
create cfg.c for cfg-related functions
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/util.c b/util.c index 63a1202..5c54c12 100644 --- a/util.c +++ b/util.c @@ -87,47 +87,6 @@ freeall() nptr = 1; } -Blk * -blknew() -{ - static Blk z; - Blk *b; - - b = alloc(sizeof *b); - *b = z; - return b; -} - -void -blkdel(Blk *b) -{ - Blk *s, **ps, *succ[3]; - Phi *p; - uint a; - - succ[0] = b->s1; - succ[1] = b->s2 == b->s1 ? 0 : b->s2; - succ[2] = 0; - for (ps=succ; (s=*ps); ps++) { - for (p=s->phi; p; p=p->link) { - for (a=0; p->blk[a]!=b; a++) - assert(a+1<p->narg); - p->narg--; - memmove(&p->blk[a], &p->blk[a+1], - sizeof p->blk[0] * (p->narg-a)); - memmove(&p->arg[a], &p->arg[a+1], - sizeof p->arg[0] * (p->narg-a)); - } - if (s->npred != 0) { - for (a=0; s->pred[a]!=b; a++) - assert(a+1<s->npred); - s->npred--; - memmove(&s->pred[a], &s->pred[a+1], - sizeof s->pred[0] * (s->npred-a)); - } - } -} - void emit(int op, int k, Ref to, Ref arg0, Ref arg1) { |