mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-09 06:23:14 +00:00
Remove "pure" and "pure_none" calling conventions
This commit is contained in:
@@ -1162,11 +1162,6 @@ Entity *check_ident(CheckerContext *c, Operand *o, Ast *n, Type *named_type, Typ
|
||||
if (e->flags & EntityFlag_Value) {
|
||||
o->mode = Addressing_Value;
|
||||
}
|
||||
if (c->curr_proc_calling_convention == ProcCC_Pure) {
|
||||
if (e->scope->flags & (ScopeFlag_Global|ScopeFlag_File|ScopeFlag_Pkg)) {
|
||||
error(n, "Global variables are not allowed within a \"pure\" procedure, got '%.*s'", LIT(e->token.string));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case Entity_Procedure:
|
||||
@@ -7816,14 +7811,6 @@ ExprKind check_call_expr(CheckerContext *c, Operand *operand, Ast *call, Ast *pr
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
if (c->curr_proc_calling_convention == ProcCC_Pure) {
|
||||
if (pt->kind == Type_Proc && pt->Proc.calling_convention != ProcCC_Pure && pt->Proc.calling_convention != ProcCC_PureNone) {
|
||||
error(call, "Only \"pure\" procedure calls are allowed within a \"pure\" procedure");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (pt->kind == Type_Proc && pt->Proc.calling_convention == ProcCC_Odin) {
|
||||
init_core_context(c->checker);
|
||||
@@ -8168,17 +8155,13 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type
|
||||
error(node, "'context' is only allowed within procedures %p", c->curr_proc_decl);
|
||||
return kind;
|
||||
}
|
||||
if (c->curr_proc_calling_convention == ProcCC_Pure) {
|
||||
error(node, "'context' is not allowed within a \"pure\" procedure");
|
||||
} else {
|
||||
if (unparen_expr(c->assignment_lhs_hint) == node) {
|
||||
c->scope->flags |= ScopeFlag_ContextDefined;
|
||||
}
|
||||
if (unparen_expr(c->assignment_lhs_hint) == node) {
|
||||
c->scope->flags |= ScopeFlag_ContextDefined;
|
||||
}
|
||||
|
||||
if ((c->scope->flags & ScopeFlag_ContextDefined) == 0) {
|
||||
error(node, "'context' has not been defined within this scope");
|
||||
// Continue with value
|
||||
}
|
||||
if ((c->scope->flags & ScopeFlag_ContextDefined) == 0) {
|
||||
error(node, "'context' has not been defined within this scope");
|
||||
// Continue with value
|
||||
}
|
||||
|
||||
init_core_context(c->checker);
|
||||
|
||||
Reference in New Issue
Block a user