Add #must_tail and "preserve/none" calling convention

This commit is contained in:
gingerBill
2026-01-15 17:28:28 +00:00
parent 0366cd3304
commit 5f07055ac1
6 changed files with 21 additions and 44 deletions

View File

@@ -2216,6 +2216,7 @@ gb_internal Ast *parse_inlining_or_tailing_operand(AstFile *f, Token token) {
if (pt != ProcTailing_none) {
if (e->kind == Ast_ProcLit) {
syntax_error(expr, "'#must_call' can only be applied to a procedure call, not the procedure literal");
e->ProcLit.tailing = pt;
} else if (e->kind == Ast_CallExpr) {
e->CallExpr.tailing = pt;
@@ -4020,6 +4021,8 @@ gb_internal ProcCallingConvention string_to_calling_convention(String const &s)
if (s == "win64") return ProcCC_Win64;
if (s == "sysv") return ProcCC_SysV;
if (s == "preserve/none") return ProcCC_PreserveNone;
if (s == "system") {
if (build_context.metrics.os == TargetOs_windows) {
return ProcCC_StdCall;