Deprecate unroll pragma, remove from documentation (#14705)
This commit is contained in:
parent
2039e3e883
commit
99c198625c
2 changed files with 2 additions and 19 deletions
|
|
@ -176,6 +176,8 @@ proc mydiv(a, b): int {.raises: [].} =
|
||||||
with `--panics:on` `Defects` become unrecoverable errors.
|
with `--panics:on` `Defects` become unrecoverable errors.
|
||||||
|
|
||||||
- Added `thiscall` calling convention as specified by Microsoft, mostly for hooking purpose
|
- Added `thiscall` calling convention as specified by Microsoft, mostly for hooking purpose
|
||||||
|
- Deprecated `{.unroll.}` pragma, was ignored by the compiler anyways, was a nop.
|
||||||
|
|
||||||
|
|
||||||
## Compiler changes
|
## Compiler changes
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6210,25 +6210,6 @@ the underlying backend (C compiler) does not support the computed goto
|
||||||
extension the pragma is simply ignored.
|
extension the pragma is simply ignored.
|
||||||
|
|
||||||
|
|
||||||
unroll pragma
|
|
||||||
-------------
|
|
||||||
The ``unroll`` pragma can be used to tell the compiler that it should unroll
|
|
||||||
a `for`:idx: or `while`:idx: loop for execution efficiency:
|
|
||||||
|
|
||||||
.. code-block:: nim
|
|
||||||
proc searchChar(s: string, c: char): int =
|
|
||||||
for i in 0 .. s.high:
|
|
||||||
{.unroll: 4.}
|
|
||||||
if s[i] == c: return i
|
|
||||||
result = -1
|
|
||||||
|
|
||||||
In the above example, the search loop is unrolled by a factor 4. The unroll
|
|
||||||
factor can be left out too; the compiler then chooses an appropriate unroll
|
|
||||||
factor.
|
|
||||||
|
|
||||||
**Note**: Currently the compiler recognizes but ignores this pragma.
|
|
||||||
|
|
||||||
|
|
||||||
immediate pragma
|
immediate pragma
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue