diff options
| author | 2022-08-13 20:53:39 +0200 | |
|---|---|---|
| committer | 2022-08-13 20:53:39 +0200 | |
| commit | ddcca62a276c528a4390c8e3d58403b865f81869 (patch) | |
| tree | 3d563e173a18095501f61f3b30e39cf62b4ff521 /bootstrap | |
| parent | a4ddca68662f4bc0531763357b4bc00b6c50b456 (diff) | |
ok..
Diffstat (limited to 'bootstrap')
| -rwxr-xr-x | bootstrap/bootstrap.sh | 2 | ||||
| -rw-r--r-- | bootstrap/cgen.c | 1 | ||||
| -rw-r--r-- | bootstrap/dump.c | 2 | ||||
| -rw-r--r-- | bootstrap/parse.c | 4 | ||||
| -rw-r--r-- | bootstrap/types.c | 8 |
5 files changed, 10 insertions, 7 deletions
diff --git a/bootstrap/bootstrap.sh b/bootstrap/bootstrap.sh index 7ae3c09..c2fd41e 100755 --- a/bootstrap/bootstrap.sh +++ b/bootstrap/bootstrap.sh @@ -7,7 +7,7 @@ cd $(dirname "$0") if [ x"$CC" == x ]; then export CC=cc fi -export CFLAGS="-Wno-builtin-declaration-mismatch -g" +export CFLAGS="-Wno-builtin-declaration-mismatch -Wno-discarded-qualifiers -g" set -euo pipefail diff --git a/bootstrap/cgen.c b/bootstrap/cgen.c index 8b7b710..5a1180d 100644 --- a/bootstrap/cgen.c +++ b/bootstrap/cgen.c @@ -585,6 +585,7 @@ liftdecl(struct decl *decl) { if (cache->args.d[i].typ) lifttype(cache->args.d[i].ty); } + lifttype(cache->ty); } default: break; diff --git a/bootstrap/dump.c b/bootstrap/dump.c index d4fe7e2..91832fd 100644 --- a/bootstrap/dump.c +++ b/bootstrap/dump.c @@ -54,7 +54,7 @@ pritype(const struct type *ty) { case TYeunion: kind = "tagged union"; agg: - epri("%s", ty->agg.name ? ty->agg.name : "(anonymous %s)", kind); + epri(ty->agg.name ? ty->agg.name : "(anonymous %s)", kind); if (ty->agg.tpargs.n) { epri("<"); int n = ty->agg.tpargs.n; diff --git a/bootstrap/parse.c b/bootstrap/parse.c index 7a35f09..be32985 100644 --- a/bootstrap/parse.c +++ b/bootstrap/parse.c @@ -87,7 +87,7 @@ aissep(char c) { case '*': case '/': case '&': case '|': case '^': case '~': case '=': case '\'': case '"': case '<': case '>': case ':': - case '@': case '#': case '\\': + case '@': case '#': case '%': case '\\': case '`': return 1; return 0; @@ -2744,7 +2744,7 @@ aggdeclyield(struct decl *decl, void *arg) { if (decl->t == Dtype && decl->ty == a->aggty) ; - else if ((decl->t == Dfn && !decl->externp) || decl->t == Ddef) + else if ((decl->t == Dfn && !decl->externp) || decl->t == Ddef || decl->t == Dmacro) vec_push(a->decls, decl); else fatal(a->P, decl->span, "this kind of declaration is disallowed inside aggregates"); 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 * |