Skip to content

[pull] swiftwasm from main #2953

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 22 commits into from
Apr 8, 2021
Merged

[pull] swiftwasm from main #2953

merged 22 commits into from
Apr 8, 2021

Conversation

pull[bot]
Copy link

@pull pull bot commented Apr 8, 2021

See Commits and Changes for more details.


Created by pull[bot]

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

adrian-prantl and others added 22 commits April 6, 2021 17:17
so it can be called by LLDB. (NFC).

rdar://76112632
…ompletion

The test has been migrated to batch completion, there is no need to have individual `RUN:` lines for new code completion tokens.
This

1. fixes a bug, where we didn't consider that an object can escape via a function call. The pass issued a false warning in this case.

rdar://76115467

2. improves the accuracy by doing a simple form of interprocedural analysis. E.g. it now can see if a weak store is done in a called function.

rdar://76297286
The cross-module reference must be indirected through the moral
equivalent of the GOT - the IAT.  This indirects through the import
address table, permitting the pointer to be resolved.
…sibleByNilLiteral`

I couldn't come up with an isolated test-case to add to the suite,
but it's possible that `getProtocol` returns `nullptr` for invalid
or missing protocol so there has to be a check for that otherwise
compiler is going to crash trying to access `getDeclaredType()`.

Resolves: rdar://76187450
`@noDerivative` was not mangled in function types, and was resolved incorrectly when there's an ownership specifier. It is fixed by this patch with the following changes:

* Add `NoDerivative` demangle node represented by a `k` operator.
    ```
    list-type ::= type identifier? 'k'? 'z'? 'h'? 'n'? 'd'?  // type with optional label, '@noDerivative', inout convention, shared convention, owned convention, and variadic specifier
    ```
* Fix `NoDerivative`'s overflown offset in `ParameterTypeFlags` (`7` -> `6`).
* In type decoder and type resolver where attributed type nodes are processed, add support for nested attributed nodes, e.g. `inout @noDerivative T`.
* Add `TypeResolverContext::InoutFunctionInput` so that when we resolve an `inout @noDerivative T` parameter, the `@noDerivative T` checking logic won't get a `TypeResolverContext::None` set by the caller.

Resolves rdar://75916833.
The address of the function to be called when generating code to invoke
the function associated with FunctionPointer which is produced via
direct reference is by definition statically known; it is neither necessary
nor desireable to load this address out of the AsyncFunctionPointer
corresponding to the function.

Here, that spurious additional work is skipped.  The approach is to add
a second value to the FunctionPointer struct.  For FunctionPointers
whose kind is AsyncFunctionPointer, this value is either null or else
the address of the corresponding function.

rdar://71376092
…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.
…lding requirement signatures

Once we can rebuild requirement signatures after dropping redundant
requirements, we won't need this at all.
DiagnoseLifetimeIssues: handle called functions.
[CodeCompletion] Remove test lines that are already run using batch completion
…ived-via-concrete

GSB: Start purging the notion of "derived via concrete" requirements
[CSSimplify] Add a null check to guard against broken/missing `Expres…
* Implement a YieldingContinuation type suitable for emitting values more than once via a yielding family of functions and awaiting production via next

* Add availability for YieldingContinuation and tests

* remove UnsafeConcurrentValue

* use UnsafeSendable for now

* Ensure the testing contexts are actually async

* Change the usages of Task.runDetached to Task.detach

* Change the usages of Task.detach to detach

* Transition to a external storage class outside of the generic, move to acqrel atomics, and change the error type to be enforced to Error existentials for next.

* Apply suggestions from code review

Co-authored-by: Nate Cook <natecook@apple.com>

* Remove inlines to allow for resilient changes

* Add unreachable cases in testing

Co-authored-by: Nate Cook <natecook@apple.com>
Make the function to compute the prebuilt module cache path public
…xecutor_in_no_async

hop_to_executor should have no affect if we inline a [noasync] applyinto a non async function.
@MaxDesiatov MaxDesiatov enabled auto-merge April 8, 2021 21:29
@MaxDesiatov MaxDesiatov merged commit 1c5516c into swiftwasm Apr 8, 2021
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.