Commit Graph

184973 Commits

Author SHA1 Message Date
(null)
d6811260a9 Merge commit '665515c781999a81094bbe4f8302a7cb1a6a6b39' into mchiu/freebsd 2025-06-17 15:12:23 -04:00
Slava Pestov
a4bfa3f72b Merge pull request #82275 from slavapestov/more-fuzzer-fixes-2
More fuzzer fixes
2025-06-17 14:57:38 -04:00
Guillaume Lessard
e29b425a6b Merge pull request #82277 from glessard/rdar153219174-UMBP-mutableSpan
[stdlib] add missing computed properties
2025-06-17 11:51:06 -07:00
Egor Zhdan
67e2024417 [cxx-interop] Make usages of Swift Span @_alwaysEmitIntoClient in the overlay
This fixes a regression where projects that use the C++ stdlib overlay stop building because of a linker error:
```
ld: Shared cache eligible dylib cannot link to ineligible dylib '@rpath/libswiftCompatibilitySpan.dylib'.
```

Usages of `Span<T>` would generally cause a type metadata accessor to be emitted for `Swift.Span`. This becomes a problem with backdeployment, since Span is partially defined in a compatibility binary.

This change adds `@_alwaysEmitIntoClient` to generic usages of `Span` to prevent the type metadata accessor from being emitted into `libswiftCxx.a`.

rdar://152192080
2025-06-17 19:42:14 +01:00
Slava Pestov
dad358350a Sema: Relax diagnosis of implied marker protocol conformances with mismatched availability
This logic was introduced in https://github.com/swiftlang/swift/pull/75135.
The intent was to prevent an implied conformance from overriding an
existing unavailable one, for example in the case of Sendable. Let's
relax this check a bit to only diagnose if the mismatch is in the
unconditional availability, and not OS version.

Fixes rdar://142873265.
2025-06-17 14:27:14 -04:00
Artem Chikin
66b8f35a5e Merge pull request #81569 from artemcm/NoBatchForYou
[Legacy Driver] Obsolete and remove batch compilation mode from the legacy driver
2025-06-17 10:49:16 -07:00
Evan Wilde
3376785630 Use C++ driver when C++ interop is enabled
This aligns the old driver with the behavior of the new driver.
When building with C++ interop enabled, it's important that we link a
C++ runtime, which is handled by the clang++ driver.
The new driver uses clang++ when linking with C++ enabled, either
through the c++ interoperability mode flag or the experimental C++
interop flag. The old driver only enabled it with the experimental C++
interop flag. This results in the C++ interop tests failing on FreeBSD
and a behavioral difference between what we are testing and what we are
shipping.
2025-06-17 10:42:57 -07:00
Valeriy Van
61ab279986 Fix doc comment in DropWhile.swift (#82290) 2025-06-17 10:38:02 -07:00
Saleem Abdulrasool
2ba4e7fa20 utils: pass along Foundation and XCTest to TSC (#82267)
This is required to build the TSCSupport module for SPM's consumption.
2025-06-17 10:07:56 -07:00
Mohamed Hegazy
9c2c6c9143 [build.ps1] Honor --SkipBuild with --IncludeNoAsserts (#82271)
Missed in my previous change. This makes it so that we donot build the
no asserts toolchain if `--skipBuild` is passed with
`--IncludeNoAsserts`
2025-06-17 10:06:20 -07:00
Adrian Prantl
868c9912aa [Reflection] Add lightweight error handling to ReflectionContext
Reflection metadata lookup failures are notoriously difficult to debug
because there is no error handling in TypeLowering outside of
compile-time #ifdef'd fprintf(stderr) calls. The nicest thing to do
would be to adopt llvm::Expected<> but TypeLowering is also included
in the standard library, which only has access to a tiny subset of the
LLVM Support library. This patch adds a place to store a pointer to
the first encountered error, which can then be converted to an
llvm::Error at the API level.
2025-06-17 09:47:11 -07:00
Pavel Yaskevich
2f920ceb5a Merge pull request #82289 from xedin/rdar-145519840
[Concurrency] SE-0449: `nonisolated` on a type should prevent isolati…
swift-DEVELOPMENT-SNAPSHOT-2025-06-17-a
2025-06-17 09:02:52 -07:00
Egor Zhdan
f6e61728c5 Merge pull request #82161 from swiftlang/egorzhdan/template-param-nullability
[cxx-interop] Import nullability of templated function parameters correctly
2025-06-17 16:51:47 +01:00
Egor Zhdan
62d56067c8 [cxx-interop] Disable test with an older runtime
848fad00 introduced support for printing foreign reference types. It changes both the compiler and the runtime, and having the runtime change applied is required for the test to pass. Let's not try to run it with an old runtime.

This change also splits up a test for printing of value types from a test for printing of foreign reference types, since we don't have any runtime restrictions for value types.

rdar://153205860
2025-06-17 16:27:16 +01:00
Gábor Horváth
304d558f43 Merge pull request #82203 from swiftlang/gaborh/shared-references-are-safe
[cxx-interop] Shared references are considered safe
2025-06-17 16:12:59 +01:00
Joe Groff
b8f5a36fc6 Merge pull request #82288 from jckarter/transitive-addressability-fields-and-addressors
SILGen: Handle struct fields and addressors as addressable storage.
2025-06-17 07:36:49 -07:00
Mishal Shah
b8ade82bdf Merge pull request #82294 from swiftlang/revert-82174-yt/build-libxml2
Revert "[wasm] Build and install libxml2 for Wasm SDK"
2025-06-17 07:33:05 -07:00
Hamish Knight
89a7014db9 [Sema] Add null check in createMemberwiseInitParameter
The property wrapper initializer info may be null if e.g we had a
request cycle, just use the property's interface type in that case.

rdar://82899428
2025-06-17 15:16:44 +01:00
Slava Pestov
1b4178ff48 ASTScope: Fix llvm_unreachable when printing scopes before extension binding 2025-06-17 10:15:30 -04:00
Slava Pestov
cfa9de8f0a Parse: Address an llvm_unreachable that is actually reachable 2025-06-17 10:15:30 -04:00
Max Desiatov
d5abfa431b Revert "[wasm] Build and install libxml2 for Wasm SDK" 2025-06-17 15:10:02 +01:00
Slava Pestov
b79f2817f9 Sema: Fix MissingCallFailure::diagnoseAsError() crash with special base names 2025-06-17 09:52:04 -04:00
Slava Pestov
0d6470345b Sema: Fix crash on invalid code in isOverrideBasedOnType() 2025-06-17 09:52:04 -04:00
Slava Pestov
ef5e2861a2 Sema: Fix crash on invalid code in diagnoseDictionaryLiteralDuplicateKeyEntries() 2025-06-17 09:52:03 -04:00
Slava Pestov
8b12f8cb8e Sema: Fix null pointer dereference in LazyStoragePropertyRequest::evaluate() 2025-06-17 09:52:03 -04:00
Slava Pestov
eec924b505 Sema: Fix crash in diagnoseIfSynthesisUnsupportedForDecl() with tuple extension 2025-06-17 09:52:03 -04:00
Slava Pestov
9a01e872da Sema: Address FIXME resulting in a crash in filterProtocolRequirements() 2025-06-17 09:52:03 -04:00
Slava Pestov
4fa2e979fa RequirementMachine: Don't crash if we cannot desugar a same-shape requirement 2025-06-17 09:52:02 -04:00
nate-chandler
5b37832e1f Merge pull request #82280 from nate-chandler/rdar151726387
[IRGen] Fix FixedArray of fixedSize 1 element addressing.
2025-06-17 06:39:31 -07:00
Andrew Trick
ba92425722 Merge pull request #82286 from atrick/lifedep-endapply-assert
LifetimeDependenceScopeFixup: crash handling dead-end coroutine
2025-06-17 06:34:35 -07:00
Slava Pestov
908c9368ed Parse: Only accept certain literals as enum case raw values
Just checking for LiteralExpr is too broad, because Sema doesn't
know what to do with RegexLiteralExpr for example.
2025-06-17 09:19:00 -04:00
Slava Pestov
401d297ee2 AST: Fix crash on invalid in isVanishingTupleConformance() 2025-06-17 09:16:26 -04:00
Valeriy Van
d22a24744f Fix bug making ~0x1 mask in stdlib/toolchain/CompatibilityDynamicReplacements/DynamicReplaceable.cpp (#82264)
Solves #62665.
2025-06-17 09:03:16 -04:00
Stephen Canon
1e02b3b596 Quick support for calling extern c functions with Builtin vector types. (#82225)
This gives us a means to use llvm's intrinsics that implement more niche
SIMD instructions from the standard library, where we cannot use the C
intrinsics headers from clang (because they're in the cpp module).
2025-06-17 09:00:21 -04:00
Stephen Canon
76df55d1aa Quiet a deprecation warning in the count(where:) benchmark (#82257)
I think the benchmarking machinery moved while count(where:) was in
limbo, so this was deprecated before the benchmark actually landed.
2025-06-17 08:58:34 -04:00
Hamish Knight
1c99ddc1e9 [xcodegen] Make sure to realPath Clang file paths
Ensure we get the `realPath` for file paths in the
`compile_commands.json` to canonicalize casing.
2025-06-17 12:58:34 +01:00
Slava Pestov
de3fb02bf5 Merge pull request #82238 from slavapestov/coding-keys-parameter-pack
Sema: Relax enum parameter pack restriction for CodingKeys
2025-06-17 07:48:35 -04:00
Hamish Knight
6257828593 [AST] Replace type variables and placeholders in original ErrorTypes
Turns out we can also get solver-allocated original ErrorTypes through
type resolution. Given the original type is only used for
printing/debugging, let's just fold away any type variables and
placeholders into UnresolvedType (which print as placeholders). This
matches what `Solution::simplifyType` does.
2025-06-17 12:09:25 +01:00
Pavel Yaskevich
06be7bda39 [Concurrency] SE-0449: Implied conformances to nonisolated protocols make witnesses nonisolated
Even if the requirement is stated on an isolated protocol if the
conformance is implied by a nonisolated one all of the requirements
and witnesses should be nonisolated.
2025-06-17 00:05:16 -07:00
Guillaume Lessard
62b58a8efd [test] acknowledge ABI additions 2025-06-16 22:28:21 -07:00
Guillaume Lessard
0433cd292c [stdlib] add UMBP.mutableSpan accessor 2025-06-16 22:28:21 -07:00
Guillaume Lessard
f952ca5988 [stdlib] add URMBP.mutableBytes accessor 2025-06-16 22:28:21 -07:00
Hamish Knight
8acde34ab5 Merge pull request #82263 from hamishknight/fuzzy 2025-06-17 05:58:49 +01:00
Andrew Trick
5b5f370ce1 LifetimeDependenceScopeFixup: crash handling dead-end coroutine
When extending a coroutine, handle the end_borrow instruction used to end a
coroutine lifetime at a dead-end block.

Fixes rdar://153479358 (Compiler crash when force-unwrapping optional ~Copyable type)
2025-06-16 21:43:44 -07:00
Pavel Yaskevich
e50acbf3d5 [Concurrency] SE-0449: nonisolated on a type should prevent isolation inference from protocol requirements
If a `nonisolated` type conforms to a global-isolated protocol
the witnesses to the protocol requirements should infer the
isolation from the protocol but instead be `nonisolated`.

Resolves: rdar://145519840
2025-06-16 21:28:41 -07:00
Andrew Trick
5a1d3a84a5 Merge pull request #82268 from atrick/infer-implicit-read
LifetimeDependence type check: infer trivial _read accessor
2025-06-16 21:10:35 -07:00
Anthony Latsis
faa7f67960 Merge pull request #82165 from AnthonyLatsis/jepa
{AST,Basic}Bridging: Use  `<swift/bridging>` and try directly bridging one of our enums
2025-06-17 04:52:41 +01:00
Nate Chandler
6e8170c34d [IRGen] Fix FixedArray of fixedSize 1 elt addring.
When a `FixedArray`'s fixed size is 1, it looks like `[1 x %Ty]`. Given
an array's address, performing an operation on each element's address
entail's indexing into the array to each element's index to produce an
element's address for each index.  That is true even when the array
consists of a single element.  In that case, produce an address for that
single element by indexing to index 0 into each passed-in array.

rdar://151726387
2025-06-16 20:34:41 -07:00
Joe Groff
761faaa169 SILGen: Handle struct fields and addressors as addressable storage.
When accessing stored properties out of an addressable variable or parameter
binding, the stored property's address inside the addressable storage of the
aggregate is itself addressable. Also, if a computed property is implemented
using an addressor, treat that as a sign that the returned address should be
used as addressable storage as well. rdar://152280207
2025-06-16 20:23:47 -07:00
Stephen Canon
bf558a376a Further relax concrete simd ir tests (#82242)
It turns out that on some targets we generate a call to initialize a
SIMD vector from a Builtin.Vec, even though everything is transparent,
so the checks for the return using a specific value were too fragile.

rdar://153260158
2025-06-16 20:16:05 -04:00