From 9adec628c1c6b3d24f7a8642bbf5c0c84586d161 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Wed, 14 Apr 2021 17:15:28 +0100 Subject: Add `@(cold)` attribute to procedure declarations --- src/check_expr.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/check_expr.cpp') diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 3b7a975d1..2114746a3 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -8175,24 +8175,24 @@ ExprKind check_call_expr(CheckerContext *c, Operand *operand, Ast *call, Ast *pr } switch (inlining) { - case ProcInlining_inline: { - if (proc != nullptr) { - Entity *e = entity_from_expr(proc); - if (e != nullptr && e->kind == Entity_Procedure) { - DeclInfo *decl = e->decl_info; - if (decl->proc_lit) { - ast_node(pl, ProcLit, decl->proc_lit); - if (pl->inlining == ProcInlining_no_inline) { - error(call, "'inline' cannot be applied to a procedure that has be marked as 'no_inline'"); - } + case ProcInlining_inline: { + if (proc != nullptr) { + Entity *e = entity_from_expr(proc); + if (e != nullptr && e->kind == Entity_Procedure) { + DeclInfo *decl = e->decl_info; + if (decl->proc_lit) { + ast_node(pl, ProcLit, decl->proc_lit); + if (pl->inlining == ProcInlining_no_inline) { + error(call, "'inline' cannot be applied to a procedure that has be marked as 'no_inline'"); } } } - break; } + break; + } - case ProcInlining_no_inline: - break; + case ProcInlining_no_inline: + break; } operand->expr = call; @@ -11019,10 +11019,10 @@ gbString write_expr_to_string(gbString str, Ast *node, bool shorthand) { case_ast_node(ce, CallExpr, node); switch (ce->inlining) { case ProcInlining_inline: - str = gb_string_appendc(str, "inline "); + str = gb_string_appendc(str, "#force_inline "); break; case ProcInlining_no_inline: - str = gb_string_appendc(str, "no_inline "); + str = gb_string_appendc(str, "#force_no_inline "); break; } -- cgit v1.2.3