From 01db195b4743fcf3c4f3c6c35f370b2b60e40a01 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 22 Apr 2021 16:26:28 +0100 Subject: Make `main` calling convention "odin" rather than "contextless" to simplify code generation --- src/check_decl.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/check_decl.cpp') diff --git a/src/check_decl.cpp b/src/check_decl.cpp index e74504a1a..85c58fdf9 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -743,11 +743,10 @@ void check_proc_decl(CheckerContext *ctx, Entity *e, DeclInfo *d) { error(e->token, "Procedure type of 'main' was expected to be 'proc()', got %s", str); gb_string_free(str); } - if (pt->calling_convention != ProcCC_Odin && - pt->calling_convention != ProcCC_Contextless) { + if (pt->calling_convention != ProcCC_Odin) { error(e->token, "Procedure 'main' cannot have a custom calling convention"); } - pt->calling_convention = ProcCC_Contextless; + pt->calling_convention = ProcCC_Odin; if (e->pkg->kind == Package_Init) { if (ctx->info->entry_point != nullptr) { error(e->token, "Redeclaration of the entry pointer procedure 'main'"); -- cgit v1.2.3