Commit Graph

2308 Commits

Author SHA1 Message Date
finagolfin
1af61400be [Frontend][Driver] Update a last note to refer to -language-mode instead (#87394)
Also, fix a no-asserts test that was missed, this is a follow-up to
#87284.
2026-02-22 07:57:54 +05:30
Slava Pestov
76dd7106f8 Merge pull request #87387 from slavapestov/incremental-disjunctions-and-bindings
Sema: Start working on incremental binding set and disjunction selection
2026-02-21 09:14:10 -05:00
Slava Pestov
f0efc2350b Sema: Add temporary flags to turn generation of transitive conformance constraints on and off 2026-02-20 21:59:24 -05:00
Ryan Mansfield
f07c1a1b82 Merge pull request #87284 from rjmansfield/se-0441-alias-swap
Swap the alias relationship between -language-mode and -swift-version.
2026-02-20 18:14:44 -05:00
Becca Royal-Gordon
92d5430cb9 Merge pull request #87132 from beccadax/mod-squad-for-all
[ModuleInterface] Enable module selectors by default
2026-02-20 05:25:42 -08:00
Becca Royal-Gordon
1f008fb0d0 [ModuleInterface] Enable module selectors by default
And update tests to use them.

This commit depends on fixes in swiftlang/swift PRs #86905, #87129, and #87130.

Fixes rdar://169749886.
2026-02-20 00:35:23 -08:00
Ryan Mansfield
ae78773ad8 Swap the alias relationship between -language-mode and -swift-version.
As specified in SE-0441, -language-mode should appear in help output
while -swift-version should be the hidden alias.

Related to swiftlang/swift-driver#1894
2026-02-18 16:06:08 -05:00
Steven Wu
7fdf642819 [ExplicitModule] Teach scanner emit loaded module trace
During explicit module build, teach dependency scanner to emit the
module trace file instead of each following compile job command. This
reduces the duplicated info, and allows supporting fully cached build
that only loads module from CAS thus cannot produce the path to the
original module file on disk.

rdar://170007480
2026-02-18 09:10:08 -08:00
Slava Pestov
85e0a9809c Merge pull request #87193 from slavapestov/valid-salvage
Sema: Add flag to force a crash if salvage() found a valid solution
2026-02-13 20:05:58 -05:00
Slava Pestov
272f8fefeb Sema: Add flag to force a crash if salvage() found a valid solution 2026-02-13 08:18:26 -05:00
Henrik G. Olsson
f853564db4 Merge pull request #87131 from hnrklssn/swiftify-enable-subset
[Swiftify] enable safe interop by default
2026-02-11 23:31:32 -08:00
Henrik G. Olsson
d480ea3eee [Swiftify] replace StabilizedSafeInteropWrappers with -disable-safe-interop-wrappers
swift-synthesize-interface needs to match the safe interop wrappers
setting of the compiler invocation that built the Swift module, but
doesn't have -enable/disable-experimental-feature options. Instead of
introducing them for a single feature, which isn't even experimental,
this introduces the -disable-safe-interop-wrappers instead.
2026-02-11 09:32:03 -08:00
Henrik G. Olsson
b39aa89e48 [Swiftify] enable safe interop by default
This enables the stable subset of safe interop wrappers by default. It
can be manually disabled using
`-disable-experimental-feature StabilizedSafeInteropWrappers`.

rdar://148994016
2026-02-10 16:52:34 -08:00
Anthony Latsis
2627c91576 Basic: Replace Version::getValidEffectiveVersions with LanguageMode::allSupportedModes 2026-02-10 16:07:00 +00:00
Anthony Latsis
abf1ca69b4 Basic: Switch upcoming features to LanguageMode 2026-02-10 16:06:58 +00:00
Anthony Latsis
85db41932d Switch ASTContext::isLanguageModeAtLeast to LanguageMode 2026-02-10 16:06:58 +00:00
Hamish Knight
eb45f2396d Replace vfs::getRealFileSystem -> vfs::createPhysicalFileSystem
Calling `setCurrentWorkingDirectory` on `getRealFileSystem` sets the
working directory for the process itself. This is unsafe for clients
such as SourceKit which can process multiple concurrent requests,
and may be used as an in-process library in e.g sourcekit-lsp. Switch
to `createPhysicalFileSystem` instead, where setting the working
directory is done locally on the FileSystem itself.
2026-02-09 09:46:34 +00:00
Alastair Houghton
e38c0652b6 Merge pull request #84906 from al45tair/eng/PR-101623384
[Backtracing] Add initial support for Windows.
2026-02-06 14:53:16 +00:00
Artem Chikin
e168a84355 Merge pull request #86980 from jamieQ/fix-diag-control-bug
[Diagnostics]: restore unknown warning group behavior
2026-02-05 18:59:27 +00:00
Jamie
94eab75e86 [Diagnostics]: restore unknown warning group behavior 2026-02-04 08:15:49 -06:00
Slava Pestov
9623b85b7b Parse: Remove last remnants of 'operator designated types' 2026-02-03 16:34:10 -05:00
Slava Pestov
2e60d29973 Sema: Add -solver-{disable,enable}-performance-hacks flags 2026-02-03 16:34:10 -05:00
Slava Pestov
061958f970 Sema: Eagerly filter out protocol extension operators
This optimizes for the case where we have a disjunction that contains an
operator defined in a protocol, and a protocol defined in a protocol
extension, and furthermore, the protocol extension operator's type is a
refinement of the protocol requirement operator's type.

In this case, there are three possibilities:

- Either the operator requirement is witnessed by a concrete operator
  in the conforming type, in which case the solution involving the
  protocol extension operator is going to be worse, so we can skip this
  choice.

- Otherwise, the protocol requirement operator is witnessed by the same
  protocol extension operator that we skipped, in which case we will find
  the same solution if we just pick the protocol requirement operator
  anyway.

- The only other possibility is that the protocol requirement operator
  is witnessed by a protocol extension operator, but also, a more
  refined protocol extension operator exists. However, it appears that in
  this case, solution ranking _also_ picks the solution involving the
  protocol requirement operator, as the new test case demonstrates.

Thus, we gain nothing by considering these protocol extension operators.
Skip them when forming the disjunction.
2026-02-03 16:34:09 -05:00
Alastair Houghton
a02fea9c7a [Frontend][Driver] Fix Windows paths for swiftCore.
For testing, we need to make sure that we pick up `libswiftCore.dll`
from the `bin` directory, rather than the copy in `lib`.  Otherwise,
when we use the interpreter mode, we'll `LoadLibrary` the one from
`lib`, but Windows found the one in `bin` already, so we end up with
two `libswiftCore.dll`s in the same process, which is bad.

rdar://101623384
2026-02-03 18:23:29 +00:00
Becca Royal-Gordon
d8f38cfa71 [ModuleInterface] Disable aliasing with selectors
When both `-alias-module-names-in-module-interface` and `-enable-module-selectors-in-module-interface` are turned on, the compiler now disables the former with a warning. Eliminates workaround hacks that should no longer be necessary.

Fixes rdar://problem/169132519.
2026-01-28 15:47:52 -08:00
Alexis Laferrière
fce039e841 Merge pull request #86794 from xymus/enable-recovery-from-broken-modules-by-default
Serialization: Enable recovery from broken modularization by default
2026-01-27 15:24:39 -08:00
Slava Pestov
0a6c34325a Frontend: Add -solver-enable-prune-disjunctions flag
Off while I work on this feature.
2026-01-26 21:48:59 +00:00
Alexis Laferrière
be0b7595fe Serialization: Enable recovery from types moving between modules by default 2026-01-26 09:56:30 -08:00
Slava Pestov
d860523944 Merge pull request #86760 from slavapestov/solver-shuffle
Sema: Add -solver-shuffle-disjunctions= and -solver-shuffle-choices= flags for debugging
2026-01-24 12:30:43 -05:00
Slava Pestov
30f1b0187a Sema: Add -solver-shuffle-disjunctions= and -solver-shuffle-choices= flags for debugging 2026-01-23 20:02:21 -05:00
Alexis Laferrière
e3e68b7124 Merge pull request #86727 from xymus/internal-header-warn-no-more
BridgingHeader: Don't warn on using the internal bridging header without library-evolution
2026-01-23 11:22:26 -08:00
Doug Gregor
b47a2ab2e7 Merge pull request #86735 from DougGregor/embedded-dynamic-exclusivity-staging
[Embedded] Put dynamic exclusivity behind a second experimental feature
2026-01-23 02:21:17 -08:00
Doug Gregor
cc2fc8ae65 [Embedded] Put dynamic exclusivity behind a second experimental feature
We need to stage in the behavior change to enable dynamic exclusivity
checking for Embedded Swift. For now, ignore
`-enforce-exclusivity=checked` in Embedded Swift unless the
experimental feature `EmbeddedDynamicExclusivity` is also enabled.

Addresses rdar://168618037, a regression in Embedded Swift code that
is passing `-enforce-exclusivity=checked` explicitly.
2026-01-22 21:22:19 -08:00
eeckstein
ee398d1b18 Merge pull request #86644 from eeckstein/lifetime-completion
Optimizer: enable complete OSSA lifetimes throughout the pass pipeline
2026-01-23 06:14:10 +01:00
Alexis Laferrière
81cff6d4b5 InternalBridgingHeader: Don't warn on use without library-evolution 2026-01-22 14:59:14 -08:00
Erik Eckstein
8158b95a5a Remove the now unused -enable-ossa-complete-lifetimes and -disable-ossa-complete-lifetimes frontend options 2026-01-22 17:41:48 +01:00
Erik Eckstein
18063707b5 Optimizer: enable complete OSSA lifetimes throughout the pass pipeline
This new OSSA invariant simplifies many optimizations because they don't have to take care of the corner case of incomplete lifetimes in dead-end blocks.

The implementation basically consists of these changes:
* add the lifetime completion utility
* add a flag in SILFunction which tells optimization that they need to run the lifetime completion utility
* let all optimizations complete lifetimes if necessary
* enable the ownership verifier to check complete lifetimes
2026-01-22 17:41:48 +01:00
Pavel Yaskevich
b564e8c1bd [Frontend] Remove -enable-constraint-solver-performance-hacks frontend flag
This flag is obsolete and it doesn't have any users.
2026-01-21 11:56:06 -08:00
Yuta Saito
e1e99e896f Merge pull request #86624 from kateinoigakukun/yt/enable-aggressive-reg2mem
[wasm] Enable aggressive reg2mem optimization
2026-01-20 20:13:10 +09:00
Yuta Saito
7826dd263a [wasm] Enable aggressive reg2mem optimization 2026-01-18 09:23:01 +09:00
Alexis Laferrière
0ce07f1cd7 Merge pull request #86565 from xymus/exportability-internal-header
Sema: Enforce non-library-evolution exportability checking with the internal bridging header
2026-01-15 16:06:22 -08:00
Alexis Laferrière
9885eab3a2 Sema: Enable CheckImplementationOnly with internal bridging headers 2026-01-13 14:48:46 -08:00
Ian Anderson
60f2c405d0 Merge pull request #86309 from ian-twilightcoder/system-prefix
[Frontend][Darwin] Use the system prefix from SDK when constructing the default search paths
2026-01-10 00:03:58 -08:00
Ian Anderson
48ab4b0595 [Frontend][Darwin] Use the system prefix from SDK when constructing the default search paths
Some Darwin platforms like DriverKit use a system prefix on all of their search paths. Even though DriverKit isn't supported, add support to get the system prefix from SDKSettings when constructing the default search paths.

This requires the DarwinSDKInfo to be gotten earlier in CompilerInvocation, pass that down to ASTContext through CompilerInstance.

-platform-availability-inheritance-map-path is no longer needed to support visionOS in tests, remove that and its supporting code that gets an alternative DarwinSDKInfo.

rdar://166277280
2026-01-09 12:41:32 -08:00
Doug Gregor
d73cd34805 Always suppress swift_(begin|end)Access calls with -enforce-exclusivity=unchecked
The exclusivity enforcement command-line flags currently impact the
generation of SIL within the current module. However, it does not
impact any SIL that was deserialized from another module, which means
that `-enforce-exclusivity=unchecked` doesn't actually remove all of
the dynamic exclusivity checks.

When dynamic exclusivity is disabled, lower SIL
begin_access/end_access instructions to nothing to ensure that we
won't do any dynamic exclusivity checks.

Use this to better model the reality of dynamic exclusivity checking
in Embedded Swift, which effectively turned off all dynamic
exclusivity checking by having empty stub implementations of
swift_(begin|end)Access. Instead, have Embedded Swift default to
`-enforce-exclusivity=unchecked`, so that it never emits calls to
swift_(begin|end)Access. Remove the stub implementations of
swift_(begin|end)Access from the Embedded Swift runtime, since we will
no longer generate calls to them by default.

Moving forward, this will allow us to conditionally enable the new
implementation of dynamic exclusivity checking by specifying
`-enforce-exclusivity=checked` for Embedded Swift builds. We'll stage
that in over time to avoid breaking existing Embedded Swift clients.
2026-01-09 09:26:39 -08:00
Henrik G. Olsson
1351798ff7 Merge pull request #86138 from hnrklssn/swiftify-swift-shims
[Swiftify] don't attach macro when module does not import stdlib
2026-01-06 22:57:37 -08:00
Becca Royal-Gordon
5fffb3ce2d Merge pull request #86135 from beccadax/mod-squad-independent 2026-01-03 12:01:03 -08:00
Arnold Schwaighofer
bd7d724c89 [embedded] Replace custom -disable-embedded-existentials logic in favor of standard Feature handling mechanism 2025-12-22 14:11:46 -08:00
Becca Royal-Gordon
ad7785713e Disable preserve-types when using module selectors
The old `-module-interface-preserve-types-as-written` workaround flag prevents module selectors from being printed into module interfaces even when they have been explicitly requested. Disable it and emit a warning when it’s used in combination with `-enable-module-selectors-in-module-interface`.

Fixes rdar://166237384.
2025-12-19 14:06:27 -08:00
Mike Ash
6b3e561320 Merge pull request #86015 from mikeash/client-rr-cmake-default
[IRGen] Add a CMake option to configure direct retain/release enablement.
2025-12-19 12:20:59 -05:00