Make main calling convention "odin" rather than "contextless" to simplify code generation

This commit is contained in:
gingerBill
2021-04-22 16:26:28 +01:00
parent d33350e3a5
commit 01db195b47
2 changed files with 44 additions and 45 deletions

View File

@@ -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'");