Commit Graph

184973 Commits

Author SHA1 Message Date
Konrad `ktoso` Malawski
84c2c38556 Merge pull request #81958 from ktoso/wip-distributed-irgenmangler-more 2025-06-04 21:02:52 +09:00
Alastair Houghton
42ca1b1cc8 Rename SwiftStdlibCurrentOS to StdlibDeploymentTarget.
`StdlibDeploymentTarget` seems to be a better name.

rdar://152498657
2025-06-04 10:40:19 +01:00
Gabor Horvath
d5faddaa9b [cxx-interop] Support Swiftifying C++ constructors
Unfortunately, there is no common abstraction for initializers and
functions in SwiftSyntax, so this PR rolls our own. Alternatively, we
could probably achieve something similar with a new protocol, but we
only needed a handful of fields so this change keeps it simple.

rdar://152112660
2025-06-04 10:06:16 +01:00
Ian Anderson
3114657f0e Merge pull request #81964 from ian-twilightcoder/Isystem-feature-flag
[Option] Add a feature flag for -Isystem
2025-06-03 22:58:24 -07:00
Andrew Kaster
bfc1031801 utils: Add llvm-symbolizer to install_components_with_clang presets
llvm-symbolizer is critical to ASAN/LSAN properly reading and applying
allowlists and suppressions. Without properly symbolized backtraces,
the tools cannot match stack traces to suppression lists, leading to
false negatives in leak detection and other issues.

Ensure that it's installed in the toolchain presets.
2025-06-03 20:06:37 -06:00
Ian Anderson
ae7f9c2266 [Option] Add a feature flag for -Isystem
swift-build needs a flag to know if -Isystem is available.

rdar://152540225
2025-06-03 17:23:44 -07:00
Doug Gregor
9f0dda5417 Add a diagnostic group for the diagnostic about non-Sendable metatypes.
This is a new restriction that folks are sure to run into, so provide
it with some actionable documentation. Fixes rdar://152450956.
2025-06-03 16:45:28 -07:00
Konrad 'ktoso' Malawski
cc532fbbd9 [Distributed] More IRGenMangler fixes for distributed thunks
We also need to mangle the dispatch thunks to distributed thunks
uniquely.
2025-06-04 08:40:19 +09:00
eeckstein
6c3865cf16 Merge pull request #81948 from eeckstein/fix-test
tests: require 64-bit pointersize for SILOptimizer/enum-comparison.swift
2025-06-04 01:05:31 +02:00
Nate Chandler
c41fd47f1f [DestroyAddrHoisting] Skip init_enum_data_addrs.
A destroy of an `init_enum_data_addr` is not equivalent to a destroy of
the whole enum's address.  Treat such destroys just like destroys of
`struct_element_addr`s are treated: by bailing out.

rdar://152431332
2025-06-03 15:32:42 -07:00
Nate Chandler
33d5c8648b [MemAccessUtils] Add to strip access storage casts
The new function stripAccessAndAccessStorageCasts is analogous to the
existing function stripAccessAndIdentityCasts but differs in that the
latter uses isAccessStorageIdentityCast whereas the new function uses
isAccessStorageCast.
2025-06-03 15:32:26 -07:00
Nate Chandler
974d179571 [MemAccessUtils] This instruction changes the type
moveonlywrapper_to_copyable_box changes the type so it's a type cast not
an identity cast.
2025-06-03 15:32:26 -07:00
Nate Chandler
f3c28515b1 [Gardening] Tweaked comments. 2025-06-03 15:32:26 -07:00
Doug Gregor
9957f5240f Merge pull request #81933 from DougGregor/break-isolated-conformance-reference-cycle 2025-06-03 14:54:16 -07:00
Allan Shortlidge
17fa8b9cb5 Merge pull request #81946 from tshortli/warnings
Fix various warnings
2025-06-03 14:37:40 -07:00
Saleem Abdulrasool
75b3fdd121 Merge pull request #81926 from compnerd/android-supplements
Runtimes: repair the Supplemental runtime on Android
2025-06-03 14:31:37 -07:00
Slava Pestov
185a91d955 Sema: Handle nested compositions and parameterized protocols in diagnoseRetroactiveConformances() 2025-06-03 17:28:19 -04:00
Slava Pestov
cd5ecbee16 Sema: Implement missing part of SE-0346
The proposal states that this should work, but this was never
implemented:

    protocol P<A> {
      associatedtype A
    }

    struct S: P<Int> {}

- Fixes https://github.com/swiftlang/swift/issues/62906.
- Fixes rdar://91842338.
2025-06-03 17:28:19 -04:00
Mike Ash
d0248afd14 [Test] Make implicit_weak_capture.swift more robust.
This test creates an object then checks a weak reference to that object on a background thread. It was doing this check after 10ms, and any small hiccup could potentially delay the object's destruction enough to spuriously fail.

Rearrange the test to check the weak reference in a loop for several seconds before giving up. This makes it very fast on success (it's done the moment it sees nil) while being robust against up to several seconds of delay in destroying the object if that happens.

rdar://149868181
2025-06-03 17:08:41 -04:00
Mike Ash
650027e087 [Runtime] Don't redeclare os_unfair_recursive_lock et al if the SDK has them.
rdar://152340726
2025-06-03 16:38:22 -04:00
Saleem Abdulrasool
3d0d95bfe3 Merge pull request #81927 from compnerd/this-reflects-poorly
runtimes: enable reflection by default on ELFish targets
2025-06-03 13:31:47 -07:00
Saleem Abdulrasool
b7151477e3 Merge pull request #81920 from compnerd/search-party
runtimes: add Android search handling for SwiftCore
2025-06-03 13:31:31 -07:00
Slava Pestov
e69a59bad0 Merge pull request #81925 from slavapestov/test-rdar151466803
Add regression test for fixed crasher
2025-06-03 16:23:48 -04:00
Fabrice de Gans
e94cc8626c Platform: Windows SDK 26100.3916 module map update
A minor update to the Windows SDK broke our module maps. This fixes the
issue by re-separating a few modules. For backward-compatibility and
proper export of symbols, the split headers are also included in the
main `ucrt` module.
2025-06-03 11:59:34 -07:00
Mike Ash
47e5edeb3e Merge pull request #81874 from mikeash/remote-mirror-strip-protocol-pointers
[RemoteMirror] Strip protocol descriptor pointers when reading the conformance cache.
2025-06-03 14:49:58 -04:00
Erik Eckstein
d7c5e243ff tests: require 64-bit pointersize for SILOptimizer/enum-comparison.swift
rdar://152175197
2025-06-03 19:57:03 +02:00
eeckstein
50c6824263 Merge pull request #81935 from eeckstein/min-pointer-value-option
IRGen: add an option `-min-valid-pointer-value` to override the target's LeastValidPointerValue
2025-06-03 19:21:58 +02:00
Allan Shortlidge
14341285cb Parse: Fix unused variable warning. 2025-06-03 09:45:46 -07:00
Allan Shortlidge
3914b35623 AST: Fix unused variable warning. 2025-06-03 09:45:25 -07:00
Allan Shortlidge
453f99e929 ASTGen: Fix 'never mutated' warnings. 2025-06-03 09:44:57 -07:00
Pavel Yaskevich
b189b8a320 Merge pull request #81936 from xedin/improve-optional-wrappedValue-mismatch-diagnostics
[CSSimplify] Fix `matchDeepEqualityTypes` to allow fixing of optionals
2025-06-03 09:19:50 -07:00
Meghana Gupta
d1a97f1b0d Merge pull request #81879 from meg-gupta/fixdeserialization
Fix deserialization of lifetime dependencies on ast function types
2025-06-03 08:56:54 -07:00
Saleem Abdulrasool
b0747b24ac Merge pull request #81921 from compnerd/android-parameters
utils: repair the Android build
2025-06-03 08:37:55 -07:00
Saleem Abdulrasool
478823ce6e Merge pull request #81826 from Steelskin/fabrice/update-ucrt-vcruntime-modulemap
Platform: Update module maps for the static SDK
2025-06-03 08:35:47 -07:00
Saleem Abdulrasool
51645d00a3 Merge pull request #81754 from compnerd/closed
IRGen: honour `-static-libclosure` in block creation
2025-06-03 08:35:07 -07:00
Susana Monteiro
e910d9b2f8 Merge pull request #81709 from swiftlang/susmonteiro/ambiguous-use-of-method
[cxx-interop] Fix ambiguous methods in long chains of inheritance
2025-06-03 15:50:28 +01:00
Alastair Houghton
d5ed335339 Merge pull request #81440 from al45tair/currentos-availability
[Concurrency][Stdlib] Add SwiftStdlibCurrentOS availability, use it.
2025-06-03 15:01:22 +01:00
Allan Shortlidge
adedf15270 Merge pull request #81922 from tshortli/visionos-availability-remap-regression
AST/Sema: Fix remapping of iOS availability in diagnostics for visionOS
2025-06-03 04:58:31 -07:00
Guillaume Lessard
975a3fbf11 Merge pull request #81923 from glessard/rdar152467655-inout-lifetime-dependence
[cmake] InoutLifetimeDependence should be enabled
2025-06-03 04:36:16 -07:00
Konrad `ktoso` Malawski
46a4c3ae94 Merge pull request #81899 from ktoso/wip-fix-for-real-ptr-auth 2025-06-03 20:03:06 +09:00
Hamish Knight
d00a3b5764 Merge pull request #81901 from hamishknight/hastype
[CS] Check `hasType` in `isPlaceholderVar`
2025-06-03 11:01:54 +01:00
finagolfin
d8243f8328 [build] Add a new --cross-compile-build-swift-tools flag to disable cross-compiling the compiler (#38441)
This is useful when building cross-compilation toolchains where you want
the stdlib and corelibs cross-compiled but don't want the Swift compiler
cross-compiled too with `--cross-compile-hosts`.
2025-06-03 14:57:29 +05:30
Konrad `ktoso` Malawski
78c68ee069 Merge pull request #81805 from ktoso/wip-distributed-fixes 2025-06-03 18:22:22 +09:00
Slava Pestov
6c4d040440 Merge pull request #81928 from slavapestov/test-issue-81712
Add regression test for fixed crasher
2025-06-03 04:10:10 -04:00
Pavel Yaskevich
4132aa04f9 [Tests] NFC: Update all of the test-cases improved by changes to generic argument mismatch handling 2025-06-03 00:49:06 -07:00
Pavel Yaskevich
7305275dbd [CSSimplify] Produce tailored fixes for a few generic argument mismatches
- Mismatch in tuple element position should reference whole tuple
  with a note for mismatch position;
- Situations where optional object type is not a class but matched
  against `AnyObject` have a tailored fix.
2025-06-03 00:49:06 -07:00
Pavel Yaskevich
27c28d4d64 [CSSimplify] Fix matchDeepEqualityTypes to allow fixing of optionals
Attempting to propagate generic argument failures up is not always
reliable, `matchDeepEqualityTypes` should avoid using `TMF_ApplyingFix`
while dealing with optionals and instead let `repairFailures` decide
whether to use generic arguments mismatch fix to a more general one.
2025-06-03 00:48:59 -07:00
Erik Eckstein
c02bc2d421 IRGen: add an option -min-valid-pointer-value to override the target's LeastValidPointerValue
The LeastValidPointerValue is hard-coded in the runtime.
Therefore this option is only available in embedded swift - which doesn't have a runtime.

rdar://151755654
2025-06-03 09:27:35 +02:00
Pavel Yaskevich
65e83a8bb1 [CSSimplify] Increase impact of a generic argument mismatch if mismatch is contextual
If generic arguments mismatch ends up being recorded on the result
of the chain or `try` expression it means that there is a contextual
conversion mismatch.

For optional conversions the solver currently generates a disjunction
with two choices - bind and optional-to-optional conversion which is
anchored on the contextual expression. If we can get a fix recorded
there that would result in a better diagnostic. It's only possible
for optional-to-optional choice because it doesn't bind the
variable immediately, so we need to downgrade direct fixes to prevent
`bind` choice from considered better.
2025-06-02 23:49:52 -07:00
Doug Gregor
7472a0ca38 Split conformance isolation request to eliminate a reference cycle
Inference of conformance isolation needs to check whether all of the
witnesses are nonisolated. However, witness checking looks at
conformance isolation. To break this reference cycle, split the
conformance isolation request into two requests: a "raw" request that
looks at explicitly-specified isolation, and the existing one that
also performs inference. The existing one builds on the "raw" one, as
does a separate path for the conformance checker.

Fixes rdar://152461344.
2025-06-02 23:37:58 -07:00