Parameter type could be represented by an associated type which is
bound to a concrete type by an extension, `AbstractFunction::getType()`
should map it into context before returning because the construct is
that it always produces a function type.
Resolves: rdar://156955193
(cherry picked from commit 32b97d0e2a)
(cherry picked from commit 7f652915d9)
This new flag makes it easy to build Swift cross-compilation toolchains, by
disabling cross-compilation of all host tools, like the Swift compiler and
various macros, building on prior pulls #38441 and #82163.
Also, add two class methods to the Testing macros product so it works with #83260.
specifically the change that makes the following possible on linux:
"* under Linux, do not cross compile LLVM when building for the host
architecture -- that will ensure that the compiler-rt build will use
the just built compiler and not the system one (which may not be
new enough for this purpose);"
Explanation: The original code had the assumption we only import
modules. However, there is a flag to import an umbrella header in which
case the clang nodes have no owning module. This PR prevents a null
dereference in that case.
Issues: rdar://157489426
Original PRs: #83540
Risk: Low, added a check to avoid null dereference.
Testing: Added a compiler test.
Reviewers: @egorzhdan
This fixes a timeout failure in CI. It looks like that some CI machines are slower than expected.
I could not reproduce this locally. There doesn't seem to be a compile time regression.
inside function returning it
A stack overflow would happen when the compiler tried emitting debug
info for a function whose opaque return type was declared inside the
function itself. This fixes the issue by emitting a forward declaration
for the function before emitting it.
rdar://150313956
(cherry picked from commit c03831f70d)
Especially in an explicit modules project, LLDB might not know all the
search paths needed to imported the on disk header.
rdar://157063577
(cherry picked from commit a6678476d8)
Such references used to be downgraded until Swift 6 but since the
context is `@preconcurrency` it should be possible for API authors
to introduce concurrency annotations such as `@Sendable` without
breaking clients even when they are compiled in Swift 6 mode.
Resolves: rdar://157061896
(cherry picked from commit 5ee673f358c9dd7dbbfe58f02bc78af60e0377b8)
Specifically, we were not inserting the implicit isolated parameter and were not
setting up the actor prologue. To keep this specific to nonisolated(nonsending)
code, I only setup the actor prologue if we know that we have something that is
nonisolated(nonsending).
I also ported some async initializer tests to run with/without
nonisolated(nonsending) just to increase code coverage.
rdar://156919493
(cherry picked from commit 3871d22257)
The constraint solver does not reliably give closures a function type
that includes `nonisolated(noncaller)`, even when the immediate context
requires a conversion to such a type. We were trying to work around this
in SILGen, but the peephole only kicked in if the types matched exactly,
so a contextual conversion that e.g. added `throws` was still emitting
the closure as `@concurrent`, which is of course the wrong semantics.
It's relatively easy to avoid all this by just rewriting the closure's
type to include `nonisolated(nonsending)` at a point where we can reliably
decide that, and then SILGen doesn't have to peephole anything for
correctness.
Fixes rdar://155313349
Clang driver only passes arch-specific library paths as search paths
to the linker for WebAssembly targets but we were installing
libxml2.a under `<sysroot>/lib` without the multiarch triple. It led
to the linker not finding libxml2.a when importing FoundationXML
Cherry-pick of #83128, #82399, and #82878, merged as ea6ca2b5db, 0c4e56174b, and e34eb3331f respectively.
**Explanation**: Currently `test/CMakeLists.txt` can only set `SWIFT_LIT_ARGS` for all tests uniformly. This means that we can't have tests for Embedded Swift with a different set of `lit.py` arguments.
Also, create new `check-swift-embedded-wasi` target from `test/CMakeLists.txt`, tweak `lit.cfg` to support WASI Clang resource dir, exclude unsupported tests based on `CPU=wasm32` instead of `OS=wasi`.
**Scope**: Limited to Embedded Swift test suite.
**Risk**: Low, due to limited scope.
**Testing**: #82878 was incubated on `main` for 2 weeks, #82399 for 3 weeks with no disruption, #83128 merged this week, but enables all these tests on CI, which are consistently passing.
**Issue**: rdar://156585717
**Reviewer**: @bnbarham
Make explicit "nonisolated" also not special on protocols, so a
nonisolated protocol does not suppress default isolation.
SendableMetatype is the proper way to suppress default isolation for a
protocol.
Unfortunately, these rules made it appear like issue #82168
was fixed, when in fact it was not. Keep the test case, but as a
failing test, and we'll investigate separately.
Given an explicitly-nonisolated type such as
nonisolated struct S { }
all extensions of S were also being treated as nonisolated. This meant
that being implicitly nonisolated (i.e., when you're using nonisolated
default isolation) was different from explicitly-writing nonisolated,
which is unfortunate and confusing. Align the rules, such that an
extension of S will get default isolation:
extension S {
func f() { } // @MainActor if we're in main actor default isolation
}