spl

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit caaed7002a569582b5ddbace90682c799a6a3b76
parent 2ef2e21f6ba2516ffe0258e9052d4b100ba7a0ff
Author: Brian Swetland <swetland@frotz.net>
Date:   Mon, 16 Oct 2023 16:03:00 -0700

compiler0: structs are returned as pointers

Diffstat:
Mbootstrap/compiler0.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/bootstrap/compiler0.c b/bootstrap/compiler0.c @@ -1450,8 +1450,10 @@ void parse_function(void) { rtype = parse_type(false); } - emit_decl("t$%s fn_%s(", rtype->name->text, fname->text); - emit_impl("t$%s fn_%s(", rtype->name->text, fname->text); + emit_decl("t$%s%s fn_%s(", rtype->name->text, + rtype->kind == TYPE_STRUCT ? "*" : "", fname->text); + emit_impl("t$%s%s fn_%s(", rtype->name->text, + rtype->kind == TYPE_STRUCT ? "*" : "", fname->text); for (Symbol *s = ctx.scope->first; s != nil; s = s->next) { emit_decl("t$%s %s$%s%s", s->type->name->text,