commit bef5892c5acbecb8a532552753ef8013751eb651
parent 00a6225ddfb61b953e828b98a288093326bf273c
Author: Drew DeVault <sir@cmpwn.com>
Date: Wed, 30 Dec 2020 09:18:22 -0500
Implement simple forward references
This won't work for some cases, but it's a good start.
Diffstat:
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/check.c b/src/check.c
@@ -689,7 +689,6 @@ check_function(struct context *ctx,
"%s function cannot be exported", flags);
}
- scope_insert(ctx->unit, O_DECL, &decl->ident, decl->func.type);
scope_pop(&ctx->scope, TR_CHECK);
ctx->current_fntype = NULL;
trleave(TR_CHECK, NULL);
@@ -747,9 +746,7 @@ scan_function(struct context *ctx, const struct ast_function_decl *decl)
identifier_unparse_static(&decl->ident, buf, sizeof(buf));
trleave(TR_SCAN, "func %s", buf);
- if (!decl->body) {
- scope_insert(ctx->unit, O_DECL, &decl->ident, fntype);
- }
+ scope_insert(ctx->unit, O_DECL, &decl->ident, fntype);
}
static void