mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-12 22:33:36 +00:00
Add #must_tail and "preserve/none" calling convention
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user