diff options
| author | gingerBill <bill@gingerbill.org> | 2021-02-23 14:45:15 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-02-23 14:45:15 +0000 |
| commit | a1693c01847f9018ba4c4d9ec455157e34ebd6b3 (patch) | |
| tree | 82905b98e6aa8512c0141306c2ed736fb41c0aa3 /src/check_stmt.cpp | |
| parent | 657c0ac4f57fce7f9a9e14ce85956522ddeeed9c (diff) | |
Deprecate `inline for` in favour of `#unroll for`
Diffstat (limited to 'src/check_stmt.cpp')
| -rw-r--r-- | src/check_stmt.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index 4c805481e..3448e83e4 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -731,11 +731,11 @@ void check_inline_range_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags) { if (val0 == nullptr) { gbString s = expr_to_string(operand.expr); gbString t = type_to_string(operand.type); - error(operand.expr, "Cannot iterate over '%s' of type '%s' in an 'inline for' statement", s, t); + error(operand.expr, "Cannot iterate over '%s' of type '%s' in an '#unroll for' statement", s, t); gb_string_free(t); gb_string_free(s); } else if (operand.mode != Addressing_Constant) { - error(operand.expr, "An 'inline for' expression must be known at compile time"); + error(operand.expr, "An '#unroll for' expression must be known at compile time"); } } @@ -793,7 +793,7 @@ void check_inline_range_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags) { } - // NOTE(bill): Minimize the amount of nesting of an 'inline for' + // NOTE(bill): Minimize the amount of nesting of an '#unroll for' i64 prev_inline_for_depth = ctx->inline_for_depth; defer (ctx->inline_for_depth = prev_inline_for_depth); { @@ -806,9 +806,9 @@ void check_inline_range_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags) { if (ctx->inline_for_depth >= MAX_INLINE_FOR_DEPTH && prev_inline_for_depth < MAX_INLINE_FOR_DEPTH) { if (prev_inline_for_depth > 0) { - error(node, "Nested 'inline for' loop cannot be inlined as it exceeds the maximum inline for depth (%lld levels >= %lld maximum levels)", v, MAX_INLINE_FOR_DEPTH); + error(node, "Nested '#unroll for' loop cannot be inlined as it exceeds the maximum '#unroll for' depth (%lld levels >= %lld maximum levels)", v, MAX_INLINE_FOR_DEPTH); } else { - error(node, "'inline for' loop cannot be inlined as it exceeds the maximum inline for depth (%lld levels >= %lld maximum levels)", v, MAX_INLINE_FOR_DEPTH); + error(node, "'#unroll for' loop cannot be inlined as it exceeds the maximum '#unroll for' depth (%lld levels >= %lld maximum levels)", v, MAX_INLINE_FOR_DEPTH); } error_line("\tUse a normal 'for' loop instead by removing the 'inline' prefix\n"); ctx->inline_for_depth = MAX_INLINE_FOR_DEPTH; |