aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/cgen.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-14 09:25:16 +0200
committerlemon <lsof@mailbox.org>2022-08-14 09:25:16 +0200
commitc129f77ad724aa940b53a125de0e1e4de0ca7240 (patch)
tree57ad369bcfe02d0fb8a311c659e45cf2ae5df075 /bootstrap/cgen.c
parent66ed623e65ab9350f08061fe7cf12b989c84f65c (diff)
fix arena
Diffstat (limited to 'bootstrap/cgen.c')
-rw-r--r--bootstrap/cgen.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/bootstrap/cgen.c b/bootstrap/cgen.c
index 5a1180d..5c64a30 100644
--- a/bootstrap/cgen.c
+++ b/bootstrap/cgen.c
@@ -306,6 +306,7 @@ genexpr(struct expr *ex) {
}
}
+static void gendecl(struct decl *decl, bool toplevel);
static void genfn(bool externp, const char *cname, struct fn *fn);
static void genstatic(bool externp, const char *cname, struct var *var);
@@ -350,6 +351,7 @@ genstmt(struct stmt *stmt) {
genstatic(1, decl.name, &decl.var);
break;
case Ddef: case Dtype: case Dmacro: case Dtepl: case Dlabel:
+ gendecl(&stmt->decl, 0);
break;
}
break;
@@ -579,6 +581,8 @@ liftdecl(struct decl *decl) {
liftnestedex(decl->var.ini);
break;
case Dtype:
+ lifttype(decl->ty);
+ break;
case Dtepl:
for (struct teplcache *cache = decl->tepl.cache; cache; cache = cache->next) {
for (int i = 0; i < cache->args.n; ++i) {