Commit Graph

14 Commits

Author SHA1 Message Date
Erik Eckstein
7cceaff5f3 SIL: don't print operand types in textual SIL
Type annotations for instruction operands are omitted, e.g.

```
  %3 = struct $S(%1, %2)
```

Operand types are redundant anyway and were only used for sanity checking in the SIL parser.

But: operand types _are_ printed if the definition of the operand value was not printed yet.
This happens:

* if the block with the definition appears after the block where the operand's instruction is located

* if a block or instruction is printed in isolation, e.g. in a debugger

The old behavior can be restored with `-Xllvm -sil-print-types`.
This option is added to many existing test files which check for operand types in their check-lines.
2024-11-21 18:49:52 +01:00
Allan Shortlidge
cb578172ea Tests: Remove -disable-availability-checking in more tests that use concurrency.
Use the `%target-swift-5.1-abi-triple` substitution to compile the tests for
deployment to the minimum OS versions required for use of _Concurrency APIs,
instead of disabling availability checking.
2024-10-19 12:35:20 -07:00
Andrew Trick
a1fe258692 Update tests for new trivial moves and extend_lifetimes. 2024-07-26 08:27:48 -07:00
Nate Chandler
373cc84329 [SILGen] Move non-trivial none-ownership values.
All non-trivial values which correspond to `VarDecl`s must be marked
appropriately so that they can be found by the relevant checker.  Here,
values with none ownership are marked.
2024-03-09 23:19:30 -08:00
John McCall
dd90ae7416 Rename SIL's @isolated attribute to @sil_isolated.
We want to use @isolated in ordinary Swift, and while we could probably
make it coexist with this SIL use, doing so would be really inconvenient.
2024-02-03 01:51:36 -05:00
Michael Gottesman
6f3d45219a [ast] Represent a parameter's isolation at the SIL level.
I did this by adding flag on SILParamInfo.

rdar://121387872
2024-01-23 15:20:22 -08:00
Nate Chandler
9bb0187be1 [SILGen] Add begin_borrow [var_decl] lifetimes. 2023-11-28 07:26:09 -08:00
Kavon Farvardin
15aa088333 silgen test coverage for async thunks of non-async funcs
In light of SE-338, you'd think all functions converted to
be `async` would have hops in their reabstraction thunks.

But that's not the case. A non-async function that is not
otherwise isolated according to its type, when converted
to become an async function, should not have hops in its
reabstraction thunk; not even to the generic executor.

That was not intuitive for me, so I thought I'd add
extra test coverage to ensure we maintain that existing
behavior, since we rely on it when non-async functions
have their isolation casted away when in an isolated
context (only allowed when it's not also Sendable).
Thus, when it's called later on, it needs to inherit the
executor, as its guaranteed to only be called while on
a matching one. For example:

```
@MainActor func caller() async {
  let f: () -> () = mainActorFn
  let g: () async -> () = f
  await g()  // g cannot be hopping to a different executor, it must inherit!
}
```
2023-01-11 16:20:51 -08:00
Doug Gregor
d081251ddc Witness thunk does not need to hop when the witness decl is acessible from anywhere
Fixes rdar://96906314.
2022-08-19 15:15:15 -07:00
Doug Gregor
eeeea49764 Remove -enable-experimental-concurrency almost everywhere. 2021-07-26 21:24:43 -07:00
Doug Gregor
1e2012d816 Disable availability checking in tests that use concurrency 2021-07-20 12:46:26 -07:00
Richard Wei
fb66de6126 Unify mangling operators for async, @Sendable, @differentiable and @noDerivative.
Repurpose mangling operator `Y` as an umbrella operator that covers new attributes on function types. Free up operators `J`, `j`, and `k`.

```
async ::= 'Ya'                             // 'async' annotation on function types
sendable ::= 'Yb'                          // @Sendable on function types
throws ::= 'K'                             // 'throws' annotation on function types
differentiable ::= 'Yjf'                   // @differentiable(_forward) on function type
differentiable ::= 'Yjr'                   // @differentiable(reverse) on function type
differentiable ::= 'Yjd'                   // @differentiable on function type
differentiable ::= 'Yjl'                   // @differentiable(_linear) on function type
```

Resolves rdar://76299796.
2021-04-07 17:49:10 -07:00
Doug Gregor
3530dc6d8d [Concurrency] Allow synchronous witnesses to satisfy 'async' requirements. 2020-12-03 16:44:32 -08:00
Doug Gregor
f46ad6c28f [Concurrency] Emit thunk for synchronous -> async function conversion. 2020-12-03 13:47:39 -08:00