Skip to content

Merge 2020-03-13 #387

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 216 commits into from
Mar 14, 2020
Merged

Conversation

kateinoigakukun
Copy link
Member

Resolve conflict

kubamracek and others added 30 commits February 27, 2020 16:08
…otes

Currently the printer only supports the subset of markdown used by
educational notes. It bolds headers, improves the appearance of lists
and horizontal rules, and does basic indenting of blockquotes and
code blocks.
…sRuntimeStub` under the `SWIFT_BUILD_STDLIB` check

Since the stub for BlocksRuntime library is to "be used for the reflection tests", don't set it up unless the reflecting tests are also setup.
…under-stdlib

[CMake] Move the `_add_swift_target_library_single()` call for `BlocksRuntimeStub` under the `SWIFT_BUILD_STDLIB` check
In order to allow this, I've had to rework the syntax of substituted function types; what was previously spelled `<T> in () -> T for <X>` is now spelled `@substituted <T> () -> T for <X>`.  I think this is a nice improvement for readability, but it did require me to churn a lot of test cases.

Distinguishing the substitutions has two chief advantages over the existing representation.  First, the semantics seem quite a bit clearer at use points; the `implicit` bit was very subtle and not always obvious how to use.  More importantly, it allows the expression of generic function types that must satisfy a particular generic abstraction pattern, which was otherwise impossible to express.

As an example of the latter, consider the following protocol conformance:

```
protocol P { func foo() }
struct A<T> : P { func foo() {} }
```

The lowered signature of `P.foo` is `<Self: P> (@in_guaranteed Self) -> ()`.  Without this change, the lowered signature of `A.foo`'s witness would be `<T> (@in_guaranteed A<T>) -> ()`, which does not preserve information about the conformance substitution in any useful way.  With this change, the lowered signature of this witness could be `<T> @Substituted <Self: P> (@in_guaranteed Self) -> () for <A<T>>`, which nicely preserves the exact substitutions which relate the witness to the requirement.

When we adopt this, it will both obviate the need for the special witness-table conformance field in SILFunctionType and make it far simpler for the SILOptimizer to devirtualize witness methods.  This patch does not actually take that step, however; it merely makes it possible to do so.

As another piece of unfinished business, while `SILFunctionType::substGenericArgs()` conceptually ought to simply set the given substitutions as the invocation substitutions, that would disturb a number of places that expect that method to produce an unsubstituted type.  This patch only set invocation arguments when the generic type is a substituted type, which we currently never produce in type-lowering.

My plan is to start by producing substituted function types for accessors.  Accessors are an important case because the coroutine continuation function is essentially an implicit component of the function type which the current substitution rules simply erase the intended abstraction of.  They're also used in narrower ways that should exercise less of the optimizer.
…ion-subs

Distinguish invocation and pattern substitutions on SILFunctionType
… through argument conversions"

Reverts swiftlang#30006. It caused a regression that we'd like to address before re-landing:

```swift
struct X {
  var cgf: CGFloat
}

func test(x: X?) {
  let _ = (x?.cgf ?? 0) <= 0.5
}
```

This reverts commit 0a6b444.
This reverts commit ed25559.
This reverts commit 3e01160.
This reverts commit 96297b7.

Resolves: rdar://problem/60185506
Add arm64e and pointer authentication support for Swift
Revert "[ConstraintSystem] Make it possible to infer subtype bindings…
Because violations of this might have made an AbstractionPattern incorrectly show up as abstract, it's possible that this will cause an ABI change.  However, I haven't been able to find any examples where it does, and certainly there's no way we can promise to maintain the old behavior, especially since it's not done consistently.
…al-abstraction-patterns

Require types to be contextually canonical in AbstractionPatterns
This enables the use of `TransmitFile` more fully by adding the
Microsoft extensions to the WinSock module.
ravikandhadai and others added 19 commits March 12, 2020 12:42
new closures when all captures of the symbolic closure, including address-typed
captures, are symbolic constants. For other closures, they must have been
autoclosures passed to the log call and therefore they need not be duplicated
but reused as such.

This eliminates the need to copy_value the non-constant captured values of
closures. Instead the closure itself is copied as a whole.

Fixes <rdar://problem/60344043>
[Serialization] Bump swiftmodule version number
…rop-external-2

[test/Index] Add a test case for cross-language USR generation fix on the clang side
IRGen/conditional_conformances.swift was failing because Android AArch64
was taking the non ABI stable checks, but generating the ABI stable
code.
Attempt to prevent CI failure with debug stdlib
Partially revert "Keep gyb from messing up line endings on Windows"
…o-abi-stable

[android][aarch64] Add Android to set of stable ABI testing targets.
[CodeCompletion] Call argument label with value placeholder
…nteed-captures

[OSLogOptimization] Fix folding of symbolic closures to handle @in_guaranteed captures
MaxDesiatov
MaxDesiatov previously approved these changes Mar 13, 2020
@@ -12,6 +12,7 @@ $SWIFT_PATH/utils/build-script --wasm \
-DSWIFT_BUILD_SOURCEKIT=FALSE \
-DSWIFT_ENABLE_SOURCEKIT_TESTS=FALSE \
-DSWIFT_BUILD_SYNTAXPARSERLIB=FALSE \
-DSWIFT_INCLUDE_TESTS=FALSE \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this disable all the tests on macOS completely? Or is there no way to keep the tests, but just to avoid building Block for wasm?

Copy link
Member Author

@kateinoigakukun kateinoigakukun Mar 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I didn't intended to disable all the tests. I reverted this and disabled only BlocksRuntime

@kateinoigakukun
Copy link
Member Author

@MaxDesiatov It's ready for merge

Copy link

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 🙏

@kateinoigakukun kateinoigakukun merged commit be7c9b5 into swiftwasm:swiftwasm Mar 14, 2020
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.