forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 30
Merge main 2023-02-20 #5308
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 2023-02-20 #5308
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
This is basically an attempt to expand the test harness to fully dump indirect enums using the existing RemoteMirror facilities.
…type of a called overload rdar://97339983
The `RTL_SRWLOCK_INIT` declaration got reformatted and doesn't exactly match what's in `windows.h`, so we're getting warnings during builds. Fix to match what it says in the system header. rdar://105400572
Avoid dropping stderr output, this can be important for diagnosing failures.
Twine is an intermediate reference and should not be constructed to hold the value. An unowned string piece should be referenced by `StringRef`. This now provides storage for the name. We would previously see invalid memory usage due to the Twine being destroyed before the use in the `CreateLoad` invocation.
Rename the env var to SWIFT_IGNORE_SWIFTMODULE_REVISION as it's recommended for use outside of testing.
…ag check Weaken the precise tag check at loading swiftmodule to accept binary modules build by a compiler with a tag where only the last digit is different. We assume that the other digit in the version should ensure compiler and stdlib compatibility. If the last digit doesn't match, still raise a remark. rdar://105158258
Speculatively fixing this to rule out potential miscompiles. The compiler needs to know if a reference is being materialized out of thin air. The proper way to do that is with the Unmanaged API. Under the hood, this forces the reference into an "unowned(unsafe)" variable which the reference must be reloaded from. That tells the compiler that it can't optimize some seemingly unrelated object which the reference may happen to refer to at runtime. /// Warning: Casting from an integer or a pointer type to a reference type /// is undefined behavior. It may result in incorrect code in any future /// compiler release. To convert a bit pattern to a reference type: /// 1. convert the bit pattern to an UnsafeRawPointer. /// 2. create an unmanaged reference using Unmanaged.fromOpaque() /// 3. obtain a managed reference using Unmanaged.takeUnretainedValue() /// The programmer must ensure that the resulting reference has already been /// manually retained.
…n application target whose result is not unused This happens if the code completion expression initializes a variable in a multi-statement closure that doesn’t have LeaveClosureBodiesUnchecked set.
…sed code completion
…ode completion token
…iesunchecked [CodeCompletion] Eliminate LeaveClosureBodiesUnchecked for solver-based code completion
[test] Disallow block convention on non ObjC interop test
IRGen: correct Twine handling
`std::map` conformance to `CxxDictionary` is synthesized properly, only the `std::unordered_map` conformance is problematic. Let's make sure we test the `std::map` conformance with libstdc++ on Linux.
[Threading][Win32] Fix a warning.
Adjust the IRGen to always set the calling convention and then the noexcept bit. This makes it easier to quickly scan through the attributes for the async calls which was useful for some Concurrency related work on Windows.
Disabling these tests: IRGen/ptrauth-foreign.sil IRGen/ptrauth_field_fptr_import.swift Interop/SwiftToCxx/class/swift-class-virtual-method-dispatch-arm64e.swift Interop/SwiftToCxx/class/swift-class-virtual-method-dispatch.swift Interop/SwiftToCxx/class/swift-subclass-of-resilient-class-virtual-method-dispatch.swift
…iority-test [Test] Disable failing async_task_priority test.
rdar://105255151
…move-only [WIP] Treat nonescaping closure types as owned types in SIL; use borrowing to model capture lifetimes
… copy and asks to file a bug.
…VarCarryingInst and VarDeclCarryingInst.
I am using this query a lot in SILGen when adding support for escaping captures. Makes sense to chop it off into a nice little helper on SILType.
…a SILBoxType from the SILType field for you.
Just treating it the same as copy_addr as expected.
This works by emitting an object level copy_addr if an address type is loadable (that is using load [take] + store [init] instead of copy_addr).
…sform. Specifically, our operand /could/ be a SILArgument. In that case, oldInst in all of these cases will be a nullptr. So make sure to only delete them if we actually found a defining instruction.
SIL: add type-dependent operands to the `keypath` instruction
…ship specifier. Otherwise, we cannot parse our own compiler output around guaranteed boxes. I discovered this when writing tests for the next commit. rdar://105635396
…pe, move mark_must_check onto alloc_stack and always ensure that we use consumable_to_assign. What this patch is does is add an extra phase after alloc_box runs where we look at uses of the alloc_stack and if we see any mark_must_check of any kind, we delete them and rewrite a single mark_must_check [consumable_and_assignable] on the alloc_stack and make all uses of the alloc_stack go through the mark_must_check. This has two effects: 1. In a subsequent PR when I add noncopyable semantics for escaping closures, this will cause allocbox to stack to convert such boxes from having escaping semantics to having non-escaping semantics. Escaping semantics means that we always reproject out from the box and use mark_must_check [assignable_but_not_consumable] (since we can't consume from the box, but can assign to it). In contrast, non-escaping semantics means that the box becomes an alloc_stack and we use the traditional var checker semantics. NOTE: We can do this for lets represented as addresses and vars since the typechecker will validate that the let is never actually written to even if at the SIL level we would allow that. 2. In cases where we are implementing simple mark_must_check [consumable_and_assignable] on one of the project_box and capture the box, we used to have a problem where the direct box uses would be on the alloc_stack and not go through the mark_must_check. Now, all uses after allocbox_to_stack occur go through the mark_must_check. This is why I was able to remove instances of the "compiler does not understand this pattern" errors... since the compiler with this change can now understand them.
…9bebea882b8440c37c9457c [move-only] A few small changes in preparation for a larger patch
…at we only run cleanups once. Otherwise, sometimes when the object checker emits a diagnostic and cleans up the IR, some of the cleaned up copies are copies that should have been handled by the address checker. The end result is that the address checker does not emit diagnostics for that IR. I found this problem was exascerbated when writing code for escaping closures. This commit also cleans up the passes in preparation for at a future time moving some of the transformations into the utils folder.
build: avoid installing static libraries
Later parts of the pipeline do not know about the instruction, so we need to lower it there. This is additionally safe since we will not be performing move only checking later in the pipeline.
…le (swiftlang#63770) This essentially passes the members of a linear map tuple as individual arguments. It yields few nice simplifications: * No linear map tuples at all for getters / setters * No tuple formation / deconstruction around pullbacks * Pullbacks with loops still use heap-allocated tuples
…50dfe28218e987bc0619c1e [gardening] Delete unused variable.
…003b3c09e5424293521ef2d [move-only] Combine the address/object checker in the same pass so that we only run cleanups once.
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.