Commit Graph

47907 Commits

Author SHA1 Message Date
Alexis Laferrière
74c8fcfc66 Merge pull request #85990 from xymus/serial-conf-diag
Serialization: Minor improvements to the error on conformance mismatch
2025-12-12 15:05:53 -08:00
Hamish Knight
a4ae17133c Merge pull request #85973 from bnbarham/convert-async-shorthand
[SourceKit] Allow converting functions containing shorthand ifs to async
2025-12-12 17:19:23 +00:00
Slava Pestov
ca12185204 Merge pull request #85967 from slavapestov/dont-copy-that-floppy
Sema: Avoid copying BindingSets
2025-12-12 00:18:47 -05:00
Michael Gottesman
e186e5e5d0 Merge pull request #85972 from gottesmm/pr-9663abc1697da1382a8514e6877a6c3ce3f439b9
[concurrency] Hide Concurrency StackNesting builtins behind a feature flag
2025-12-11 21:16:37 -08:00
Karoy Lorentey
a233485029 Merge pull request #82055 from vanvoorden/string-identical
[SE-0494][StdLib] Add `isTriviallyIdentical(to:)` Methods to String and Substring
2025-12-11 15:55:11 -08:00
Dario Rexin
1f8e88d659 Merge pull request #85908 from drexin/wip-163631865
[IRGen] Use proper linkage for async function pointers to partial app…
2025-12-11 09:52:51 -08:00
Joe Groff
560eb9deaa Merge pull request #85954 from jckarter/sil-require-require-instruction
SIL verifier: The `atInstruction`/`atArgument` parameter to `require` should not be optional.
2025-12-11 09:43:43 -08:00
Arnold Schwaighofer
c1c05e1298 Merge pull request #85948 from aschwaighofer/embedded_enable_existential_support
[embedded] Enable support for existentials/boxed protocol types per default
2025-12-11 07:16:26 -08:00
Hamish Knight
088bda7424 Merge pull request #85952 from hamishknight/skip-body-macro
[AST] Avoid walking macro expanded bodies in non-expanded mode
2025-12-11 14:08:45 +00:00
Ben Barham
7887ce8a8e [SourceKit] Allow converting functions containing shorthand ifs to async
Resolves rdar://154753663.
2025-12-11 21:46:37 +10:00
Susana Monteiro
91d1d2e06f Merge pull request #85793 from susmonteiro/susmonteiro/diagnose-swift-attrs
[cxx-interop] Diagnose invalid swift attributes
2025-12-11 11:06:41 +00:00
Michael Gottesman
7b9281fcb8 [concurrency] Hide Concurrency StackNesting builtins behind a feature flag.
rdar://166244033
2025-12-10 16:02:18 -08:00
Slava Pestov
56baeac901 Sema: More descriptive comment for determineLiteralCoverage() 2025-12-10 18:48:47 -05:00
Slava Pestov
205d8e6640 Sema: Remove unnecessary operator new overload 2025-12-10 18:48:47 -05:00
Slava Pestov
ba7df4013e Sema: Avoid copying BindingSets
They're stored inside the ConstraintGraphNode now, so returning a
`const BindingSet *` from within determineBestBindings() should
be safe.
2025-12-10 18:48:00 -05:00
Alexis Laferrière
175d0ba8e6 Serialization: Minor improvements to the error on conformance mismatch
Clarify the sources of information when a conformance reference in a
swiftmodule doesn't match with the requirements seen by the reader.
2025-12-10 15:08:03 -08:00
Egor Zhdan
f995144c1d Merge pull request #85906 from egorzhdan/egorzhdan/reland-cxx-string-cs
Reapply "[ConstraintSystem] C++ Interop: Binding a string literal to `std.string` shouldn't increase the score"
2025-12-10 21:04:15 +00:00
Joe Groff
da4e72cf2d SIL verifier: The atInstruction/atArgument parameter to require should not be optional.
The underlying C++ code expects a non-null `Instruction*` or `SILArgument*` pointer, and
most of the contextual information in a verifier error is derived from these arguments,
so it doesn't really make sense for the Swift level interface to present these arguments
as optional.
2025-12-10 10:27:56 -08:00
Hamish Knight
a9ad4e2cae [AST] Avoid walking macro expanded bodies in non-expanded mode
Make sure we don't walk into the expansion of a body macro if the AST
walker is configured not to walk macro expansions.
2025-12-10 17:41:00 +00:00
susmonteiro
fb5bc7282f [cxx-interop] Diagnose invalid copyability, escapability and mutability attributes
Fixes: https://github.com/swiftlang/swift/issues/84559
2025-12-10 17:26:14 +00:00
Arnold Schwaighofer
d019f37b68 [embedded] Enable support for existentials/boxed protocol types per default
And enable this feature in production.
2025-12-10 08:50:23 -08:00
Arnold Schwaighofer
be78127c23 Merge pull request #85923 from aschwaighofer/embedded_existentials_requires_embedded
[embedded] Feature::EmbeddedExistentials requires Feature::Embedded
2025-12-10 07:13:45 -08:00
Egor Zhdan
ad56e061af Merge pull request #85066 from egorzhdan/egorzhdan/std-function-context
[cxx-interop] Allow initializing `std::function` from Swift capturing closures
2025-12-10 13:35:34 +00:00
Slava Pestov
5e952e9b22 Merge pull request #85902 from slavapestov/csbindings-cleanups
Sema: A few more simple CSBindings cleanups
2025-12-09 18:29:53 -05:00
Ben Barham
8e06293dca Merge pull request #85875 from bnbarham/fix-up-userdocs
Fix up the userdocs index
2025-12-10 08:28:11 +10:00
Augusto Noronha
47eda910c1 Merge pull request #85916 from augusto2112/speedup-protocols-main
[NFC][RemoteInspection] Use existing cache to build conformance table
2025-12-09 13:06:41 -08:00
Augusto Noronha
1627b5fc24 Merge pull request #85911 from augusto2112/factor-context-descriptor-symbol
[RemoteInspection] Factor out buildContextDescriptorManglingForSymbol
2025-12-09 11:24:53 -08:00
Arnold Schwaighofer
4d879967a7 [embedded] Feature::EmbeddedExistentials requires Feature::Embedded 2025-12-09 10:21:51 -08:00
Gábor Horváth
d97fa92a33 Merge pull request #85650 from Xazax-hun/refcounted-ptr-conversions
[cxx-interop] Introduce SWIFT_REFCOUNTED_PTR
2025-12-09 17:01:08 +00:00
Egor Zhdan
a6b30c4dd0 Merge pull request #85869 from egorzhdan/egorzhdan/remove-interop-compat-version
[cxx-interop] Remove compatibility versions
2025-12-09 15:45:00 +00:00
Slava Pestov
3c4fef164e Sema: Add some LLVM_DEBUG output to CSBindings.cpp 2025-12-09 09:44:52 -05:00
Egor Zhdan
84e7f82363 Reapply "[ConstraintSystem] C++ Interop: Binding a string literal to std.string shouldn't increase the score"
This reverts commit 6852bc9834.

In addition to the original change, this makes sure that C++ `std::string` and Swift `String` are given distinct score, in order to prevent ambiguity which was causing build failures in some projects.

rdar://158439395
2025-12-09 12:55:18 +00:00
Karoy Lorentey
794bbb99b4 [stdlib] Define availability for the 6.4 stdlib and runtime 2025-12-08 17:32:19 -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
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
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
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
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
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
Slava Pestov
8da3b62d7b Merge pull request #85293 from slavapestov/too-complex-source-loc
Sema: Fix source location bookkeeping for 'reasonable time' diagnostic
2025-12-07 01:26:04 -05:00
Slava Pestov
d8cf185a13 Sema: Fix source location bookkeeping for 'reasonable time' diagnostic
We already had bookkeeping to track which statement in a multi-statement
closure we were looking at, but this was only used for the 'reasonable time'
diagnostic in the case that we hit the expression timer, which was almost
never hit, and is now off by default. The scope, memory, and trial limits
couldn't use this information, so they would always diagnose the entire
target being type checked.

Move it up from ExpressionTimer to ConstraintSystem, so that we get the
right source location there too. Also, factor out some code duplication
in BuilderTransform to ensure we get the same benefit for result builders
applied to function bodies too.
2025-12-06 20:31:08 -05:00
Slava Pestov
a99aebb712 Sema: Fix SolutionResult move constructor 2025-12-06 20:31:08 -05:00
Pavel Yaskevich
f0fd506745 [Diagnostics] TildeSendable: Suggest Sendable suppression in explicit Senable warning
Add a note to missing explicit `Sendable` conformance warning
(produced by `-Wwarning ExplicitSendable`) and a fix-it with
a suggestion to suppress `Senable` conformance  via `~Sendable`.
2025-12-05 17:20:55 -08:00
Augusto Noronha
e3c67c905a [RemoteInspection] Read ContextDescriptor from symbol if available
If the MemoryReader can provide a symbol for the context descriptor, use
that instead of building the mangle tree from metadata. This shouldn't
hurt other clients, and would have a few benefits for LLDB:

- Small but numerous memory reads can be expensive for LLDB, building
  the mangle tree from a string should be much faster.

- For types with private discriminators, this allows LLDB to provide the
  same private discriminator that's in DWARF and in the swiftmodule (as
  opposed to using the memory address where the context descriptor lives
  at). This means that these private types would have the same mangled
  name in every run. LLDB persistently caches field descriptors by name,
  but since private discriminators aren't guaranteed to have the same
  mangled name over multiple runs, LLDB would often need to invalidate
  its entire cache and rebuild it. Using the stable UUID would solve
  that issue.

rdar://165950673
2025-12-05 17:14:30 -08:00
Augusto Noronha
d468b5f017 Merge pull request #85823 from augusto2112/use-anonymous-address
[RemoteInspection] Use the address returned by resolveRemoteAddress
2025-12-05 16:56:20 -08:00