Commit Graph

108031 Commits

Author SHA1 Message Date
Slava Pestov
aa62cfdcbb Merge pull request #87037 from slavapestov/prune-disjunctions-toll-free-bridge
Sema: Teach disjunction pruning about CF toll-free bridging
2026-02-06 17:38:31 -05:00
Aidan Hall
88b2c1c056 Merge pull request #86846 from aidan-hall/disable-lifetime-indices
LifetimeDependence: Disable parameter indices in Swift lifetime dependence annotations
2026-02-06 22:34:52 +00:00
Andrew Trick
16699e8110 Merge pull request #87015 from atrick/fix-ossa-rauw
Another fix for the OSSA RAUW utility for unowned phis
2026-02-06 14:13:26 -08:00
Hamish Knight
2ddadb6a0c Merge pull request #87028 from hamishknight/privy
[Sema] SE-0502: Enable `ExcludePrivateFromMemberwiseInit` by default
2026-02-06 21:40:03 +00:00
Slava Pestov
21abe01557 Sema: Teach canPossiblyConvertTo() about CF toll-free bridging 2026-02-06 12:47:33 -05:00
Slava Pestov
22fdb62e51 Sema: Add a couple of type checker performance tests 2026-02-06 12:47:33 -05:00
Meghana Gupta
617deca5ea Merge pull request #87011 from meg-gupta/oslogopt
Fix OSLogOptimization for complete lifetimes in SIL
2026-02-06 09:12:58 -08: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
John Hui
27f970af5e Merge pull request #86995 from j-hui/all-star
[cxx-interop] Fix confusion between multiply and dereference operators
2026-02-06 06:04:14 -08:00
Hamish Knight
bc65846be2 [Sema] SE-0502: Enable ExcludePrivateFromMemberwiseInit by default
Enable the feature by default, and add an experimental feature
`DeprecateCompatMemberwiseInit` to control the deprecation behavior
which was deferred from the proposal.
2026-02-06 11:50:40 +00:00
Egor Zhdan
bdb500d5e8 Merge pull request #86988 from egorzhdan/egorzhdan/only-valid-operators
[cxx-interop] Do not emit invalid C++ operator declarations
2026-02-06 11:39:10 +00:00
Kavon Farvardin
ae77ba81e3 Merge pull request #87013 from kavon/revert-84789
Back out #84789 after additional testing
2026-02-06 02:58:00 -08:00
Aidan Hall
63da6499eb LifetimeDependence: Disable indices in Swift lifetime dependencies
Lifetime indices are never necessary in Swift, they unnecessarily expose
implementation details, and they make lifetime annotations more error-prone,
since they may need to be updated if a function's parameter list changes.

The Swift Syntax parser also cannot handle lifetime annotations where the target
is an index. The main reason the C++ parser supports them is because it is also
used for SIL.
2026-02-06 10:27:01 +00:00
Aidan Hall
e98a7a6bf8 Merge pull request #86842 from aidan-hall/just-func-type-lifetimes-try-print
LifetimeDependence: Support function types
2026-02-06 10:09:25 +00:00
Alastair Houghton
54385105a0 [Backtracing] We don't need to change the driver.
This change in the driver isn't necessary after all.

rdar://101623384
2026-02-06 08:53:16 +00:00
Hiroshi Yamauchi
36be4d294e Remove Clang CASFS (#86973) 2026-02-05 19:32:08 -08:00
Kavon Farvardin
68f615a37c Merge pull request #86994 from kavon/retro-refinement-2
Reparenting: batch of fixes
2026-02-05 18:56:48 -08:00
Meghana Gupta
280057b8d8 Fix OSLogOptimization for complete lifetimes in SIL 2026-02-05 17:01:40 -08:00
Alexis Laferrière
395f1227d5 Merge pull request #86964 from xymus/deser-diag-member
Serialization: Raise a proper error on type members broken by invalid modularization
2026-02-05 16:33:27 -08:00
Pavel Yaskevich
527ab6386a Merge pull request #86967 from xedin/rdar-164077275
[Concurrency] A few fixes for default isolation inference
2026-02-05 15:31:10 -08:00
Andrew Trick
2120c0502a Another fix for the OSSA RAUW utility for unowned phis
Fixes rdar://169556118 (Assertion: (succ->getSinglePredecessorBlock() == predBB)
function visitInsertionPoints at ValueLifetime.cpp:37.)
2026-02-05 15:01:11 -08:00
John Hui
77e50e8ee1 [cxx-interop] Account for non-member deref operator*() (NFC)
Note that new code path doesn't actually seem to be taken, due to
NameImporter logic that renames non-member operators differently.

Adds some test case to at least document current behavior.
2026-02-05 14:13:03 -08:00
Slava Pestov
1b717b37d3 Merge pull request #86993 from slavapestov/move-code-around-in-solver
Sema: Move some code around
2026-02-05 16:16:20 -05:00
Kavon Farvardin
d5f9a1eeeb Revert "Merge pull request #84789 from nickolas-pohilets/mpokhylets/fix-82618"
This reverts commit b633bd37ac, reversing
changes made to b27bb64b03.
2026-02-05 11:34:59 -08:00
Mike Ash
3d15cdea45 Merge pull request #86963 from mikeash/direct-runtime-new-build-fixes
[Runtime] Always look for the SwiftDirect package in the new Runtime build.
2026-02-05 14:32:13 -05: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
eeckstein
8fda8ccd49 Merge pull request #87001 from eeckstein/loop-unroll
LoopUnroll: avoid iterating over an `llvm::DenseMap`
2026-02-05 19:46:56 +01:00
Alexis Laferrière
0ac40aada4 Serialization: Error on type members broken by invalid modularization
Extend support for proper errors on broken modularization to type
members, previously only top-level declarations were reported as error.
This change raises errors with relevant context if a type member is
referenced from a swiftmodule file but at reading the member is not
found or changed shape.

It doesn't report moves between modules like we do for top-level
declarations. This is less likely to happen at the member level as the
check is already applied at the top-level for the same reference. We may
still see such issues when using `SWIFT_NAME` to assign a top-level
declaration to a type from a different module.
2026-02-05 09:56:31 -08:00
Henrik G. Olsson
4c5257d961 Merge pull request #86914 from hnrklssn/verify-expansion-skip-ignored
[DiagnosticVerifier] skip over unrelated diags in expansions
2026-02-05 09:27:07 -08:00
Steven Wu
5e5978c074 Merge pull request #86991 from cachemeifyoucan/eng/PR-169637148
[ClangImporter] compute and set CWD when computeClangImporterFileSystem
2026-02-05 07:56:27 -08:00
Pavel Yaskevich
8736860568 Merge pull request #86992 from xedin/dont-propagate-defaults-up
[CSBindings] Don't propagate defaults up the supertype chain
2026-02-05 07:02:14 -08:00
Pavel Yaskevich
bdd17e47b3 Merge pull request #86904 from xedin/rdar-148395744
[Concurrency] Fix thunk emission for function types with isolated par…
2026-02-05 07:01:46 -08:00
Aidan Hall
a366c4765a [AST] Print function type LifetimeDependenceInfo using parameter labels
We fall back to indices when labels are not available, but labels are
preferable, because they readable, stable, and preferred by the lifetime
dependencies proposal.
2026-02-05 14:50:39 +00:00
Aidan Hall
7b9db38984 LifetimeDependence: Support function types
To a function type's lifetimes, a base version of the type is first created with
no lifetime dependence info. This is then passed to the dependence checker, and
the resulting dependencies are added to it.

It would be possible to do this analysis by passing just the parameter list and
result type (which are available before the type is created), but this approach
lets us avoid dealing with a header inclusion cycle between Types.h, ExtInfo.h,
and LifetimeDependence.h, since it does not require AnyFunctionType::Param to be
defined in LifetimeDependence.h.
2026-02-05 14:50:27 +00:00
Aidan Hall
e401b1a720 [AST] Support multiple of the same attribute per type 2026-02-05 14:50:21 +00:00
Aidan Hall
805d8e9e26 Add language feature ClosureLifetimes 2026-02-05 14:50:14 +00:00
Aidan Hall
b2c79211af Types: + AnyFunctionType::hasExplicitLifetimeDependencies 2026-02-05 14:50:14 +00:00
Aidan Hall
fbb2da1526 Serialization: Add LifetimeDependenceInfo.isFromAnnotation to module format
The isFromAnnotation flag is set if and only if the lifetime originates from a
@lifetime or @_lifetime annotation in the source program.

isFromAnnotation==false means that the lifetime dependence checker would infer
the same lifetime if the Swift type or decl was printed without an annotation
for that dependency. More specifically, it means that the depenence was inferred
by the lifetime dependence checker.

Some dependencies on imported C/C++ decls are "inferred", but they either
correspond to explicit lifetime information in the source (smart pointers,
lifetimebound attribute) or are likely to differ from what the dependence
checker would infer. As such, we set the flag to true for all of them.
2026-02-05 14:50:04 +00:00
Gábor Horváth
b07ff82a8c Merge pull request #86983 from Xazax-hun/module-interface-printing-suppressible
[cxx-interop] Fix printing suppressible conformances for imported types
2026-02-05 14:33:14 +00:00
Slava Pestov
9036602aa1 Sema: Split off BindingProducer.h/.cpp 2026-02-05 09:19:01 -05:00
Slava Pestov
78e9329184 Sema: Move OpenUnboundGenericType to CSGen.cpp 2026-02-05 09:19:01 -05:00
Slava Pestov
cfb6e2db30 Sema: Move InputMatcher from ConstraintSystem.h to CSRanking.cpp 2026-02-05 09:19:01 -05:00
Slava Pestov
7cd06a5088 Sema: Split off TypeVariableType.h/.cpp 2026-02-05 09:19:01 -05:00
Egor Zhdan
4876ce976a [cxx-interop] Do not emit invalid C++ operator declarations
When generating a reverse interop header for a Swift module that declares `func ===` for a Swift type, we were printing `operator===`, which isn't valid in C++.

This teaches reverse interop to only print operators that are valid in C++.

rdar://169474185
2026-02-05 12:59:04 +00:00
Aidan Hall
f39359eb35 LifetimeDependence: Fix issues from earlier refactor
This addresses feedback from #86560:
- Remove redundant collectParameterInfo call
- Consistent naming of ParamInfo variables
- Explicit type name instead of decltype

Also add nullptr checks on afd, as appropriate.
2026-02-05 12:53:38 +00:00
Erik Eckstein
cbf1c24233 LoopUnroll: avoid iterating over an llvm::DenseMap
Use `llvm::MapVector` instead.
Fixes a potential non-determinism bug.
2026-02-05 13:32:11 +01:00
Hamish Knight
abd29f6478 Merge pull request #86982 from hamishknight/prop-rec
[Sema] Correctly handle properties in nested macros
2026-02-05 11:13:02 +00:00
Meghana Gupta
07da5d6655 Merge pull request #86981 from meg-gupta/borrowmutatefeaturefix
Fixes for printing borrow/mutate accessors in swiftinterface files
2026-02-05 01:51:24 -08:00
eeckstein
dcad02e22b Merge pull request #86979 from eeckstein/di-closures
DefiniteInitialization: handle inout-self uses when analyzing closures
2026-02-05 07:27:04 +01:00
John Hui
5b124bc54d [cxx-interop] Fix confusion between multiply and dereference operators
c2952b7 mistakenly treated the binary C++ operator*() ("multiply") as
the unary operator*() ("dereference"), preventing ClangImporter from
synthesizing the Swift func *(_:_) operator. This patch fixes the issue
and adds some tests to exercise the scenario.

rdar://169448888
2026-02-04 19:04:49 -08:00