From 5957d7f7bee7e5fac4035d47ecaaaad022adbfb8 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Tue, 20 Jun 2017 12:38:05 +0100 Subject: Implicit Parameter Passing based `context` system (replacing Thread Local Storage (TLS) approach) --- src/check_decl.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/check_decl.cpp') diff --git a/src/check_decl.cpp b/src/check_decl.cpp index dede1a26c..672673faf 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -333,6 +333,11 @@ void check_proc_decl(Checker *c, Entity *e, DeclInfo *d) { error(e->token, "Procedure type of `main` was expected to be `proc()`, got %s", str); gb_string_free(str); } + if (proc_type->Proc.calling_convention != ProcCC_Odin && + proc_type->Proc.calling_convention != ProcCC_Contextless) { + error(e->token, "Procedure `main` cannot have a custom calling convention"); + } + proc_type->Proc.calling_convention = ProcCC_Contextless; } if (is_inline && is_no_inline) { -- cgit v1.2.3