Don't use tyhash for scoping.
Soon enough, it's going to use a strict equality comparison,
so that params from different scopes will be considered
different.
It's a step towards deduping.
@@ -116,6 +116,18 @@ popstab()
stabstkoff--;
}
+ulong
+paramhash(void *p)
+{
+ return strhash(((Type*)p)->pname);
+}
+
+int
+parameq(void *a, void *b)
+{
+ return streq(((Type*)a)->pname, ((Type*)b)->pname);
+}
+
Tyenv*
mkenv()
{
@@ -123,7 +135,7 @@ mkenv()
e = malloc(sizeof(Tyenv));
e->super = NULL;
- e->tab = mkht(tyhash, tyeq);
+ e->tab = mkht(paramhash, parameq);
return e;
}
