diff options
| author | 2022-08-13 20:53:39 +0200 | |
|---|---|---|
| committer | 2022-08-13 20:53:39 +0200 | |
| commit | ddcca62a276c528a4390c8e3d58403b865f81869 (patch) | |
| tree | 3d563e173a18095501f61f3b30e39cf62b4ff521 /bootstrap/types.c | |
| parent | a4ddca68662f4bc0531763357b4bc00b6c50b456 (diff) | |
ok..
Diffstat (limited to 'bootstrap/types.c')
| -rw-r--r-- | bootstrap/types.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bootstrap/types.c b/bootstrap/types.c index 37977ea..289f69f 100644 --- a/bootstrap/types.c +++ b/bootstrap/types.c @@ -10,6 +10,7 @@ static struct { } **buckets; char *tags; } types; +static vec_t(const struct type *) typesvec; void inittypes() { @@ -163,6 +164,7 @@ interntype(struct type ty) { ty._id = id++; ty2 = typesput(&ty); assert(ty2); + vec_push(&typesvec, ty2); return ty2; } @@ -267,9 +269,9 @@ putprimtypes(struct env *env) { void visittypes(void (*visitor)(const struct type *, void *), void *arg) { - for (int i = 0; i < types.nbuckets; ++i) - for (struct typesnode *n = types.buckets[i]; n; n = n->next) - visitor(&n->ty, arg); + int i; const struct type *ty; + vec_foreach(&typesvec, ty, i) + visitor(ty, arg); } const struct type * |