forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Merge main 2021-10-08 #3675
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, ...}>
…rgument to C/ObjC imported decl
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.
…ts only on Darwin
…ication into a separate method
…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.
This is one change from swiftlang#38675.
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.
rdar://83186214
rdar://83591943
…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.
…-conversions [TypeChecker] Implement limited set of conversions between Swift and C pointers
Co-authored-by: Guillaume Lessard <glessard@users.noreply.github.com>
…TS_BACKTRACE_REPORTING flag (swiftlang#39598)
…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"
Resolves rdar://82954270
…rity-check Fix async_task_priority_current priority escalation test
…-module [cxx-interop] Print decls in the __ObjC module.
MaxDesiatov
approved these changes
Oct 8, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.