Skip to content

[pull] swiftwasm from main #4883

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 51 commits into from
Sep 13, 2022
Merged

[pull] swiftwasm from main #4883

merged 51 commits into from
Sep 13, 2022

Conversation

pull[bot]
Copy link

@pull pull bot commented Sep 12, 2022

See Commits and Changes for more details.


Created by pull[bot]

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

calda and others added 30 commits August 31, 2022 18:00
Cleanup code in _modify accessors will only run reliably if it is put in a defer statement.

(Statements that follow the `yield` aren’t executed if the yielded-to code throws an error.)
Introduce the compiler directive `#_hasSymbol` which will be used to detect whether weakly linked symbols are present at runtime. It is intended for use in combination with `@_weakLinked import` or `-weak-link-at-target`.

```
if #_hasSymbol(foo(_:)) {
  foo(42)
}
```

Parsing only; SILGen is coming in a later commit.

Resolves rdar://99342017
There are only new users of @_spiOnly so we can already make this
diagnostic an error.
…ctory matches the invocation.

The Swift compiler does not have a concept of a working directory. It is instead handled by the Swift driver by resolving relative paths according to the driver's working directory argument. On the other hand, Clang does have a concept working directory which may be specified on this Clang invocation with '-working-directory'. If so, it is crucial that we use this directory as an argument to the Clang scanner API. Otherwiswe, we risk having a mismatch between the working directory specified on the scanner's Clang invocation and the one use from the scanner API entry-points, which leads to downstream inconsistencies and errors.
When examining non-trivial types which were non-lexical, when a field
lacks a field decl (as happens with tuples), whether the type was
annotated @_eagerMove was overlooked, resulting in incorrectly
determining that a leaf was lexical.
In addition to starting all RecursiveProperties values which are
NonTrivial as Lexical, also mark instances of the structs which are
modified to become NonTrivial to simultaneously become Lexical.
…cker.

Some notes:

1. I added support for both loadable/address only types.

2. These tests are based off of porting the move only object tests for inout,
vars, mutating self, etc.

3. I did not include already written tests for address only types in this
specific merge since I need to change us to borrow move only var like types.
Without that, we get a lot of spurious error msgs and the burden of writing that
is not worth it. So instead in a forthcoming commit where I fix that issue in
SILGen, I will commit the corresponding address only tests for this work.

4. I did not include support for trivial types in this. I am going to do
object/address for that at the same time.
…dress-checker

[move-only] Initial patch for move only address checking.
If the string to parse doesn't start with a token which belongs to a projection path, just return an empty path instead of throwing an error.
So far, argument effects were printed in square brackets before the function name, e.g.
```
sil [escapes !%0.**, !%1, %1.c*.v** => %0.v**] @foo : $@convention(thin) (@guaranteed T) -> @out S {
bb0(%0 : $*S, %1 : @guaranteed $T):
...
```

As we are adding more argument effects, this becomes unreadable.
To make it more readable, print the effects after the opening curly brace, and print a separate line for each argument. E.g.
```
sil [ossa] @foo : $@convention(thin) (@guaranteed T) -> @out S {
[%0: noescape **]
[%1: noescape, escape c*.v** => %0.v**]
bb0(%0 : $*S, %1 : @guaranteed $T):
...
```
…parison-to-optional.none-case

Add warning when comparing a non-optional value to `Optional.none`
SIL: make argument effects more readable in textual SIL
hyp and others added 5 commits September 12, 2022 07:12
Avoid introducing extra terminology via an underscored attribute.

rdar://99723104
[Dependency Scanner] Ensure the Clang dependency scanner working directory matches the invocation.
artemcm and others added 16 commits September 12, 2022 10:30
[Dependency Scanner] Add API to query emitted diagnostics during a scan
…ations

[stdlib] _modify: Ensure cleanup is always executed
[interop] pass and return C++ value types to/from Swift in C++
…ursive-properties-bug

Fix bug with lexical recursive property.
There are a bunch of places where we expect to find a record with a particular record ID/kind in the decls_block and have to bail out if we see something we don’t expect. Add an `InvalidRecordKindError` we can use in this situation to produce a useful error message and adopt it in various places.

This change also makes deserialization errors print the path to the invalid file.
[Sema] Integrate `@_spiOnly` imports logic with recent API checks
[Dependency Scanner] Use Clang scanner's module name query API instead of creating a dummy file
Avoid generating address phis in LoopUnroll
[interop] use C++ value types bridged to Swift in Swift generic context from C++
@kateinoigakukun kateinoigakukun merged commit cd56cf3 into swiftwasm Sep 13, 2022
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.