Commit Graph

8 Commits

Author SHA1 Message Date
Nate Chandler
ed623d7b64 [NFC] Shortened SIL [init] flag.
Instead of writing out [initalization] for some instructions, use [init]
everywhere.
2022-10-27 10:38:54 -07:00
Slava Pestov
9ec80df97e SIL: Remove curried SILDeclRefs 2020-03-19 02:20:21 -04:00
Michael Gottesman
9e13779702 [ownership] Remove most -enable-sil-ownership from SILGen now that %target-swift-emit-silgen does it automatically.
I did this using a sed pattern and verified by hand that I was only touching
target-swift-emit-silgen lines.
2018-12-13 11:54:54 -08:00
Erik Eckstein
39bb14b094 change mangling prefix from $S to $s
This is the final ABI mangling prefix

rdar://problem/38471478
2018-09-19 13:55:11 -07:00
Alex Hoppen
560c22b18e [tests] Verify the libSyntax tree on SILGen tests
The SILGen testsuite consists of valid Swift code covering most language
features. We use these tests to verify that no unknown nodes are in the
file's libSyntax tree. That way we will (hopefully) catch any future
changes or additions to the language which are not implemented in
libSyntax.
2018-04-27 09:33:03 -07:00
Erik Eckstein
cd3d50a5d9 ABI: Change the mangling prefix from _T0 to $S 2018-01-06 13:55:59 -08:00
Michael Gottesman
20c3e1e92f [semantic-sil] Update 45 SILGen tests for ownership.
Very roughly this increases the total coverage of SILGen tests with ownership
enabled to ~20%.

rdar://33358110
2017-08-20 19:11:55 -07:00
Slava Pestov
c46987a06b SIL: Use CaptureKind::Box for weak and unowned captures in noescape closures
SILGen emits 'var' bindings as mutable heap-allocated boxes,
since they might be captured by escaping closures whose
lifetime exceeds that of the function itself.

Escaping closures capture the entire box; however for noescape
closures it is sufficient to capture only the address projected
from the box, because usually the box outlives the closure.

The one exception though is if the binding is introduced by
a capture list. In this case, the closure would outlive the box,
resulting in the contents of the box being released before the
closure was invoked.

Normally, capture lists cannot introduce 'var' bindings; the
one exception is when capturing a reference as 'weak'.

Fix the problem by capturing such bindings as a box and not as a
projection, even for noescape closures.

Fixes <rdar://problem/32718153>.
2017-06-13 15:11:46 -07:00