Commit Graph

194681 Commits

Author SHA1 Message Date
Pavel Yaskevich
22ec081377 [AST/Sema] Add a diagnostic group ExplicitSendable to replace -require-explicit-sendable
Always run explicit `Sendable` checks on public types and suppress
warning printing by default instead of using a special compiler argument.

Resolves: rdar://162394810
2025-11-04 17:53:20 -08:00
Kavon Farvardin
5eb4ab260c Merge pull request #85318 from kavon/workaround-rdar164027738
[cxx-interop] mark test as unsupported on Linux
2025-11-04 12:46:25 -08:00
Kavon Farvardin
9ac7a73520 [cxx-interop] mark test as unsupported on Linux 2025-11-04 12:45:20 -08:00
Zixu Wang
18a9d7002f [APIGen] Handle SPI availability for nested decls (#85048)
- Add SPI availability information to `APIAvailability` from attribute
`@_spi_available`.
- Correctly obtain effective availability for nested declarations
without immediate availability attributes.

Resolves rdar://159702280

<!--
If this pull request is targeting a release branch, please fill out the
following form:

https://github.com/swiftlang/.github/blob/main/PULL_REQUEST_TEMPLATE/release.md?plain=1

Otherwise, replace this comment with a description of your changes and
rationale. Provide links to external references/discussions if
appropriate.
If this pull request resolves any GitHub issues, link them like so:

  Resolves <link to issue>, resolves <link to another issue>.

For more information about linking a pull request to an issue, see:

https://docs.github.com/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
-->

<!--
Before merging this pull request, you must run the Swift continuous
integration tests.
For information about triggering CI builds via @swift-ci, see:

https://github.com/apple/swift/blob/main/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift!
-->
2025-11-04 11:34:05 -08:00
Kuba (Brecka) Mracek
b6c29f1ce6 Merge pull request #85136 from kubamracek/section-top-level
SE-0492: Handle top-level `@section`-annotated globals
2025-11-04 11:15:50 -08:00
Kavon Farvardin
e55d18a66b Merge pull request #85313 from mikeash/rr-preservemost-no-embedded
[Runtime] Don't use custom retain/release calling convention in embedded Swift.
2025-11-04 11:06:48 -08:00
Mike Ash
7036784480 [Runtime] Don't use custom retain/release calling convention in embedded Swift.
In embedded mode, some things call retain/release using the C++ declarations, but the implementations are in Swift. The Swift implementations don't use preservemost, so the C++ declarations must not declare preservemost in that context.

rdar://163940783
2025-11-04 13:30:11 -05:00
Saleem Abdulrasool
a134e44138 Merge pull request #71422 from compnerd/docc
build: setup a CMake based build for DocC
2025-11-04 10:12:09 -08:00
Arnold Schwaighofer
a38adb3a20 Merge pull request #85207 from nate-chandler/general-coro/20251023/1
[CoroutineAccessors] Use typed-malloc.
2025-11-04 09:41:01 -08:00
Kavon Farvardin
9c63a5629a Merge pull request #85309 from hamishknight/follow-up
[Sema] A couple of minor follow-ups to #85245
2025-11-04 09:06:58 -08:00
Artem Chikin
d1529b5303 Merge pull request #85282 from jamieQ/dead-diags
[NFC][Diagnostics]: remove a number of unused diagnostics
2025-11-04 12:06:26 -05:00
Alex Hoppen
893340d4f6 Merge pull request #85175 from ahoppen/swift-access-level
[Index] Record the access level of declarations in the index
2025-11-04 16:38:38 +01:00
Jai
d9383e6aa5 Fix crash when accessing span of empty InlineArray (#85268)
Fix crash when creating a Span from an empty InlineArray whose storage
is only byte-aligned. #85265.

---------

Co-authored-by: Guillaume Lessard <glessard@tffenterprises.com>
2025-11-04 10:15:24 -05:00
Hamish Knight
80f426e6bb [SILGen] NFC: Remove unused var 2025-11-04 14:58:06 +00:00
Pavel Yaskevich
3ce0f941e8 Merge pull request #85187 from xedin/rdar-161739470
[AST] NonisolatedNonsendingByDefault: Print `@concurrent` on `nonisol…
2025-11-04 06:28:02 -08:00
Hamish Knight
d3278360be [Sema] NFC: Add a couple of comments 2025-11-04 13:54:34 +00:00
Hamish Knight
01f3cb6017 [test] Fix typo in rdar162800185.swift
I meant to use `%t` here.
2025-11-04 13:54:34 +00:00
Hamish Knight
adb7aaa8cd [AST] NFC: Rename SpecialDistributedProperty -> SpecialDistributedActorProperty
Disambiguate from `distributed var`.
2025-11-04 13:54:34 +00:00
Susana Monteiro
3a2f47ed58 Merge pull request #85236 from susmonteiro/susmonteiro/implicit-move-constructors
[cxx-interop] Implicitly defined move constructors
2025-11-04 09:21:47 +00:00
Daniil Kovalev
971e696b96 [AST] Fix UB appearing due to strict aliasing rule violation (#85286)
This fixes the following tests which are now crashing due to hitting
unreachable "no buffer containing location found" in
`SourceManager::findBufferContainingLoc`:

- attr/attr_dynamic_member_lookup.swift
- AutoDiff/Sema/DerivativeRegistrationCrossModule/main.swift
- Constraints/construction.swift
- Constraints/members.swift
- NameLookup/accessibility.swift
- Sema/call_as_function_simple.swift

The root cause of the crash is as follows. All the tests involve
emitting `InaccessibleMemberFailure` error diagnostic (see
`InaccessibleMemberFailure::diagnoseAsError`). When `DeclNameLoc
nameLoc` is initialized via default constructor and is not re-assigned
with smth meaningful later, the check `nameLoc.isValid()` returns `true`
even though it should be `false`. It turns out that we treat `const void
*LocationInfo` as `SourceLoc` and hope that if `LocationInfo` is
`nullptr`, casting this to `SourceLoc` would produce a "default"
`SourceLoc` with `Pointer` member set to `nullptr`. But such a cast (see
`getSourceLocs()` member of `DeclNameLoc`) is undefined behavior. So,
the compiler assumes that `Pointer` member of `SourceLoc` we try to cast
to is not `nullptr` (due to strict aliasing rule), which leads to
`nameLoc.isValid()` being mistakenly computed as `true`.

This patch resolves the issue by handling this special case separately.
2025-11-04 07:53:30 +00:00
Kuba (Brecka) Mracek
eaa3f8a5b0 Annotate SectionTopLevel.swift with REQUIRES: swift_feature_ParserASTGen 2025-11-03 21:11:05 -08:00
John McCall
ba47e23f51 Merge pull request #84688 from rjmccall/stack-nesting-2
Rewrite `StackNesting` to use a single-pass algorithm
2025-11-03 20:47:16 -08:00
Kavon Farvardin
f1a9b2eb0f Merge pull request #85297 from kavon/xfail-unit-test-rdar163604876
unittests: skip some tests on AL2
2025-11-03 20:36:11 -08:00
Becca Royal-Gordon
2504beeccc Merge pull request #85043 from beccadax/mod-squad-interface
[SE-0491] Conditionally emit module selectors into swiftinterfaces
2025-11-03 19:08:09 -08:00
Xiaodi Wu
591fec274a [stdlib][SR-9438] Re-implement integer-to-string conversion (redux) (#85180)
Inspired by #84826, I've dusted off and completely reworked a native
implementation of integer-to-string conversion.

Besides existing tests in this repository, the core of the
implementation has been comprehensively tested in a separate package for
all bases between 2–36 to demonstrate identical output for all 8-bit and
16-bit values, and for randomly generated 32-bit, 64-bit, and 128-bit
values.

Resolves #51902.

<!--
If this pull request is targeting a release branch, please fill out the
following form:

https://github.com/swiftlang/.github/blob/main/PULL_REQUEST_TEMPLATE/release.md?plain=1

Otherwise, replace this comment with a description of your changes and
rationale. Provide links to external references/discussions if
appropriate.
If this pull request resolves any GitHub issues, link them like so:

  Resolves <link to issue>, resolves <link to another issue>.

For more information about linking a pull request to an issue, see:

https://docs.github.com/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
-->

<!--
Before merging this pull request, you must run the Swift continuous
integration tests.
For information about triggering CI builds via @swift-ci, see:

https://github.com/apple/swift/blob/main/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift!
-->
2025-11-03 21:23:12 -05:00
Slava Pestov
46b41a3ae4 Merge pull request #85288 from slavapestov/narrow-cxx-roundtrip-carveout
IRGen: Only skip round-trip demangler check for types that involve C++ types
2025-11-03 20:17:10 -05:00
Hamish Knight
0f58eb2104 [Sema] Fix and cleanup distributed id/actorSystem synthesis (#85245) 2025-11-04 10:17:05 +09:00
Hamish Knight
e0de61caa4 Merge pull request #85135 from hamishknight/lazy-fix
[AST] Avoid exposing `lazy` local storage var to name lookup
2025-11-04 00:53:31 +00:00
Kavon Farvardin
c06c72a510 unittests: skip some tests on AL2 due to rdar://163604876
It's blocking the Swift CI job https://ci.swift.org/job/oss-swift-package-amazon-linux-2-aarch64/
2025-11-03 15:14:09 -08:00
Kavon Farvardin
3351b936d3 NFC: add explainer on how to disable unit tests 2025-11-03 14:46:04 -08:00
Doug Gregor
73b03ed414 Merge pull request #85262 from DougGregor/clang-deserialization-near-miss
[Serialization] Allow near-misses when matching imported Clang declarations
2025-11-03 14:16:03 -08:00
Kuba Mracek
ee623f8d59 Add @section/@const handling of globals to ASTGen too 2025-11-03 13:47:51 -08:00
eeckstein
73fd67b7e4 Merge pull request #85284 from eeckstein/fix-static-enums
IRGen: don't crash when emitting a statically initialized global enum with a `StaticBigInt` payload
2025-11-03 21:43:14 +01:00
Adrian Prantl
457a2d3325 Merge pull request #85100 from adrian-prantl/163302154
Add a -debug-module-path frontend option
2025-11-03 12:30:55 -08:00
John McCall
8d231d20c6 Rewrite StackNesting to be a non-iterative single-pass algorithm.
The previous algorithm was doing an iterative forward data flow analysis
followed by a reverse data flow analysis. I suspect the history here is that
it was a reverse analysis, and that didn't really work for infinite loops,
and so complexity accumulated.

The new algorithm is quite straightforward and relies on the allocations
being properly jointly post-dominated, just not nested. We simply walk
forward through the blocks in consistent-with-dominance order, maintaining
the stack of active allocations and deferring deallocations that are
improperly nested until we deallocate the allocations above it. The only
real subtlety is that we have to delay walking into dead-end regions until
we've seen all of the edges into them, so that we can know whether we have
a coherent stack state in them. If the state is incoherent, we need to
remove any deallocations of previous allocations because we cannot talk
correctly about what's on top of the stack.

The reason I'm doing this, besides it just being a simpler and hopefully
faster algorithm, is that modeling some of the uses of the async stack
allocator properly requires builtins that cannot just be semantically
reordered. That should be somewhat easier to handle with the new approach,
although really (1) we should not have runtime functions that need this and
(2) we're going to need a conservatively-correct solution that's different
from this anyway because hoisting allocations is *also* limited in its own
way.

I've attached a rather pedantic proof of the correctness of the algorithm.

The thing that concerns me most about the rewritten pass is that it isn't
actually validating joint post-dominance on input, so if you give it bad
input, it might be a little mystifying to debug the verifier failures.
2025-11-03 11:51:17 -08:00
Slava Pestov
d4869193c8 IRGen: Only skip round-trip demangler check for types that involve C++ types
Previously this was disabled entirely if C++ interop was
enabled, which is too broad.
2025-11-03 13:59:06 -05:00
Egor Zhdan
6dbe0cb0da Merge pull request #85249 from egorzhdan/egorzhdan/codeowners
NFC: Update code owners for C++ interop
2025-11-03 10:18:07 -08:00
Kavon Farvardin
d322b9e919 Merge pull request #85289 from charles-zablit/charles-zablit/update-checkout/fix-tuple-unpacking
[update-checkout] fix incorrect number of returned values
2025-11-03 09:48:38 -08:00
Charles Zablit
1d9b6386e9 [update-checkout] fix incorrect number of returned values 2025-11-03 17:16:55 +00:00
Pavel Yaskevich
9f7d31e118 [AST] NonisolatedNonsendingByDefault: Print @concurrent on nonisolated async function types
With the feature enabled any function type without an explicit `@concurrent`
is going to be inferred to be `nonisolated(nonsending)`. `@concurrent` should
always be printed for diagnostic and other purposes because the isolation
checking would consider them to be `nonisolated(nonsending)` otherwise, especially
important to code produced by fix-its.

Resolves: rdar://161739470
2025-11-03 09:13:02 -08:00
susmonteiro
c3cd9939c1 [cxx-interop] Implicitly defined move constructors 2025-11-03 16:16:06 +00:00
Xiaodi Wu
57cf4ce563 [benchmark] Add integer-to-string benchmark (#85209)
A companion to #85180.

<!--
If this pull request is targeting a release branch, please fill out the
following form:

https://github.com/swiftlang/.github/blob/main/PULL_REQUEST_TEMPLATE/release.md?plain=1

Otherwise, replace this comment with a description of your changes and
rationale. Provide links to external references/discussions if
appropriate.
If this pull request resolves any GitHub issues, link them like so:

  Resolves <link to issue>, resolves <link to another issue>.

For more information about linking a pull request to an issue, see:

https://docs.github.com/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
-->

<!--
Before merging this pull request, you must run the Swift continuous
integration tests.
For information about triggering CI builds via @swift-ci, see:

https://github.com/apple/swift/blob/main/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift!
-->
swift-DEVELOPMENT-SNAPSHOT-2025-11-03-a
2025-11-03 11:05:26 -05:00
Evan Wilde
9d3a975170 Merge pull request #85229 from etcwilde/ewilde/nudge-glibc-modulemap
Modularize signal.h on FreeBSD
2025-11-03 07:25:49 -08:00
Erik Eckstein
3150a33076 IRGen: don't crash when emitting a statically initialized global enum with a StaticBigInt payload
Integer literals with `BuiltinIntegerLiteralType` need a special handling.

rdar://162322558
2025-11-03 16:20:04 +01:00
Aidan Hall
0b342ded1c Merge pull request #85237 from aidan-hall/dedup-erase
DebugUtils: Remove eraseFromParentWithDebugInsts
2025-11-03 14:46:18 +00:00
Hamish Knight
6a0278c59f [Sema] NFC: Remove GetDistributedMethodWitnessedProtocolRequirements (#85274)
This has been unused for over a year now (since #71801), let's just
remove it.
2025-11-03 06:10:23 -08:00
Kathy Gray
feebe6aa49 Merge pull request #85235 from kathygray-pl/requirementMachine: Fix crash on pack
Requirement Machine: Fix crash on pack + tuple type
2025-11-03 13:49:34 +00:00
Jamie
c2a42e28f7 [NFC][Diagnostics]: remove a number of unused diagnostics 2025-11-03 07:39:12 -06:00
Alastair Houghton
237a7d53a7 Merge pull request #85234 from al45tair/eng/PR-163661576
[Tests][Threading] Allow 1‰ error in wait times.
2025-11-03 10:30:12 +00:00
Saleem Abdulrasool
91ee1c4833 Merge pull request #85270 from compnerd/default
build: default to Android API 28
2025-11-02 16:48:15 -08:00