Skip to content

Merge main 2021-10-08 #3675

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 101 commits into from
Oct 8, 2021
Merged

Merge main 2021-10-08 #3675

merged 101 commits into from
Oct 8, 2021

Conversation

kateinoigakukun
Copy link
Member

No description provided.

xedin and others added 30 commits September 20, 2021 17:22
Following pointer conversions are supported in argument positions (when referencing C/ObjC functions):

- Unsafe[Mutable]RawPointer -> Unsafe[Mutable]Pointer<[U]Int>
- Unsafe[Mutable]Pointer<Int{8, 16, ...}> -> Unsafe[Mutable]Pointer<UInt{8, 16, ...}>
Allow following conversions in argument positions
(applies only to call to imported C/ObjC declarations):

- Unsafe[Mutable]RawPointer -> Unsafe[Mutable]Pointer<[U]Int>
- Unsafe[Mutable]Pointer<Int{8, 16, ...}> <-> Unsafe[Mutable]Pointer<UInt{8, 16, ...}>
…onal types

Support Swift -> C pointer conversions even if argument required
a value to optional promotion or is optional.
Make sure that conversions are properly supported when arguments
either is wrapped in an optional type or requires a value-to-optional
promotion because parameter is optional pointer.
…nversions

Just like other implicit conversions - always prefer solutions with
the lowest possible number of them.
This is a skeleton of a fix that would be used to diagnose situations
when Swift -> C pointer conversion was attempted on a Swift function.
…sion

Diagnose situations where Swift -> C pointer implicit conversion
is attempted on a Swift function instead of one imported from C header.

```swift
func test(_: UnsafePointer<UInt8>) {}

func pass_ptr(ptr: UnsafeRawPointer) {
  test(ptr) // Only okay if `test` was an imported C function.
}
```
…s for optionals

Wait for a value-to-optional promotion or optional-to-optional conversion
to happen before attempting Swift -> C pointer conversion.
Detect and diagnose situations when Swift -> C pointer conversion
is unsupported due to method not being imported from C header.
Summary:
As part of SR-14273, the type layout infrastructure needs to be able to be able
to differentiate between types of scalars so it knows how to release/retain
appropriately. Right now, for example, to destroy a scalar, it blindly calls
into typeInfo's irgen functions which means it's not able to generate any of
the needed information for itself.

This patch adds a field to ScalarTypeLayout to allow them to know what kind of
reference they are and strings through the machinery to provide the information
to set it.

This also moves ScalarTypeLayout::destroy to use the new information.

Test Plan: ninja check-swift

Reviewers: mren, #pika_compiler

Reviewed By: mren

Subscribers: apl, phabricatorlinter

Differential Revision: https://phabricator.intern.facebook.com/D30983093

Tasks: T100580959

Tags: swift-adoption

Signature: 30983093:1632340205:3bdd3218ae86ad6b3d199cc1b504a625e3650ec0
The test checks that the Swift module interface for `std` & its submodules can be generated & that it contains a couple of known declarations.
…ceAccessPath()

We would skip recording a conformance access path if the subject
type canonicalized to a concrete type, but this was incorrect.

The correct formulation is to use the _canonical anchor_ and not
the canonical type as the caching key; that is, we always want it
to be a type parameter, even if it is fixed to a concrete type,
because type parameters fixed to concrete types can appear in
the middle of conformance access paths, as the example in the
radar demonstrates.

Fixes rdar://problem/83687967.
This fixes the IRGen side of rdar://problem/83687967.
Add ModuleInterface option meta tag for -module-alias
Add tests loading modules with -module-alias for swiftmodule and swiftinterface
with various loaders incl. serialized, explicit, and source loader.
As per the C++14 spec, $ can't be used in a portable way in an
identifier name. It falls under the implementation-defined characters
and is allowed by clang. Removing it.
xedin and others added 25 commits October 6, 2021 14:35
…-conversions

[TypeChecker] Implement limited set of conversions between Swift and C pointers
Co-authored-by: Guillaume Lessard <glessard@users.noreply.github.com>
…ent_for_at_specialize

Add support for `availability` to `@_specialize`
The priority escalation doesn't work quite as I thought it did. It isn't
whichever is greater, the priority of the task or the priority of the
place awaiting the result of the task. It seems to be less reliable than
that. I've changed the test accept either a default priority or that of
the main thread.
…opy-test

[Concurrency] Harden async_task_locals_copy_to_sync
[Module Aliasing] Modify module loaders to use module 'real name' (physical name on-disk) when loading, since it can be different from 'name' if module aliasing is used. Also use the 'real name' to add/retrieve loaded modules in ASTContext. Resolves rdar://83591943.
…ealloc_value_buffer instructions.

Those instructions were use for the materializeForSet implementation, which was replaced by modify-coroutines.
Update the python version to python3 for swift-api-checker.py
…-insts

SIL: remove the unused alloc_value_buffer, project_value_buffer and dealloc_value_buffer instructions.
SR-13976: Improve compiler error message: "partial application of ‘mutating’ method is not allowed"
…rity-check

Fix async_task_priority_current priority escalation test
…-module

[cxx-interop] Print decls in the __ObjC module.
@kateinoigakukun kateinoigakukun marked this pull request as ready for review October 8, 2021 12:36
@kateinoigakukun kateinoigakukun merged commit 9ac80ce into swiftwasm Oct 8, 2021
@kateinoigakukun kateinoigakukun deleted the katei/merge-main-2021-10-08 branch October 9, 2021 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.