Skip to content

Commit 75548fc

Browse files
authored
Merge pull request #61439 from meg-gupta/fixdoc
[NFC] Update store_borrow specification
2 parents 5141229 + f6451bc commit 75548fc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/SIL.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3987,22 +3987,22 @@ store_borrow
39873987

39883988
sil-instruction ::= 'store_borrow' sil-value 'to' sil-operand
39893989

3990-
store_borrow %0 to %1 : $*T
3990+
%2 = store_borrow %0 to %1 : $*T
39913991
// $T must be a loadable type
39923992
// %1 must be an alloc_stack $T
3993+
// %2 is the return address
39933994

39943995
Stores the value ``%0`` to a stack location ``%1``, which must be an
39953996
``alloc_stack $T``.
39963997
The stack location must not be modified by other instructions than
39973998
``store_borrow``.
3998-
The stored value is alive until the ``dealloc_stack`` or until another
3999-
``store_borrow`` overwrites the value. During the its lifetime, the stored
4000-
value must not be modified or destroyed.
3999+
All uses of the store_borrow destination ```%1`` should be via the store_borrow
4000+
return address ``%2`` except dealloc_stack.
4001+
The stored value is alive until the ``end_borrow``. During the its lifetime,the
4002+
stored value must not be modified or destroyed.
40014003
The source value ``%0`` is borrowed (i.e. not copied) and it's borrow scope
40024004
must outlive the lifetime of the stored value.
40034005

4004-
Note: This is the current implementation and the design is not final.
4005-
40064006
begin_borrow
40074007
````````````
40084008

0 commit comments

Comments
 (0)