Skip to content

Commit 7b1d22d

Browse files
authored
Add uncheckedBehavior compiler option (#196)
1 parent e824aae commit 7b1d22d

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/compiler.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,26 @@ The compiler can optimize for both speed (`-Ospeed`) and size (`-Osize`), as wel
3434
```
3535
--optimize, -O Optimizes the module. Typical shorthands are:
3636
37-
Default optimizations -O
38-
Make a release build -O --noAssert
39-
Make a debug build --debug
40-
Optimize for speed -Ospeed
41-
Optimize for size -Osize
37+
Default optimizations -O
38+
Make a release build -O --noAssert
39+
Make a debug build --debug
40+
Optimize for speed -Ospeed
41+
Optimize for size -Osize
4242
4343
--optimizeLevel How much to focus on optimizing code. [0-3]
4444
--shrinkLevel How much to focus on shrinking code size. [0-2, s=1, z=2]
4545
--converge Re-optimizes until no further improvements can be made.
4646
--noAssert Replaces assertions with just their value without trapping.
47+
--uncheckedBehavior Changes the behavior of unchecked() expressions.
48+
Using this option can potentially cause breakage.
49+
50+
default The default behavior: unchecked operations are
51+
only used inside of unchecked().
52+
never Unchecked operations are never used, even when,
53+
inside of unchecked().
54+
always Unchecked operations are always used if possible,
55+
whether or not unchecked() is used.
56+
4757
```
4858

4959
Optimization levels can also be tweaked manually: `--optimizeLevel` \(0-3\) indicates how much the compiler focuses on optimizing the code with `--shrinkLevel` \(0-2, 1=s, 2=z\) indicating how much it focuses on keeping the size low during code generation and while optimizing. A shorthand for both is `-O[optimizeLevel][shrinkLevel]` , with shrink level indicated by optionally appending the letter `s` \(1\) or `z` \(2\).

0 commit comments

Comments
 (0)