summaryrefslogtreecommitdiff
path: root/mi
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-12-14 23:27:06 -0800
committerOri Bernstein <ori@eigenstate.org>2015-12-14 23:27:06 -0800
commitf5a1454387098fa3abb7bf95f4123e1fac85cb7d (patch)
treec5410430516ebf119d8139c8b599732cbd545d51 /mi
parent607b2662bc1093833bfea0c49236f098271cf348 (diff)
downloadmc-f5a1454387098fa3abb7bf95f4123e1fac85cb7d.tar.gz
Initial support for void as an expression.
Diffstat (limited to 'mi')
-rw-r--r--mi/dfcheck.c4
-rw-r--r--mi/match.c1
2 files changed, 3 insertions, 2 deletions
diff --git a/mi/dfcheck.c b/mi/dfcheck.c
index 392c8dd..a785fc3 100644
--- a/mi/dfcheck.c
+++ b/mi/dfcheck.c
@@ -27,7 +27,7 @@ static void checkundef(Node *n, Reaching *r, Bitset *reach, Bitset *kill)
return;
for (j = 0; j < r->ndefs[did]; j++) {
t = tybase(exprtype(n));
- if (t->type == Tystruct || t->type == Tyunion || t->type == Tyarray || t->type == Tytuple)
+ if (t->type == Tystruct || t->type == Tyunion || t->type == Tyarray || t->type == Tytuple || t->type == Tyvoid)
continue;
if (bshas(kill, r->defs[did][j]))
continue;
@@ -35,7 +35,7 @@ static void checkundef(Node *n, Reaching *r, Bitset *reach, Bitset *kill)
continue;
def = nodes[r->defs[did][j]];
if (exprop(def) == Oundef)
- fatal(n, "%s used before definition [%d]", namestr(n->expr.args[0]), (int)did);
+ fatal(n, "%s used before definition", namestr(n->expr.args[0]));
}
} else {
switch (exprop(n)) {
diff --git a/mi/match.c b/mi/match.c
index f2c2c9c..bfca0a6 100644
--- a/mi/match.c
+++ b/mi/match.c
@@ -764,6 +764,7 @@ void dtreedumplit(FILE *fd, Dtree *dt, Node *n, size_t depth)
s = lblstr(dt->lbl);
switch (n->lit.littype) {
+ case Lvoid: findentf(fd, depth, "%s: Lvoid\n"); break;
case Lchr: findentf(fd, depth, "%s: Lchr %c\n", s, n->lit.chrval); break;
case Lbool: findentf(fd, depth, "%s: Lbool %s\n", s, n->lit.boolval ? "true" : "false"); break;
case Lint: findentf(fd, depth, "%s: Lint %llu\n", s, n->lit.intval); break;