Skip to content

[pull] swiftwasm-release/5.8 from release/5.8 #5257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 4, 2023

Conversation

pull[bot]
Copy link

@pull pull bot commented Feb 4, 2023

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

xedin and others added 4 commits February 2, 2023 21:51
… no-return func

The pass is attempting to diagnose any user-written code that appears
after the result of no-return function call. It has to skip any
instructions that happen after the no-return call but are associated
with it, such as `alloc_stack` to pass result of such call indirectly.

This helps to avoid extraneous diagnostics for synthesized code i.e.
a result builder with `buildExpression`:

```
static func buildExpression<T>(_ e: T) -> T { e }
```

The following example would produce extraneous warning:

```
switch <value> {
case ...
default: fatalError()
}
```

because it is translated into:

```
switch <value> {
case ...
default: {
  var $__builderDefault = buildExpression(fatalError())
  $__builderSwitch = buildEither(second: $__builderDefault)
}
}
```

In such cases all instructions that follow `fatalError()` call
are synthesized except to `alloc_stack $Never` which is passed
to `buildExpression`, that instruction is anchored on the
`fatalError()` itself which is where the diagnostic would point,
which is incorrect.

Resolves: rdar://104775183
(cherry picked from commit afaeca7)
* `var description`
* `func ==`
* `func hasSameSourceLocation(as:)`

(cherry picked from commit d96ef3b)
[5.8][SILOptimizer] Don't diagnose unreachable instructions that belong to…
@kateinoigakukun kateinoigakukun merged commit 9c1e37e into swiftwasm-release/5.8 Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants