Commit Graph

195767 Commits

Author SHA1 Message Date
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
4479b49fd8 SIL: Handle address ReturnInsts from borrow accessors as yielding uses.
This avoids a spurious lifetime error when an address-only borrow accessor returns a
non-`Escapable` value from a non-`Escapable` aggregate.
2025-12-10 11:44:41 -08:00
Saleem Abdulrasool
528cca0c2f test: adjust the path compuation for plugins
DLLs on Windows are built/installed into the binary directory while only
import libraries are placed into the library directory to differentitate
between the distributable and developer content. Introduce a helper to
compute the appropriate plugin path.
2025-12-10 11:26:29 -08:00
Steven Wu
da8b721654 Merge pull request #85926 from cachemeifyoucan/eng/PR-ebm-scirpt
[TEST-ONLY] Add utility to perform explicit module build
2025-12-10 10:52:03 -08:00
Tim Kientzle
efdd00892c Merge pull request #85797 from tbkka/tbkka-float-parsing
Reimplement Floating-Point Parsing in pure Swift
2025-12-10 18:42:41 +00:00
Slava Pestov
1013d25746 SILGen: Fix keypath descriptor emission for class nested inside generic context
hasGenericParamList() is the wrong thing to check -- we actually need to
know if any parent context is generic, as well.

- Fixes https://github.com/swiftlang/swift/issues/85860.
2025-12-10 13:28:54 -05: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
John Bute
90aaa0fe3e using msvc compilers instead 2025-12-10 13:09:13 -05:00
John Bute
1128182d67 add c to usebuiltcompilers for swiftargumentparser build 2025-12-10 13:09:13 -05:00
John Bute
ec11ba8717 bumped minor version number swift argument parser 2025-12-10 13:09:13 -05:00
Meghana Gupta
96cfec4f84 Merge pull request #85935 from meg-gupta/lifetimeflags
Fix swiftinterface printing of accessors and inferred lifetime dependencies when Lifetimes feature is enabled
2025-12-10 10:01:01 -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
Hamish Knight
f0d4572a92 [SourceKit] Always check buffer in SemanticAnnotator
Make sure we don't ever try to record semantic tokens for a different
buffer. This works around an ASTWalker issue where it will walk macro
expanded bodies even in non-macro-expansion mode.

rdar://165420658
2025-12-10 17:41:00 +00:00
Charles Zablit
f7c4dd81b7 Merge pull request #85702 from charles-zablit/charles-zablit/update-checkout/add-status-command 2025-12-10 17:40:55 +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
Max Desiatov
f9c064d161 Merge pull request #85844 from MaxDesiatov/wasm-build-instructions
docs: Add instructions for Wasm stdlib building and testing
2025-12-10 16:07:39 +00: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
Mishal Shah
0c0a98d591 Merge pull request #85943 from egorzhdan/egorzhdan/std-function-compile-error
[cxx-interop] Fix compile error
2025-12-10 06:59:10 -08:00
Arnold Schwaighofer
4730181c7a Merge pull request #85914 from aschwaighofer/embedded_foreign_type_metadata
[embedded] Add support for some foreign metadata
2025-12-10 06:58:55 -08:00
Pavel Yaskevich
2c9092486e Merge pull request #85939 from xedin/rdar-159408715
[Diagnostics] Don't attempt to synthesize arguments when destructurin…
2025-12-10 06:49:02 -08:00
Pavel Yaskevich
cb8d672511 Merge pull request #85873 from xedin/rdar-165862285
[CSRanking] Disambiguate static vs. instance method that used to be s…
2025-12-10 06:48:20 -08:00
Hamish Knight
28d637625a Merge pull request #85928 from hamishknight/overrun
[test] Add a couple more unterminated string delimiter test cases
2025-12-10 14:01:12 +00:00
Hamish Knight
63abfab670 Merge pull request #85738 from hamishknight/to-wit
[Frontend] Enforce an error was emitted for invalid conformance
2025-12-10 14:00:14 +00:00
Egor Zhdan
39d13c4093 [cxx-interop] Fix compile error
This fixes a compiler error introduced by ad56e061. The signature of `isMemberwiseInitializer()` changed after the CI ran on the PR.
2025-12-10 13:43:21 +00: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
3dcd9bb011 Merge pull request #85938 from slavapestov/12-year-old-fixme-strikes-back
Sema: Tighten ridiculous disambiguation hack for overloaded type declarations
2025-12-10 06:53:43 -05:00
Slava Pestov
e7d2c163be Merge pull request #85933 from slavapestov/fix-ben-regression
Sema: Disambiguate some more bidirectional conversions
2025-12-10 06:53:01 -05:00
Tim Kientzle
313c4a6e77 Do not bother trying to run this test on watchOS 2025-12-10 09:06:53 +00:00
Slava Pestov
6701e5b39b Sema: Tighten ridiculous disambiguation hack for overloaded type declarations
We noticed that a project failed to build with prepared overloads enabled,
but built successfully with prepared overloads disabled.

It turns out that the code clearly should never have been accepted in the
first place, because the type checker was making an arbitrary choice between
two nominal type declarations with the same name.

Further inspection revealed this was because of a FIXME added in 2013 which
was far too broad. Tighten up the logic here to only disambiguate if at least
one of the two declarations is a type alias, and it has the same underlying
type as the other one. A choice between unrelated nominal type declarations
should always be ambiguous.

This still isn't perfect, because we might have two generic type aliases
that are referenced in both solutions with different substitution maps,
in which case we will still erroneously pick the first one. But this
is better than the old logic, at least.

Fixes rdar://165863775.
2025-12-09 22:48:12 -05:00
Saleem Abdulrasool
58035835d2 Merge pull request #85899 from compnerd/filename
DriverTool: adjust `argv[0]` scanning for CAS
2025-12-09 18:13:01 -08:00
Pavel Yaskevich
1f887202e1 [Diagnostics] Don't attempt to synthesize arguments when destructuring a single tuple argument results in an overrun
If arguments are represented by a single tuple it's possible
that the issue is not about missing parameters but instead
about tuple destructuring. Fix `fixMissingArguments` to check for
overruns after destructuring and stop if that produces more
arguments then parameters because such situations are better
diagnosed as a general conversion failure rather than a missing
argument(s) problem.

Resolves: rdar://159408715
2025-12-09 16:52:41 -08:00
Kyle Robson
f8f107f857 <rdar://165142180> fix immediate Task docs (#85626)
Co-authored-by: Kyle Robson <kyledr@apple.com>
2025-12-10 09:51:19 +09:00
Slava Pestov
d5c049ed69 Sema: Better debug output in compareSolutions() 2025-12-09 18:38:19 -05:00
Slava Pestov
f3e6b4ceda Sema: Disambiguate some more bidirectional conversions
This fixes an ambiguity introduced by the stdlib change in
0f99458900.

Since (borrowing T) -> () and (T) -> () both convert to
each other, we could end up with ambiguous solutions where
neither one was better than the other. Generalize the
existing trick we use for labeled vs unlabeled tuples to
also strip off ownership specifiers and @convention(...)
from function types. This fixes the regression, as well
an existing FIXME in a test I added a while ago where
the same problem arises with @convention(block).
2025-12-09 18:31:59 -05: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
Meghana Gupta
4089775de8 Fix swiftinterface printing of accessors and inferred lifetime dependencies when Lifetimes feature is enabled 2025-12-09 14:59:41 -08:00
Andrew Trick
f7c3c6f437 Fix InteriorUseWalker: consider partial_apply [on_stack] an escape
Fixes a bug in MandatoryDestroyHoisting where a captured value is destroyed
before a copy of the closure.

On-stack closures can be copied, and all copied uses must be within the borrow
scope of the captured operand. This is just like any other non-Escapable value,
so treat it as such by checking `Value.mayEscape` rather than `Type.Escapable`.

Originally, I wanted to make it illegal to copy of partial_apply [on_stack], but
it looks like we still allow it.

I would rather not complicate any logic yet with special handling for this
case. To fix any performance concerns, we might be able to simplify the
representation instead by banning copy_value on on-stack closures.

Fixes rdar://165850554 swift-frontend crash: While running "CopyPropagation" -
Invalid SIL provided to OSSACompleteLifetime?!)
2025-12-09 14:38:04 -08:00
Slava Pestov
1e9f8826a7 Sema: Split off Apple-specific parts of bidirectional_conversions.swift test 2025-12-09 17:35:04 -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
Evan Wilde
b2797334eb CMake: StringProcessing: Embed Plist Sections
Generate and embed plists for StringProcessing libraries.

rdar://165944416
2025-12-09 13:39:36 -08:00
Alexis Laferrière
85d522e4c2 Merge pull request #85917 from xymus/exportability-nle-classes
Sema: Allow non-open class properties to reference hidden dependencies in non-library-evolution mode
2025-12-09 13:36:01 -08:00
John Hui
f1e2b7a07f Merge pull request #85723 from an0/my-branch
[ClangImporter] Fix NS_CLOSED_ENUM to validate raw values
2025-12-09 13:35:30 -08:00
Evan Wilde
1f9bdcadc2 CMake: StringProcessing: Catalyst support
Enable catalyst support in Apple StringProcessing builds
2025-12-09 13:34:29 -08: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
Hamish Knight
d9222877e0 [test] Add a couple more unterminated string delimiter test cases 2025-12-09 21:02:55 +00:00
Hamish Knight
20bee09dc9 Merge pull request #85889 from hamishknight/overrun
[Parse] Fix buffer overrun in `advanceIfMultilineDelimiter`
2025-12-09 20:26:24 +00:00
Steven Wu
756e53967e [TEST-ONLY] Add utility to perform explicit module build
Add a script to build all dependencies for explicit module build in one
step. This reduces the boiling plate code needed to write a test for
explicit module build and allows the test to be more cross platform and
resilient to module dependencies changes.
2025-12-09 12:16:18 -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