summaryrefslogtreecommitdiff
path: root/parse/stab.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-07-15 14:44:40 -0700
committerOri Bernstein <ori@eigenstate.org>2017-07-15 14:44:40 -0700
commit2fd7aa8d72729ccec6c611fb3586e9c4c7b5e067 (patch)
treebff78a7a88c260d0e20a341274fa28f38cf10ed9 /parse/stab.c
parent357f87c1117edfdf77411781ebfae221a406c454 (diff)
downloadmc-2fd7aa8d72729ccec6c611fb3586e9c4c7b5e067.tar.gz
Use type hashing instead of string hasing in tyenv.
Set the stage for stricter env lookups.
Diffstat (limited to 'parse/stab.c')
-rw-r--r--parse/stab.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/parse/stab.c b/parse/stab.c
index 757dceb..dea101a 100644
--- a/parse/stab.c
+++ b/parse/stab.c
@@ -122,7 +122,7 @@ mkenv()
e = malloc(sizeof(Tyenv));
e->super = NULL;
- e->tab = mkht(strhash, streq);
+ e->tab = mkht(tyhash, tyeq);
return e;
}
@@ -638,11 +638,11 @@ bindtype_rec(Tyenv *e, Type *t, Bitset *visited)
bsput(visited, t->tid);
switch (t->type) {
case Typaram:
- tt = htget(e->tab, t->pname);
+ tt = htget(e->tab, t);
if (tt && tt != t)
tytab[t->tid] = tt;
else if (!isbound(t))
- htput(e->tab, t->pname, t);
+ htput(e->tab, t, t);
break;
case Tygeneric:
for (i = 0; i < t->ngparam; i++)
@@ -694,7 +694,7 @@ isbound(Type *t)
Tyenv *e;
for (e = curenv(); e; e = e->super)
- if (htget(e->tab, t->pname))
+ if (htget(e->tab, t))
return 1;
return 0;
}