Skip to content

[pull] swiftwasm from main #5501

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 189 commits into from
Jun 10, 2023
Merged

[pull] swiftwasm from main #5501

merged 189 commits into from
Jun 10, 2023

Conversation

pull[bot]
Copy link

@pull pull bot commented Jun 7, 2023

See Commits and Changes for more details.


Created by pull[bot]

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

ahoppen and others added 30 commits May 31, 2023 18:03
This also adds a function to demangle a symbol, and a way for the
backtracing code to report warning messages to the same place as
the main runtime.

I'd like to rename the _swift_isThunkFunction() SPI also, but we
can't do that until we've made the changes to the _Backtracing
library, so we'll do that there instead.

rdar://110261430
This was added to a later PR, but not to this one, though we need
it here.

rdar://110261430
This should have been disabled until swiftlang#66338.

rdar://110261430
Mike and Max made various helpful suggestions, so I've added and updated
various comments and amended the code to cope with partial reads and
writes.

rdar://110261430
Moved the comment for `_swift_backtrace_demangle` into the header file
instead of it being in the implementation.

rdar://110261430
The Swift backtracer's frame pointer unwinder cannot work on Linux
without this change, because the compiler omits the frame pointer from
the function in libSwift_Backtracing that actually captures the stack.

rdar://110260855
Using `SwiftShims` is undesirable - it creates all kinds of build issues,
and means shipping the `_SwiftBacktracing.h` header in the SDK, which is
not necessary.

While we're doing this, add the necessary definitions for reading ELF
and DWARF information.

rdar://110261712
Use the new module structure rather the old SwiftShims header.  This
is much cleaner and lets us include operating system headers to get
the relevant definitions where possible.

Add code to support ELF and DWARF, including decompression using
zlib, zstd and liblzma if those turn out to be required and available.

rdar://110261712
This is for compatibility, so that I can split up the PRs.
We'll remove it in the next PR.

rdar://110261712
There's a chance that pipes might perform a partial read; we should
handle that case.

rdar://110261712
…acros

Fixes a crash where local variables introduced by a freestanding
declaration macro would not get SIL emitted for them, rdar://109721114.
…ue types and prohibit move assignment explicitly

Fixes swiftlang#66324

Note: move semantics for Swift value types are not yet supported in C++
The TypedPattern and IsPattern constraints were
incorrectly written, with conversions propagating
out of the patterns, when really conversions
ought to propagate into patterns. In any case, it
seems like we really want equality here. Fix the
constraints to use equality, and have the cast
constraint operate on the external pattern type
instead of the subpattern type.
Order them such that if they were changed to
conversions, they would be sound. This shouldn't
make a difference, but unfortunately it turns out
pattern equality is not symmetric. As such, tweak
the pattern equality logic to account for the
reversed types. This allows us to remove a special
case from function matching.
This shouldn't be necessary, we should be able to
solve with type variables instead. This makes sure
we don't end up with weird special cases that only
occur when an external type is present.
Push the only null case that can occur up into the
caller.
We should never CSGen a null Type for patterns.
Instead of walking the single ASTNode from the
target, walk all AST nodes associated with the
target to find the completion expr. This is needed
to find the completion expr in a pattern for an
initialization target.
Previously we would wait until CSApply, which
would trigger their type-checking in
`coercePatternToType`. This caused a number of
bugs, and hampered solver-based completion, which
does not run CSApply. Instead, form a conjunction
of all the ExprPatterns present, which preserves
some of the previous isolation behavior (though
does not provide complete isolation).

We can then modify `coercePatternToType` to accept
a closure, which allows the solver to take over
rewriting the ExprPatterns it has already solved.

This then sets the stage for the complete removal
of `coercePatternToType`, and doing all pattern
type-checking in the solver.
This is wrong because there's nowhere to put any
conversion that is introduced, meaning that we'll
likely crash in SILGen. Change the constraint to
equality, which matches what we do outside of the
constraint system.

rdar://107709341
There's still plenty of more work to do here for
pattern diagnostics, including introducing a
bunch of new locator elements, and handling things
like argument list mismatches. This at least lets
us fall back to a generic mismatch diagnostic.
Previously if the cast was unresolved, we would
emit a warning and bail with `nullptr`. This is
wrong, because the caller expects a `nullptr`
return to mean we emitted an error. Change the
diagnostic to an error to fix this. This may
appear source breaking, but in reality previously
we were failing to add the cast at all in this case,
which lead to a crash in SILGen. We really do
want to reject these cases as errors, as this
will give us a better opportunity to fall back to
type-checking as ExprPatterns, and better matches
the constraint solver type-checking.

Also while we're here, change the diagnostic for
the case where we don't have an existential context
type from the confusing "enum doesn't have member"
diagnostic to the pattern mismatch diagnostic.

rdar://107420031
Some places want to do in-order walks of MacroExpansionDecls, but still
visit auxiliary declarations. Rather than force them to specifically
filter out declarations from the MacroExpansionDecl, add a parameter to
visitAuxiliaryDecls to skip them.
Caching the default zone should no longer be necessary.

rdar://102870625
zoecarver and others added 29 commits June 8, 2023 14:07
…d; update the link to the Forward Vision document.
…h-driver

[cxx-interop][driver] make '-emit-clang-header-path' a fully supporte…
[cxx-interop] evaluate default constructor's unevaluated exception sp…
The compiler might optimize away the first copy, so just make sure that no copies are happening during the actual initialization of Array.

rdar://110422053
Variable debug info is triggered by pattern bindings, however, inside a closure
capture list, this should be avoided by setting the appropriate flag in the
initializer object.

rdar://110329894
…w-highlighting

[SourceKit] Highlight `consuming` and `borrowing` as keywords
Add link to Swift.org documentation in CppInteroperabilityManifesto.m…
…e-default

[Sema] InitAccessors: Don't synthesize default memberwise arg for ini…
Add link to Swift.org status page in CppInteroperabilityStatus.md
Add link to Swift.org documentation in GettingStartedWithC++Interop.md
Add link to Swift.org documentation in  InteropOddities.md
Add link to Swift.org documentation in UserGuide-CallingSwiftFromC++.md
…4c56d958953c2d3cd7cb123

[move-only] Make test 32 bit friendly.
`.swiftmodule` is listed as an output of pure swift libraries, but it
isn't updated if there's been no changes (just like the library and
its object files). Add it to the touch hack as well.

Swift *executables* also list `.swiftmodule` as an output, even though
one isn't generated at all. Add a new POST_BUILD command to touch it
regardless.
Add link to Swift.org documentation in UserManual.md
…t-source

Add REQUIRES: swift_in_compiler to discard.swift and outliner.swift
[Backtracing][Linux] Replace regex with ProcMapsScanner.
Older glibc doesn't include these.  Nor does Musl, it seems.  The
previous fix put the gettid() declaration too far down the file.

rdar://110417355
[cxx-interop] Make a test work properly with optimizations
Avoid emitting variable debug info for closure captures.  … @adrian-prantl
[Backtracing][Linux] Include declarations for gettid() and tgkill().
[Serialization] Display contextual notes on deserialization errors and misconfigurations
[CMake] Prevent rebuilds of pure swift libraries and executables
…sult-types

[Macros] Only freestanding expression macros can have a non-Void result type
…esilient-latent-bug

AST: Spot fix for AbstractStorageDecl::isResilient()
@kateinoigakukun kateinoigakukun merged commit c39d86c into swiftwasm Jun 10, 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.