Commit Graph

4149 Commits

Author SHA1 Message Date
Hamish Knight
5d1f219acb Change InlineArray sugar separator x -> of 2025-05-30 13:50:22 +01:00
Ben Barham
3c098782b4 Add the distribution tag to -print-target-info
Ideally this would also update the `--version` output to be overridden
by `SWIFT_TOOLCHAIN_VERSION`, but unfortunately various tools rely on
the current format (eg. swift-build).
2025-05-28 17:29:17 -07:00
Doug Gregor
abad2fae0f Make the optional feature StrictMemorySafety migratable
This feature is essentially self-migrating, but fit it into the
migration flow by marking it as migratable, adding
`-strict-memory-safety:migrate`, and introducing a test.
2025-05-22 11:07:13 +01:00
Doug Gregor
a32782bcbc Make InferIsolatedConformances a migratable upcoming feature
When migrating, provide warnings that add 'nonisolated' to nonisolated
conformances that don't already have it and would end up being inferred
to be isolated under the upcoming feature.
2025-05-22 11:07:13 +01:00
Artem Chikin
24f2975db6 Merge pull request #81510 from artemcm/ConstSyntacticVerify
[Compile Time Values] Add syntactic verification of valid expressions in `@const` contexts
2025-05-21 13:22:05 -07:00
Stephen Canon
3aa7b592b6 Implement Builtin.select binding llvm select instruction (#81598)
Not used (yet), but needed to implement SIMD.replacing(with:where:) idiomatically, and probably useful otherwise.
2025-05-20 13:30:59 -04:00
Artem Chikin
d8176a7e89 [Compile Time Values] Add syntactic verification of valid expressions in '@const' contexts
Syntactically verify that initializer expressions of '@const' variables and argument expressions to '@const' parameters consist strictly of syntactically-verifiable set of basic values and operations
2025-05-20 09:38:36 -07:00
Hamish Knight
d672f750e7 [Basic] Rename abortWithPrettyStackTraceMessage to ABORT
Turn it into a wrapping macro that includes the file location, and
move into `Assertions.h`.
2025-05-19 20:55:01 +01:00
Hamish Knight
ffb474e0b9 [Basic] NFC: Factor out _FILENAME_FOR_ASSERT macro 2025-05-19 20:55:01 +01:00
Hamish Knight
92641253f7 [Basic] NFC: Remove ASSERT_help from header
It's not clear this is a useful utility to expose since it will only
print the message once.
2025-05-19 20:55:01 +01:00
Hamish Knight
d46aec9f00 [Basic] Handle multiline strings in abortWithPrettyStackTraceMessage
Improve the formatting by indenting to match the rest of the
pretty stack trace.
2025-05-19 20:55:01 +01:00
Erik Eckstein
7f6fb74418 SILBridging: move BridgedInstruction.OptionalInt -> BridgedOptionalInt in BasicBridging.h 2025-05-15 21:29:02 +02:00
Pavel Yaskevich
c050e8f75a [AST] Protect declarations with @_inheritActorContext(always) by a feature flag
This is going to avoid condfails when declarations are printed
in the swiftinterface files.
2025-05-14 20:07:59 -07:00
Becca Royal-Gordon
36de3a85e9 Merge pull request #81459 from beccadax/mod-squad-serialize 2025-05-14 19:25:22 -07:00
Becca Royal-Gordon
c3a61bee0e Add experimental feature for module selector 2025-05-14 11:16:02 -07:00
Steven Wu
3c81c1ca9f [Caching] Remove CASFS clang module implemenation
Remove the CASFS based clang module implemenation as it is not longer
used.
2025-05-14 09:35:03 -07:00
Steven Wu
201e4faea7 [Caching] Reduce the number of cas ID passed on frontend commandline
Using IncludeTree::FileList to concat the include tree file systems that
are passed on the command-line. This significantly reduce the
command-line size, and also makes the cache key computation a lot
faster.

rdar://148752988
2025-05-13 09:20:13 -07:00
Mike Ash
0f2b047155 [Concurrency] Use reinterpret_cast for function_cast when ptrauth is on.
We need to use reinterpret_cast when ptrauth is enabled to ensure that any necessary auth-and-sign operations are performed.

rdar://150747009
2025-05-08 16:28:45 -04:00
Ben Barham
6667471b3d Merge pull request #81115 from beccadax/abi-let-you-graduate
Finish implementing `@abi` (SE-0476)
2025-05-08 12:52:00 -07:00
Becca Royal-Gordon
01431b87b2 Make @abi non-experimental
This includes changing the feature name so that compilers with the experimental feature don’t accidentally pick up content that only works in the final version.

Resolves rdar://150065196.
2025-05-05 13:50:51 -07:00
Michael Gottesman
9d59dbed17 [swift-settings] Now that we aren't using it immediately, remove it from tree.
We can always get it back from the git history.

rdar://150695113
2025-05-05 13:39:03 -07:00
Egor Zhdan
b51cfa5c76 [cxx-interop] Remove symbolic import mode
Importing C++ class templates in symbolic mode has proven to be problematic in interaction with other compiler features, and it isn't used widely. This change removes the feature.

rdar://150528798
2025-05-02 18:43:09 +01:00
Karoy Lorentey
74efc7d354 Merge pull request #80859 from lorentey/is_same_metatype_condfail
[stdlib] Allow metatype comparisons to work with outdated compilers
2025-05-02 00:06:18 -07:00
Pavel Yaskevich
085078dd8a [Feature] Rename Feature APIs from adoption to migration 2025-04-28 11:52:46 -07:00
Pavel Yaskevich
2a479acf9e [Feature] NFC: Rename ADOPTABLE_ with MIGRATABLE_ to match the proposal 2025-04-28 10:42:22 -07:00
Pavel Yaskevich
6d89bca765 [Frontend] Add ExtensibleAttribute to guard use of @extensible attribute
Guard against condfails when older compilers get a swift interface
that uses `@extensible` attribute. The attribute itself doesn't
have any effect in swift interfaces yet since all of the public
enums are already resilient in that mode.
2025-04-24 12:09:17 -07:00
Pavel Yaskevich
c110941c27 [Frontend] Rename AsyncCallerExecution upcoming feature to NonisolatedNonsendingBeDefault 2025-04-21 13:59:29 -07:00
Pavel Yaskevich
a3d35d54e5 [Frontend] Mark AsyncCallerExecution as an upcoming feature in Swift 7 2025-04-21 11:45:48 -07:00
Becca Royal-Gordon
8f75878455 Forbid @_borrowed in @abi
It has indirect effects on the accessors, so it shouldn’t matter, but we can defensively redirect the query to the API counterpart anyway.

This was the last `InferredInABIAttr` attribute, so we can now remove all of the infrastructure involved in supporting attribute inference.
2025-04-18 14:50:01 -07:00
Hamish Knight
3c302349ee Merge pull request #80853 from hamishknight/macro-async-warning 2025-04-18 16:22:28 +01:00
Pavel Yaskevich
bc0d47484f Merge pull request #80833 from xedin/print-supported-features
[Frontend] Add a way to print features supported by the compiler
2025-04-18 00:24:47 -07:00
Alexis Laferrière
405a84e7d6 Merge pull request #80744 from xymus/cdecl-global-function-checking
Sema: Intro experimental @cdecl and basic C compatibility check
2025-04-17 15:31:30 -07:00
Pavel Yaskevich
18703d64d6 [Frontend] Rework -emit-supported-features mode into -emit-supported-arguments
The "featues" part was never actually implemented and Swift Driver
is replying on information about arguments, so instead of removing
this mode, let's scope it down to "arguments" to be deprecated in
the future.
2025-04-17 12:33:23 -07:00
Guillaume Lessard
a5c561fb13 Merge pull request #80831 from glessard/rdar149227278-nonescapable-mutating-accessor
[LifetimeDependenceMutableAccessors] defensive feature flag
2025-04-17 09:27:23 -07:00
Pavel Yaskevich
55bd906906 [Frontend] Add -print-supported-features option
This is a replacement for `-emit-supported-features` that prints
all of the upcoming/experimental features supported by the compiler
with some additional meta information in JSON format to stdout.
2025-04-16 16:34:47 -07:00
Karoy Lorentey
0c406b89e6 [stdlib] Allow metatype comparisons to work with outdated compilers
Add a new language feature to avoid the stdlib’s swiftinterface becoming unintelligible to outdated compiler builds due to the generalization of Builtin.is_same_metatype.

rdar://149396721
2025-04-16 12:45:09 -07:00
Hamish Knight
14bd41159e NFC: Abstract away the use of '7' to represent the next language mode
Introduce `Version::getFutureMajorLanguageVersion` to make it easier
to find clients that will need to be updated once we have a new
language mode.
2025-04-16 19:22:52 +01:00
Alexis Laferrière
a6beaf8deb Merge branch 'main' into cdecl-global-function-checking 2025-04-16 11:19:37 -07:00
Guillaume Lessard
e2ad40debf [LifetimeDependenceMutableAccessors] add a long feature flag 2025-04-15 10:40:22 -07:00
Alejandro Alonso
42b416171a Add feature for value generic namelookup 2025-04-14 15:33:05 -07:00
Doug Gregor
fed5b2628a Merge pull request #80702 from DougGregor/enable-se-0470
[SE-0470] Enable isolated conformances by default
2025-04-14 15:09:18 -07:00
Alastair Houghton
352907fc3e Merge pull request #80758 from al45tair/eng/PR-149058236
[Concurrency] Remove -executor-factory option and replace with magic type.
2025-04-14 09:21:25 +01:00
Doug Gregor
3380331e7e [SE-0470] Enable isolated conformances by default
The IsolatedConformances feature moves to a normal, supported feature.
Remove all of the experimental-feature flags on test cases and such.

The InferIsolatedConformances feature moves to an upcoming feature for
Swift 7. This should become an adoptable feature, adding "nonisolated"
where needed.
2025-04-13 15:41:53 -07:00
Pavel Yaskevich
734b1f1705 [Frontend] Add a feature to guard use of @concurrent and nonisolated(nonsending) in swift interface files 2025-04-11 15:59:25 -07:00
Pavel Yaskevich
f1b3c7b604 [AST] Remove ExecutionAttribute experimental feature
SE-0461 has been accepted and `@concurrent` and `nonisolated(nonsending)`
can be make generally available now.
2025-04-11 15:59:25 -07:00
Alexis Laferrière
02b5998536 Parser: Intro @cdecl attribute and gate it behind feature flag CDecl 2025-04-11 11:34:39 -07:00
Gábor Horváth
99afbc164a Merge pull request #80713 from swiftlang/gabroh/safe-wrappers-in-prod
[cxx-interop] Make safe interop wrapper accessible in production compilers
2025-04-11 14:23:02 +01:00
Alastair Houghton
94b054479b [Concurrency] Remove -executor-factory option and replace with magic type.
We decided that using a magic typealias to set the executor factory was better
than using a compiler option. Remove the `-executor-factory` option, and replace
by looking up the `DefaultExecutorFactory` type, first in the main module, and
then if that fails in Concurrency.

rdar://149058236
2025-04-11 13:55:38 +01:00
Mike Ash
433ca8ea81 Merge pull request #80516 from mikeash/function-cast
[Runtime] Add function_cast, switch from std::bit_cast.
2025-04-11 05:15:25 -04:00
Mike Ash
185b739cf1 [Runtime] Add function_cast, switch from std::bit_cast.
Function types aren't always trivially copyable, e.g. with address-discriminated signed pointers on ARM64e. Introduce a function_cast helper and use that instead.
2025-04-10 20:29:02 -04:00