Skip to content

Merge master 2020-07-04 #1370

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 60 commits into from
Jul 4, 2020
Merged

Conversation

kateinoigakukun
Copy link
Member

@kateinoigakukun kateinoigakukun commented Jul 4, 2020

OnyekachiSamuel and others added 30 commits June 27, 2020 05:48
- update the diagnostic error message
- add educational notes
Make the `round-trip-syntax-test` tool Python 3 friendly by tweaking the
open modes and using `reduce` from `functools` as it has been removed in
Python 3.
Adjust the regex match to do a better job of sanitizing the paths.  This
improves the test coverage pass rate with Python 3.  Furthermore, handle
the unicode conversion properly that breaks with Python 3.  This further
improves the Python 3 test coverage pass rate.
Try harder to appease the python linter
See swiftlang#30391, swiftlang#30296. Neither IRGen/conditional_conformances.swift nor
IRGen/class_resilience.swift pass on OpenBSD unless
target_mandates_stable_abi = TRUE.
…debase"

Removes usage of #canImport(Darwin) from stdlib/public.

This reverts a subset of commit cddf73e.
…get-all-nested-types

AST: Remove unused ArchetypeType::getAllNestedTypes() method
This improves incremental rebuild performance.
Darwin 55 is now translated to macOS 46 after the LLVM changes landed that added support for macOS 11. This change temporarily disables the RUN line in the test that uses the `darwin55` triple until the appropriate fix is upstreamed on the swift side.
…-the-corona-away

PathSanitizingFileCheck: improve Python3 compatibility
…m-interface action

The situations where we use this action, e.g. explicit module building and
generating prebuilt module cache, don't need synchronization. We should avoid
using lock files for them.

rdar://65005528
…ft-run-line

Disable a RUN line in osx-targets.swift
Front-end: disable interface file locking for the -compile-module-from-interface action
test: make `round-trip-syntax-test` Python 3 friendly
This allows the lit configuration to be python 2 and 3 compatible.
…-protocol-diagnostic

[Diagnostics] Fix Confusing Protocol Diagnostic
* SR-12486: `T.self is Any.Protocol` is broken

This turned out to be fallout from swiftlang#27572
which was in turn motivated by our confusing metatype syntax when generic variables are bound to protocols.

In particular, the earlier PR was an attempt to make the expression
`x is T.Type` (where `T` is a generic type variable bound to a protocol `P`)
behave the same as
`x is P.Type` (where `P` is a protocol).
Unfortunately, the generic `T.Type` actually binds to `P.Protocol` in this case (not `P.Type`), so the original motivation was flawed, and as it happens, `x is T.Type` already behaved the same as `x is P.Protocol` in this situation.

This PR reverts that earlier change and beefs up some of the tests around these behaviors.

Resolves SR-12486

Resolves rdar://62201613

Reverts PR#27572
Previously we would only gather one-way constraints
if they were found through a type variable in their
right hand side. However we would incorrectly check
this against the type variable that we started the
search at. This meant that if the constraint was
found through a fixed binding, we would never
return it, and could therefore fail to re-activate
it, leaving it unsolved.

Fix this issue by simply removing the check for
the RHS, and letting the constraint system handle
it instead.

Resolves rdar://64890308.
zoecarver and others added 26 commits July 2, 2020 15:07
Adds a basic test that the synthesized C++ constructor was generated correctly.
…ity-test

Fix symbol visibility test for CentOS 7
… be statically known (swiftlang#32592)

* [TypeCheckConstraints] Adjusting cases where checked casts that cannot be determined statically were producing misleading warnings

* [tests] Adding regression tests for SR-13088

* [TypeCheckConstraints] Adjusting comment and adding an extra test case for SR13035

* [TypeCheckConstraints] Fixing typos in comments

* [AST] Moving implementation of isCollection from ConstraintSystem to AST TypeBase

* [TypeCheckConstraints] Adjusting logic to verify specific conformance to stdlib collection type before emit an downcast warning

* [TypeCheckConstraints] Creating new CheckedCastContextKind::CollectionElement to be able to verify special cases within typeCheckCheckedCast for collection elements

* [TypeCheckConstraints] Adjusting logic around generic substitution to check both subtype and supertype

* [Sema] Adding isKnownStdlibCollectionType and replacing all usages contraint system method

* [TypeChecker] Reverting fixes around array element types

* [TypeChecker] Abstract logic of check for conditional requirements on TypeChecker::couldDynamicallyConformToProtocol

* [TypeChecker] Ajdustinc can conformDynamically conform and adjust review comments

* [TypeChecker] Ajusting comments and fixing typos

* [TypeChecker] Adjusting existential and archetype logic to check inside couldDynamicConform

* [TypeChecker] Adjusting minor and adding existential check into couldDynamically conform.

* [TypeChecker] Adjusting comments
[CS] Avoid checking RHS of one-way constraint for reactivation
[EduNotes] Explain some opaque type diagnostics
…ableAPI

[test] Add OpenBSD to stable ABI testing targets.
This adds support to `ClangImporter` to import C++ member function operators as static methods into Swift, which is part of SR-12748.

The left-hand-side operand, which gets passed as the `this` pointer to the C++ function is represented as an additional first parameter in the Swift method. It gets mapped back in SILGen.

Two of the tests are disabled on Windows because we can't yet call member functions correctly on Windows (SR-13129).
[SIL] NFC: Move #include of CanTypeVisitor.h
[SIL] NFC: Add more paranoia checks to SILType
Array literals only need to be finalized, if the array is really allocated.
In case of zero elements, no allocation is done, but the empty-array singleton is used.
"Finalization" means to emit an end_cow_mutation instruction on the array.
As the empty-array singleton is a read-only and shared object, it's not legal to do a end_cow_mutation on it.
…builds.

This was blocked by an LLDB problem, which is now fixed (swiftlang/llvm-project#1333)
…eralKeyPath)"

This reinstates commit d7d829c with a fix for C tail-allocated arrays.

Replace a call of the getter of AnyKeyPath._storedInlineOffset with a "constant" offset, in case of a keypath literal.
"Constant" offset means a series of struct_element_addr and tuple_element_addr instructions with a 0-pointer as base address.
These instructions can then be lowered to "real" constants in IRGen for concrete types, or to metatype offset lookups for generic or resilient types.

Replace:
  %kp = keypath ...
  %offset = apply %_storedInlineOffset_method(%kp)
with:
  %zero = integer_literal $Builtin.Word, 0
  %null_ptr = unchecked_trivial_bit_cast %zero to $Builtin.RawPointer
  %null_addr = pointer_to_address %null_ptr
  %projected_addr = struct_element_addr %null_addr
   ... // other address projections
  %offset_ptr = address_to_pointer %projected_addr
  %offset_builtin_int = unchecked_trivial_bit_cast %offset_ptr
  %offset_int = struct $Int (%offset_builtin_int)
  %offset = enum $Optional<Int>, #Optional.some!enumelt, %offset_int

rdar://problem/53309403
…checks

stdlib: enable runtime checking for COW support by default in assert builds.
Reinstate "SILCombine: Constant-fold MemoryLayout<T>.offset(of: \.literalKeyPath)"
…r and _swift_isImmutableCOWBuffer to sync calling convention
@MaxDesiatov MaxDesiatov merged commit 2724f61 into swiftwasm Jul 4, 2020
@kateinoigakukun kateinoigakukun deleted the katei/merge-master-2020-07-04 branch July 5, 2020 00:20
@kateinoigakukun kateinoigakukun restored the katei/merge-master-2020-07-04 branch August 7, 2020 18:25
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.