summaryrefslogtreecommitdiff
path: root/6
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-12-28 21:57:43 -0800
committerOri Bernstein <ori@eigenstate.org>2017-12-28 21:57:43 -0800
commit38483fdfd64a3f069e799c41581f227b3880f0c2 (patch)
tree5b25f0361211d65a660743e28273185c80cfef55 /6
parent75ddf8edac3ea43fee7b7bdafe9e7799fb3571aa (diff)
downloadmc-38483fdfd64a3f069e799c41581f227b3880f0c2.tar.gz
Minor cleanup.
Diffstat (limited to '6')
-rw-r--r--6/simp.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/6/simp.c b/6/simp.c
index 323f761..b43a083 100644
--- a/6/simp.c
+++ b/6/simp.c
@@ -288,15 +288,6 @@ temp(Simp *simp, Node *e)
return t;
}
-static void
-cjmp(Simp *s, Node *cond, Node *iftrue, Node *iffalse)
-{
- Node *jmp;
-
- jmp = mkexpr(cond->loc, Ocjmp, cond, iftrue, iffalse, NULL);
- append(s, jmp);
-}
-
static Node *
slicelen(Simp *s, Node *sl)
{
@@ -446,7 +437,7 @@ membaddr(Simp *s, Node *n)
static void
checkidx(Simp *s, Op op, Node *len, Node *idx)
{
- Node *cmp, *die;
+ Node *cmp, *die, *jmp;
Node *ok, *fail;
if (!len)
@@ -460,7 +451,8 @@ checkidx(Simp *s, Op op, Node *len, Node *idx)
die->expr.type = mktype(len->loc, Tyvoid);
/* insert them */
- cjmp(s, cmp, ok, fail);
+ jmp = mkexpr(idx->loc, Ocjmp, cmp, ok, fail, NULL);
+ append(s, jmp);
append(s, fail);
append(s, die);
append(s, ok);