Skip to content

Resolve conflicts with upstream main #3611

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 55 commits into from
Sep 29, 2021
Merged

Resolve conflicts with upstream main #3611

merged 55 commits into from
Sep 29, 2021

Conversation

MaxDesiatov
Copy link

The only conflict was caused by f34e321

amritpan and others added 30 commits August 31, 2021 09:28
…l and consolidate all checks for argument and parameter label matches into new Param member function.
Once this flag is set, the type checker will bail out with a “expression to complex” error.
This commit refactors the way ASTs are being built in SourceKit and how `SwiftASTConsumer`s are served by the built ASTs. `SwiftASTManager.h` should give an overview of the new design.

This commit does not change the cancellation paradigm in SourceKit (yet). That is, subsequent requests with the same `OncePerASTToken` still cancel previous requests with the same token. But while previously, we were only able to cancel requests that haven’t started an AST build yet, we can now also cancel the AST build of the to-be-cancelled requests.

With this change in place, we can start looking into explicit cancellation of requests or other cancellation paradigms.
These should be obviously correct changes. These issues are exposed by our test suite after swiftlang#38675 is applied.
Validate input and set up the module alias map
rdar://83316886
More specific diag msgs
Add tests
This avoids a hashtable lookup when performing queries.
The use of the term 'uninhabited' does not make sense outside of formal type theoretic contexts. In Swift, we also do not use this term in a standard way - hence the term "structurally uninhabited" since we only consider products and sums eligible for the check. (Aside: We do not do exponentials because... well, Swift's type system implements Harper's "typerec" operator and as a consequence parametricity is just _not a thing_). I digress...

So, improve upon the old diagnostic in two ways:
1) Do away with 'uninhabited' - instead, mention that it's either an enum or a tuple with an enum in it that 'has no cases'
2) Since the SIL parameter convention flattens all tuples, point directly at the offending uninhabited element type

rdar://83600669
Previously, there was only a frontend flag to influence the LangOpts
struct.  Now, the flag can be set when running sil-opt which is
important for testing.
Previously, the addArgumentToBranch only allowed one to add a single
additional argument to a branch.  It then verified the argument count.
That is a problem if multiple arguments have to be added to arrive at
the correct argument count.

Specifically, that was a problem when running Mem2Reg on a lexical
alloc_stack, where three new phi arguments are added.

Here, the function name is changed to addArgumentsToBranch (plural
arguments) and the function accepts a SmallVector<SILValue> rather than
a single SILValue, allowing one to add all the arguments that are
necessary in order to verify that the resulting number of arguments is
correct.
When the -enable-experimental-lexical-lifetimes flag is enabled, the
alloc_stack instructions which the pass replaces alloc_box instructions
with have the lexical attribute.
SILGen turns vars into alloc_boxes.  When possible, AllocBoxToStack
turns those into alloc_stacks.  In order to preserve the lexical
lifetime of those vars, the alloc_stacks are annotated with the
[lexical] attribute.  When Mem2Reg runs, it promotes the loads from
and stores into those alloc_stacks to uses of registers.  In order to
preserve the lexical lifetime during that transformation, lexical borrow
scopes must be introduces that encode the same lifetime as the
alloc_stacks did.  Here, that is done.
…le-lookup

AST: GenericSignatures point directly to their RequirementMachine
The goal here is not to eventually implement a concurrent thread
pool ourselves.  We're just making it easier for integrators who
have their own pool and don't want to use Dispatch to build the
Swift concurrency runtime.  Just hook the right functions and
you should be fine.

The necessary functions to hook are:
- swift_task_enqueueGlobal
- swift_task_enqueueGlobalAfterDelay

The following functions *would* be necessary to hook:
- swift_task_enqueueMainExecutor
- swift_task_asyncMainDrainQueue (only if you have an async main?)
However, this configuration does not currently properly support
the main executor, and so `@MainActor` should be avoided for now.

rdar://83513751
Redo The Notes For "Uninhabited" Parameter Types
This is a case where a constructor overload choice
might currently have an optional opened type, so
make sure we can handle it. Arguably we shouldn't
even be introducing constructors into the overload
set here though, as it's invalid anyway.
nate-chandler and others added 25 commits September 28, 2021 07:34
Thanks to Erik for catching this. The instruction doesn't have an
operand.  It creates storage.  The lexical attribute indicates that the
storage corresponds to a source-level variable.
Adding build modes for libswift: off, hosttools, bootstrapping, bootstrapping-with-hostlibs
The two bootstrapping modes are new. For details see libswift/README.md
…ss-concurrency-builds

Revert "Allow building a concurrent libSwiftConcurrency without libdispatch"
Ignore `_M_realloc_insert` from the C++ standard library which is over-exported in libstdc++.
…tion

[SourceKit] Support cancellation of requests while an AST is being built
Introduce a module alias option to the frontend. Validate and convert the input to a module alias map to be used by import resolution and sema. rdar://83316886
…ndencies

These will be used by the RequirementMachine to compute requirement
signatures. For now, they're not hooked up.

ProtocolDecl::getStructuralRequirements() produces a list of Requirements
with SourceLocs from the structural types written in the protocol's
inheritance clause and 'where' clauses.

ProtocolDecl::getProtocolDependencies() produces a list of protocols which
appear on the right hand side of the protocol's conformance requirements.
ClangImporter: don't import clang SPI attributes by default
…rance

Update symbol-visibility-linux.test-sh
RequirementMachine: Don't forget to delete requirement machines when freeing the RewriteContext
…ements

AST: Add request to compute protocol structural requirements and dependencies
FileCheck on the rebranch doesn't allow undefined variables. If the
variable is defined in a CHECK-NOT and the CHECK-NOT doesn't get hit,
the variable isn't actually defined.
[CSSimplify] Fix a bug where the omitted projected value label was missing as an acceptable parameter label for property wrappers
…filecheck-vars

Removing undefined variables from mem2reg_lifetime.sil
# Conflicts:
#	stdlib/public/Platform/POSIXError.swift
@MaxDesiatov MaxDesiatov merged commit bbac657 into swiftwasm Sep 29, 2021
@MaxDesiatov MaxDesiatov deleted the maxd/main-merge branch September 29, 2021 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.