aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-04-22 16:26:28 +0100
committergingerBill <bill@gingerbill.org>2021-04-22 16:26:28 +0100
commit01db195b4743fcf3c4f3c6c35f370b2b60e40a01 (patch)
tree5824bf6f5c03cd9fc0779ee504bcec9767df8a0d /src/check_decl.cpp
parentd33350e3a5280cee5af74ed71f776f783a49e362 (diff)
Make `main` calling convention "odin" rather than "contextless" to simplify code generation
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp5
1 files changed, 2 insertions, 3 deletions
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'");