Commit Graph

195754 Commits

Author SHA1 Message Date
Hamish Knight
1fc04bf681 Merge pull request #84514 from hamishknight/not-privy
[Sema] Exclude private initialized vars from memberwise initializer
2025-12-09 04:19:13 +00:00
Ben Rimmington
b27c90b8b8 [SE-0494] isTriviallyIdentical(to:) [memory regions] (#84998)
Add `isTriviallyIdentical(to:)` methods to:

* `Span`
* `RawSpan`
* `UTF8Span`
* `UnsafeBufferPointer`
* `UnsafeMutableBufferPointer`
* `UnsafeRawBufferPointer`
* `UnsafeMutableRawBufferPointer`

Part of issue swiftlang/swift#84991.
2025-12-08 19:32:26 -08:00
Arnold Schwaighofer
0c7aded660 Merge pull request #85871 from aschwaighofer/lazy_metadata_emission_embedded_exist
[embedded] Lazily emit class metadata in embedded mode and apply shared linkage
2025-12-08 18:13:38 -08:00
Rick van Voorden
8c9f084d86 substring test nits 2025-12-08 17:35:51 -08:00
Karoy Lorentey
a3650e79e6 [test] Update tests, acknowledging new additions 2025-12-08 17:32:20 -08:00
Karoy Lorentey
e5787c661d [stdlib] String, Substring: Use new _StringGuts helper 2025-12-08 17:32:20 -08:00
Karoy Lorentey
4cde919950 [stdlib] Update availability of String view additions 2025-12-08 17:32:20 -08:00
WindowsMEMZ
8055d91316 Update tests for availability checking 2025-12-08 17:32:19 -08:00
WindowsMEMZ
288a69842d Add isIdentical to StringGuts and use it for comparation 2025-12-08 17:32:19 -08:00
WindowsMEMZ
14e37a15ec Make isIdentical opaque for clients 2025-12-08 17:32:19 -08:00
WindowsMEMZ
5b22d2a467 Add tests 2025-12-08 17:32:19 -08:00
WindowsMEMZ
be5ec1aed4 Add isTriviallyIdentical for unicode views 2025-12-08 17:32:19 -08:00
Karoy Lorentey
c8202c6f9a Apply suggestions from code review 2025-12-08 17:32:19 -08:00
Karoy Lorentey
3833cbdd87 [test] Fix ABI expectations 2025-12-08 17:32:19 -08:00
Karoy Lorentey
a7b152b94b [benchmark] Remove new benchmarks 2025-12-08 17:32:19 -08:00
Karoy Lorentey
b7e32db453 [stdlib] Update availability of isTriviallyIdentical methods 2025-12-08 17:32:19 -08:00
Karoy Lorentey
794bbb99b4 [stdlib] Define availability for the 6.4 stdlib and runtime 2025-12-08 17:32:19 -08:00
Rick van Voorden
abae2f6547 [stdlib] string identical
Co-Authored-By: Karoy Lorentey <klorentey@apple.com>
2025-12-08 17:32:19 -08:00
Ryan Mansfield
4754eeaef8 Merge pull request #85898 from rjmansfield/fix-issue-78598-back-deployment
[test] Mark issue-78598.swift as unsupported on back deployment runtime.
2025-12-08 20:12:53 -05:00
Alexis Laferrière
1fd44e67a2 Sema: Allow refs to hidden dependencies in prorperties of non-open classes
We now report properties referencing types imported from
implementation-only dependencies in non-library-evolution mode as the
memory layouts of structs and enums may be exposed to clients. Here we
exempt non-open classes from this check as clients hold pointers to
classes which hides the class internal memory layouts. Keep forbidding
it for open classes in order to error early, a client trying to subclass
an open class with such a reference from their property would already
see an error about members not deserializable.
2025-12-08 16:39:16 -08:00
Augusto Noronha
ab507becb4 [RemoteInspection] Factor out buildContextDescriptorManglingForSymbol
A previous commit introduced the usage of buildContextManglingForSymbol
in buildContextDescriptorMangling, which was not quite correct, since
type nodes needed extra handling, which was done in the other version of
buildContextDescriptorMangling. This patch factors out the handling of
building context descriptors mangling from symbols, and updates both
call sites to use the new function instead.

rdar://165950673
2025-12-08 16:36:14 -08:00
Augusto Noronha
52c8b7975a [NFC][RemoteInspection] Use existing cache to build conformance table
There is an existing cache which is built when looking up
FieldDescriptors. collectAllConformances ignored this cache and would
parse every FieldDescriptor again. Use the existing cache mechanism.

rdar://166098516
2025-12-08 16:34:45 -08:00
Arnold Schwaighofer
d06929ccd2 [embedded] Add support for some foreign metadata 2025-12-08 15:35:43 -08:00
Hamish Knight
45683f6561 [Sema] Exclude private initialized vars from memberwise initializer
Exclude properties with initial values from the memberwise initializer
if they are less accessible than the most accessible property, up to
`internal`. Introduce a compatibility overload that continues to
include the same properties as before until the next language mode.

This is gated behind the `ExcludePrivateFromMemberwiseInit` feature.

rdar://122416579
2025-12-08 23:22:35 +00:00
Hamish Knight
e383766e93 [SILGen] Handle default initialization of init accessor in memberwise init
If the property isn't memberwise initializable we need to emit its
initial value and call the init accessor. This currently isn't necessary
since all init accessor properties are included in the memberwise
initializer, but the following commit will change this.
2025-12-08 23:22:35 +00:00
Hamish Knight
1d8341bd0b [Sema] Swap init accessor check in MemberwiseInitPropertiesRequest
Currently `init` accessors are always memberwise initialized, but I'm
planning on changing that. As such we need to make sure we record
the `init` accessor regardless of whether it is included in the memberwise
init.
2025-12-08 23:22:35 +00:00
Hamish Knight
17af03d622 [Sema] Factor out InitializablePropertiesRequest
This serves as the backing request for both InitAccessorPropertiesRequest
and MemberwiseInitPropertiesRequest, ensuring the former does not
care about the init accessor is included in the memberwise initializer.
2025-12-08 23:22:35 +00:00
Hamish Knight
302e803b2f [AST] Store original lazy VarDecl for backing storage
Store the original VarDecl in the same map we use for tracking the
original wrapper var for property wrappers. This will allow us to
use the same logic to determine the original var for both.
2025-12-08 23:22:35 +00:00
Hamish Knight
c02fb8b1a1 [AST] Factor out printMemberwiseInit
Move the printing logic into libAST such that it can be used both by
the refactoring and by fix-it logic in Sema.
2025-12-08 23:22:35 +00:00
Hamish Knight
01b965fe3c [IDE] Use Identifier for printing member name in generateMemberwiseInit
Avoid relying on the source text and print the identifier, escaping
if needed.
2025-12-08 23:22:35 +00:00
Hamish Knight
442a11bb0d [AST] NFC: Remove some unused declarations 2025-12-08 23:22:35 +00:00
Pavel Yaskevich
df3aa1e011 Merge pull request #85879 from xedin/add-supression-note-to-explicit-sendable-warning
[Diagnostics] TildeSendable: Suggest `Sendable` suppression in explic…
2025-12-08 13:29:25 -08:00
Alexis Laferrière
de9148e6f1 Merge pull request #85868 from xymus/exportability-nle-split
Sema: Distinguish implicitly visible memory layouts from the typical `@frozen` ones
2025-12-08 13:29:16 -08:00
Ryan Mansfield
e60ca698c6 Merge pull request #85440 from rjmansfield/fix-wmo-opt-record-paths
Fix optimization record paths in multi-threaded WMO mode
2025-12-08 16:14:53 -05:00
Slava Pestov
8f4d1b1f9c Merge pull request #85903 from slavapestov/readme-fix
docs: Fix links to Windows docs in README.md
2025-12-08 15:20:56 -05:00
Dario Rexin
0fdca11e46 [IRGen] Use proper linkage for async function pointers to partial apply forwarders
rdar://163631865

Under certain circumstances the same symbol can be used for different implementations of the forwarders.
The forwarders themselves are already emitted with "internal" LLVM linkage, but some particularities in
the mapping from SILLinkage to LLVM linkage caused async function pointers to partial apply forwarders
to be emitted with linkonce_odr instead, which caused the wrong forwarder to be called at runtime, causing
unexpected behavior and crashes.
2025-12-08 11:30:22 -08:00
Pavel Yaskevich
7d3e40b7bb Merge pull request #85830 from jamieQ/no-async-in-await-fixit
[Sema]: add fixit for `no_async_in_await` warning
2025-12-08 11:26:32 -08:00
Augusto Noronha
f89131d7d8 Merge pull request #85878 from augusto2112/fix-private-disc-main
[RemoteInspection] Read ContextDescriptor from symbol if available
2025-12-08 11:13:16 -08:00
Ben Cohen
58f661cfba Allow Equatable: ~Escapable (#85854)
Adds `~Escapable` to #85746
2025-12-08 09:50:50 -08:00
Slava Pestov
563ba95a7d Sema: Move definition of hasConversions() before its first use 2025-12-08 10:12:13 -05:00
Slava Pestov
db4e3b0838 Sema: Move definition of checkTypeOfBinding() before its first use 2025-12-08 10:12:13 -05:00
Slava Pestov
2eebdc3bb5 Sema: Simplify addLiteralRequirement() and fix misleading comment
Literal coverage is actually checked elsewhere, so this was
about whether the protocol has a default type only.
2025-12-08 10:12:13 -05:00
Slava Pestov
f4dabfb889 Sema: checkTypeOfBinding() should return a bool
This always returned a std::nullopt, or an optional of the given 'type'.
2025-12-08 10:12:13 -05:00
Slava Pestov
0fabf82ace Sema: Fix assert failure with non-representative type variable in contractEdges() 2025-12-08 10:12:12 -05:00
Slava Pestov
d9dcc88c46 docs: Fix links to Windows docs in README.md 2025-12-08 10:12:02 -05:00
Arnold Schwaighofer
93e494bc40 Attempt to fix test on linux 2025-12-08 07:07:09 -08:00
Saleem Abdulrasool
070916fef3 DriverTool: adjust argv[0] scanning for CAS
Ensure that we nativize the path and consider only the filename starting
prefix to account for file suffixes (e.g. `.exe` on Windows). This
ensures that we properly support other platforms.
2025-12-08 08:53:26 -06:00
Fabroce de Gans
29eecbe5d5 utils: Update the bootstrap Windows toolchain
The current Windows arm64 bootstrap toolchain is not functional.
2025-12-08 15:34:17 +01:00
Ryan Mansfield
a7e22a36c8 [test] Mark issue-78598.swift as unsupported on back deployment runtime. 2025-12-08 08:15:10 -05:00
Hamish Knight
d8a867df86 [Demangler] Handle invertible reqs for extensions in findDeclContext
If we didn't find an extension result, try again disregarding
invertible requirements since `demangleGenericSignature` won't
include them. This is just meant to be a quick low risk fix that we
can cherry-pick, the proper fix here is to delete all this logic and
just return the nominal along with the ABI module name to filter
lookup results.

rdar://165639044
2025-12-08 12:21:29 +00:00