Commit Graph

184973 Commits

Author SHA1 Message Date
Slava Pestov
5e3784962f Merge pull request #82115 from slavapestov/get-superclass-for-decl
Fix RequirementMachine crash with invalid AST via getSuperclassForDecl()
2025-06-11 01:59:52 -04:00
Allan Shortlidge
6e3a2d22c8 ModuleInterface: Canonicalize OS version numbers in loaded swiftinterfaces. 2025-06-10 22:11:05 -07:00
Allan Shortlidge
1a8d8413b4 AST: Canonicalize version numbers in @_originallyDefinedIn attributes. 2025-06-10 22:11:05 -07:00
Allan Shortlidge
e16c638fc3 AST: Warn for non-existent platform versions in @available attributes. 2025-06-10 22:11:05 -07:00
Allan Shortlidge
e358cd6309 Tests: Correct invalid platform versions in @available attributes. 2025-06-10 22:11:05 -07:00
Allan Shortlidge
3f305a48c8 AST: Re-map macOS 16 aligned availability versions to 26.
- watchOS 12 -> 26
- visionOS 3 -> 26
- macos 16 -> 26
- iOS 19 -> 26
- tvOS 19 -> 26

The version numbers for `if #available(...)` queries are intentionally not
re-mapped.
2025-06-10 22:11:05 -07:00
Philippe Hausler
af76f1440c Convert DispatchGlobalExecutor deadline casts to a decltype based cast (which should hold on all platforms) 2025-06-10 22:11:05 -07:00
eeckstein
f3d12edec2 Merge pull request #82148 from eeckstein/fix-specializer
GenericSpecializer: remove some kind of instructions if their operands become trivial after specialization
2025-06-11 06:53:03 +02:00
Mohamed Hegazy
43b49dd6a4 Add explicit cast to non-apple platforms 2025-06-10 19:01:32 -07:00
Saleem Abdulrasool
1484f1c5be Merge pull request #82122 from compnerd/versioning
tests: add a new test for the ClangImporter
2025-06-10 15:11:33 -07:00
Evan Wilde
72da5a73a3 Merge pull request #82134 from etcwilde/ewilde/cache-platform-info
SwiftCore: Cache computed platform info
2025-06-10 15:08:43 -07:00
Yuta Saito
2549627293 Merge pull request #82123 from kateinoigakukun/yt/fix-swt-crash-wmo 2025-06-11 06:25:57 +09:00
Andrew Trick
c2271e2cf1 Merge pull request #82137 from atrick/fix-moveonly-storeborrow
Fix MoveOnlyWrappedTypeEliminator handling of store_borrow.
2025-06-10 14:18:52 -07:00
Slava Pestov
7bbb29938e AST: Remove no longer necessary checks of getSuperclassForDecl() result 2025-06-10 16:49:57 -04:00
Slava Pestov
3b6ee7cf0b RequirementMachine: Add an assert 2025-06-10 16:49:57 -04:00
Slava Pestov
5cdc9a6570 AST: More robust TypeBase::getSuperclassForDecl()
This can return ErrorType if the AST is invalid.

A handful of callers handle the ErrorType result, but most don't,
blindly assuming the result is always a nominal type. This resulted
in a crash in at least one test case.

Lift the burden from callers by always returning a nominal type here.
2025-06-10 16:49:57 -04:00
Slava Pestov
3796b327a5 AST: Relax assertion in getContextSubstitutionMap() 2025-06-10 16:49:57 -04:00
Mishal Shah
eebf660e0a Update rebranch scheme to use stable/20250601 2025-06-10 13:49:21 -07:00
Saleem Abdulrasool
9f5c090206 Merge pull request #82125 from Steelskin/fabrice/symlink-clang-headers-static-dep
build: Ensure static headers are always symlinked
2025-06-10 12:46:21 -07:00
Saleem Abdulrasool
897fd5a56d Merge pull request #82126 from Steelskin/fabrice/stdlib-add-vcruntime-dep
modulemap: Add missing dependency on vcruntime
2025-06-10 12:41:41 -07:00
Gábor Horváth
7c5888c566 Merge pull request #82144 from swiftlang/gaborh/using-shadow-decl-mangling 2025-06-10 20:40:22 +01:00
Philippe Hausler
d9c73d303e [Observation] Initial implementation of Observed for transactional tracked values over time (#79817)
This is an implementation for the feature
https://github.com/swiftlang/swift-evolution/pull/2726
2025-06-10 12:22:23 -07:00
Mike Ash
53aa827f8f Merge pull request #81957 from mikeash/implicit-weak-capture-test-timing-fix
[Test] Make implicit_weak_capture.swift more robust.
2025-06-10 15:14:35 -04:00
Dan Blackwell
100a4e096c [concurrency] Move tsan_release to point before task gets destroyed
rdar://152501929
2025-06-10 19:35:46 +01:00
Evan Wilde
b2d34ceea2 Merge pull request #82113 from etcwilde/ewilde/fedora-41-symbols
Add missing symbols for Fedora41
2025-06-10 11:32:41 -07:00
Mike Ash
1d83fe39f3 Merge pull request #81994 from mikeash/neverconsumingtasks-stack-fix
[Test] Reduce stack usage in async_taskgroup_discarding_neverConsumingTasks.swift.
2025-06-10 13:23:53 -04:00
Bassam (Sam) Khouri
9c3143dd1e Merge pull request #80405 from bkhouri/t/main/update_swiftpm_presets
Tests: enable Swift PM tests in Windows toolchain build
2025-06-10 13:19:55 -04:00
Pavel Yaskevich
dbe19b6d5f [TypeChecker] Remove @_inheritActorContext effect from synchronous types
The compiler would previously accept use of `@_inheritActorContext`
on a parameter with a synchronous function type which wasn't marked
as `@isolated(any)`. That is incorrect because in such cases the
attribute has no effect and furthermore would prevent Sendable
and isolation checking.

Uses like that are currently diagnosed by the type-checker but we
need to go one step further and remove the effect in such case to
prevent invalid uses.

Resolves: rdar://143581268
2025-06-10 10:15:37 -07:00
Joe Groff
3d2c89895f Merge pull request #82154 from phausler/pr/timespec_cast_fixes
static cast the tv_sec for the timespec constructions is the dispatch scheduler
2025-06-10 10:04:35 -07:00
Henrik G. Olsson
bd714f57fc [ClangImporter] Look through bounds attributes for template matching
When instantiating templated functions with pointers to the templated
type, the ClangImporter does not strip type sugar. This strips type
sugar for bounds attributes, to make sure that they import the same
regardless of whether they are parsed or not.

rdar://151041990
2025-06-10 18:11:47 +02:00
Philippe Hausler
1e0b9148df static cast the tv_sec for the timespec constructions is the dispatch scheduler 2025-06-10 09:11:10 -07:00
eeckstein
2237d8615e Merge pull request #82142 from eeckstein/mandatory-perf-opt
MandatoryPerformanceOptimizations: some refactoring
2025-06-10 17:45:17 +02:00
Hamish Knight
bfabcf1ae5 [test] Mark 8c2d6198e18a56a.swift as fixed 2025-06-10 16:23:52 +01:00
Michael Gottesman
f31236931b Change send-never-sendable of isolated partial applies to use SIL level info instead of AST info.
The reason I am doing this is that we have gotten reports about certain test
cases where we are emitting errors about self being captured in isolated
closures where the sourceloc is invalid. The reason why this happened is that
the decl returned by getIsolationCrossing did not have a SourceLoc since self
was being used implicitly.

In this commit I fix that issue by using SIL level information instead of AST
level information. This guarantees that we get an appropriate SourceLoc. As an
additional benefit, this fixed some extant errors where due to some sort of bug
in the AST, we were saying that a value was nonisolated when it was actor
isolated in some of the error msgs.

rdar://151955519
2025-06-10 08:09:32 -07:00
Hamish Knight
4b2af07ec6 Merge pull request #82118 from hamishknight/excode
[cmake] Remove remaining `XCODE` checks
2025-06-10 16:01:56 +01:00
Gabor Horvath
059051cf69 [cxx-interop] Fix crash in ASTMangler triggered by UsingShadowDecls
We did not handle this declaration kind. This PR introduces makes sure
we mangle it the same way we do for the target declaration.

Fixes #82108.
2025-06-10 15:50:54 +01:00
Erik Eckstein
73da214986 GenericSpecializer: remove some kind of instructions if their operands become trivial after specialization
Fixes a SIL verifier crash.

https://github.com/swiftlang/swift/issues/82093
rdar://152807200
2025-06-10 16:49:54 +02:00
eeckstein
48ebd524ba Merge pull request #82140 from eeckstein/fix-init-static-globals
SIL: let `Type.getNominalFields` return nil for a struct with unreferenceable storage
2025-06-10 15:33:38 +02:00
Hamish Knight
ba715db935 Merge pull request #82103 from hamishknight/fuzzy
[test] Add a few more known type-checker crashers
2025-06-10 12:29:39 +01:00
susmonteiro
848fad0021 [cxx-interop] Support for printing C++ foreign references 2025-06-10 12:15:21 +01:00
Erik Eckstein
8d73f881e8 SIL: let getNominalFields return nil for a struct with unreferenceable storage
Like C bitfields.
Fixes a crash in the InitializeStaticGlobals pass in case a global having a C struct type with bitfield is initialized statically.
2025-06-10 10:55:40 +02:00
Erik Eckstein
f0b3ec05b4 MandatoryPerformanceOptimizations: some refactoring
NFC
2025-06-10 08:10:42 +02:00
Andrew Trick
16fffd1704 Fix MoveOnlyWrappedTypeEliminator handling of store_borrow.
Defer visiting an instruction until its operands have been visited. Otherwise,
this pass will crash during ownership verification with invalid operand
ownership.

Fixes rdar://152879038 ([moveonly] MoveOnlyWrappedTypeEliminator ownership
verifier crashes on @_addressableSelf)
2025-06-09 19:45:09 -07:00
Meghana Gupta
7d454533a0 Merge pull request #82067 from meg-gupta/lifetimeunderscored
Update spelling for representing lifetime dependencies to @_lifetime
2025-06-09 19:01:31 -07:00
Allan Shortlidge
26d589e099 Merge pull request #82075 from tshortli/diagnose-unrecognized-availability-domains-as-errors
AST: Diagnose unrecognized platforms as errors with `CustomAvailability` enabled
2025-06-09 18:22:30 -07:00
Evan Wilde
d34347876d SwiftCore: Cache computed platform info
Implements a similar caching mechanism to what CMake uses for detecting
the compiler. The file is created based on the computed values and
allows us to avoid calling the compiler if we aren't going to extract
out any platform info.
2025-06-09 18:01:56 -07:00
Allan Shortlidge
c0589753d4 Merge pull request #82079 from tshortli/implementation-only-deprecation-diagnostic-group
AST: Add a warning group for `@_implementationOnly` deprecation diagnostics
2025-06-09 17:43:30 -07:00
Fabrice de Gans
5d50279c2a build: Ensure static headers are always symlinked
When using the Swift static build on Windows, projects like Foundation
use the clang headers from the toolchain build `lib` directory. No
target in the toolchain build depends on the static clang headers, so
they do not get installed. As a workaround, this makes the static clang
headers symlink target a dependency of the regular dynamic version of
the headers, ensuring they are installed as part of the toolchainb
build.
2025-06-09 15:27:13 -07:00
Fabrice de Gans
4596a04f6a modulemap: Add missing dependency on vcruntime
`stdlib.h` includes `limits.h`, which is defined in the `vcruntime`
module.
2025-06-09 15:20:58 -07:00
Yuta Saito
e46480e98c [wasm] Emit libTesting.a objects with single-threaded LLVM codegen unit
Since 5f2b0022d1, swift-testing is being
compiled with WMO, which removes some of inter-object references in
object files by DCE. The inter-object reference removal revealed a
long-standing issue that the runtime metadata sections of objects in an
archive are not always included in the final binary if symbols from
those objects are not referenced anywhere. To force including all
metadata sections in the final binary, we have to emit everything in a
single object file when building the archive.
This issue happens only for Wasm SDK, which ships swift-testing as a
static archive.
2025-06-09 21:48:59 +00:00