diff options
| author | gingerBill <bill@gingerbill.org> | 2021-04-14 17:15:28 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-04-14 17:15:28 +0100 |
| commit | 9adec628c1c6b3d24f7a8642bbf5c0c84586d161 (patch) | |
| tree | 7f4785bcb7615922f71fc657bab029218f9be996 /src/check_expr.cpp | |
| parent | 3e54cddf641e7d8ca79b0cbb12e1595727a9e888 (diff) | |
Add `@(cold)` attribute to procedure declarations
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
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; } |