Skip to content

[pull] swiftwasm from main #5529

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 51 commits into from
Jun 16, 2023
Merged

[pull] swiftwasm from main #5529

merged 51 commits into from
Jun 16, 2023

Conversation

pull[bot]
Copy link

@pull pull bot commented Jun 16, 2023

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

compnerd and others added 30 commits June 9, 2023 16:32
This corresponds to swiftlang/swift-installer-scripts#207 which restructures
the MSIs and enables a number of new features.  It switches us to:
- durable GUIDs which will enable upgrades
- enables dual-purpose MSIs
- switches the installer to per-user installs
- should drop the requirement on Administrator rights
- splits the MSIs into smaller chunks to provide a nicer installer
  experience
- reduces the complexity in the management of the manifest
Translation of swiftlang/swift-driver#1374 to the legacy C++ Driver, with the
addition of a test.
This substitution can be used to run tests under the -no-opaque-pointers
option.
This is necessary until the Xcode toolchain's libLTO.dylib supports opaque pointers
Based on swiftlang#66409

With the observation that the pre-opaque world was using bitcast as an
indication that the storage type and the type of the variable were
different. We can recover this information from the storage type of the
alloca and the storage type of the type info.
'load-plugin-library', 'load-plugin-executable', '-plugin-path' and
'-external-plugin-path' should be searched in the order they are
specified in the arguments.

Previously, for example '-plugin-path' used to precede
'-external-plugin-path' regardless of the position in the arguments.
UnresolvedSpecializeExpr.

The eager generic argument matching code in CSGen for unresolved
specializations was incorrect because it didn't account for parameter
packs. Fortunately, a constraint to delay explicit generic argument
matching already exists for macros. Use it here.
SILGen expects this of values before we enter general routines.

Fixes rdar://109911655
variadic-tuple results.  There are three parts to this.

First, fix the emission of indirect result parameters to do a
proper abstraction-pattern-aware traversal of tuple patterns.
There was a FIXME here and everything.

Second, fix the computation of substituted abstraction
patterns to properly handle vanishing tuples.  The previous code
was recursively destructuring tuples, but only when it saw a
tuple as the substituted type, which of course breaks on vanishing
tuples.

Finally, fix the emission of returns into vanishing tuple
patterns by allowing the code to not produce a TupleInitialization
when the tuple pattern vanishes.  We should always get a singleton
element initializer in this case.

Fixes rdar://109843932, plus a closely-related test case for
vanishing tuples that I added myself.
[Driver] Remove unused runtime library path on non-Darwin platforms
…s-109798110

Observation reference documentation
[test] Require asserts for a couple of tests
Fix a pair of SILGen bugs with variadic generics
QuietMisdreavus and others added 21 commits June 15, 2023 10:13
…ization

[ConstraintSystem] Use an explicit generic argument constraint for `UnresolvedSpecializeExpr`.
…pr-choices-for-non-operators

[AST] ASTDumper: Print overload choices of non-operator `OverloadedDe…
… be desugared

This patch is an add-on to swiftlang#64043.
Essentially when encountering NS_OPTIONS enums, in C++-Interop mode
if they are not specially handled then they can mangle differently than
they do without C++-Interop. This patch adds logic to handle when a
typedef and enum have additional clang::ElaboratedType sugar, but
otherwise it does the same as the existing 64043 patch.

The test case provided was encountered in a real app build. The problem
came from when two modules are each compiled one with and one without
C++-Interop. For the test case code provided the mangling of the
protocol conformance is not consistent and the code in
SILGenLazyConformance.cpp crashes on an invalid conformance with reason
"Invalid conformance in type-checked AST".
Sometimes it's useful to be more lenient when type checking swiftinterfaces
since restrictions that could be dropped in the future will manifest in
resilient libraries being incompatible with older compilers otherwise.
…ue_pointers

Enable usage of LLVM's opaque pointer
…after specialization

Generic specialization drops metatype arguments and therefore exposes opportunities to remove dead metatype instructions.
Instead of removing dead metatype instructions before specialization, try to remove them after specialization.
And replace them with explicit `metatype` instruction in the entry block.
This allows such metatype instructions to be deleted if they are dead.

This was already done for performance-annotated functions. But now do this for all functions.

It is essential that performance-annotated functions are specialized in the same way as other functions.
Because otherwise it can happen that the same specialization has different performance characteristics in different modules.
And it's up to the linker to select one of those ODR functions when linking.

Also, dropping metatype arguments is good for performance and code size in general.

This change also contains a few bug fixes for dropping metatype arguments.

rdar://110509780
The demangler already has an error mechanism to report if demangling
failed. Add null pointer checks before every access in
Demangle::getUnspecialized, and return an error if the child doesn't
exist.

rdar://110141007
build: update build rules for new MSI set
This fixes an assertion failure when encountering previously unhandled special names.

rdar://110841130
I don't like that this method exists, and I'd like to rip it out
in favor of expecting an opaque lowering, but I'm worried about
doing that this late in 5.9.

Fixes rdar://107290521
The compiler does not yet implement support for back deploying opaque result
types.

Resolves rdar://110806234
…-main

Add nullptr checks before accessing children in getUnspecialized
…ontrolstate-mangling

[cxx-interop] Add fix for corner case where NS_OPTIONS typedef has to be desugared
Replace hardcoded special names with call into getUserfacingName()
…on-verification

Handle pack expansion types when verifying lowered types in SIL
GenericSpecializer: drop metatype arguments in specialized functions
…ed-opaque-result-types

Sema: Diagnose `@backDeployed` on functions with opaque result types
@kateinoigakukun kateinoigakukun merged commit 1d4395b into swiftwasm Jun 16, 2023
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.