Skip to content

Commit 9fed041

Browse files
committed
[NFC] Add documentation
1 parent 6734d4a commit 9fed041

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

docs/SIL/Instructions.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,6 +1199,17 @@ the `set` case is passed `self`.
11991199

12001200
This is only valid in Raw SIL.
12011201

1202+
### unchecked_ownership
1203+
1204+
```
1205+
sil-instruction ::= 'unchecked_ownership' sil-operand
1206+
1207+
unchecked_ownership %1 : $T
1208+
```
1209+
1210+
unchecked_ownership disables the ownership verification of it's operand. This used in cases
1211+
we cannot resolve ownership until a mandatory pass runs. This is only valid in Raw SIL.
1212+
12021213
### copy_addr
12031214

12041215
```
@@ -5003,6 +5014,20 @@ does not apply in the `raw` SIL stage.
50035014

50045015
A function must not contain more than one `return` instruction.
50055016

5017+
### return_borrow
5018+
5019+
```
5020+
sil-terminator ::= 'return_borrow' sil-operand 'from_scopes' '(' (sil-operand (',' sil-operand)*)? ')'
5021+
5022+
return_borrow %0 : $T from_scopes (%1, %2 ...)
5023+
// %0 must be a @guaranteed value
5024+
// %1, %2, ... must be borrow introducers for %0, like `load_borrow`
5025+
// $T must be the return type of the current function
5026+
```
5027+
5028+
return_borrow instruction is valid only for functions @guaranteed results.
5029+
It is used to a return a @guaranteed value that maybe produced within borrow scopes local to the function.
5030+
50065031
### throw
50075032

50085033
```

0 commit comments

Comments
 (0)