Commit Graph

46689 Commits

Author SHA1 Message Date
Nate Chandler
1fe65b0e3d [NFC] Deleted two unused functions. 2025-08-14 16:15:43 -07:00
Mykola (Nickolas) Pokhylets
31470bbd1e Merge pull request #82732 from nickolas-pohilets/mpokhylets/weak-let-feature
Wrap SE-0481 into an upcoming feature until source incompatibilities are resolved
2025-08-14 23:59:28 +02:00
Slava Pestov
3dcadf8bb0 AST: Add typeCheckFunctionBodies parameter to ReplaceOpaqueTypesWithUnderlyingTypes 2025-08-14 17:01:47 -04:00
Slava Pestov
24ee8cf681 AST: Add typeCheckFunctionBodies parameter to getUniqueUnderlyingTypeSubstitutions() 2025-08-14 17:01:47 -04:00
Allan Shortlidge
0bba9bbc26 AST: Make the decl associated with an AvailabilityDomain a ValueDecl.
A decl that represents an `AvailabilityDomain` should always be a `ValueDecl`.
2025-08-14 11:35:00 -07:00
Michael Gottesman
02e5d34072 Merge pull request #83713 from gottesmm/pr-aafde8f9504b8c489ae57840df99bb8510a02352
[sns] Refactor duplicate code into a helper. NFC.
2025-08-13 22:08:10 -07:00
Michael Gottesman
18b1fbce7a [sns] Refactor duplicate code into a helper. NFC.
The specific code path is the code used to emit errors if we assign or merge
into a sending result. I just left the code in tree in the short term to prevent
cherry-picking issues and since there wasn't a strong reason to do it at the
time. Now that we have more freedom, lets clean up this code!
2025-08-13 17:02:49 -07:00
Saleem Abdulrasool
4231a362a0 Merge pull request #83554 from compnerd/remote-mirror
Runtimes: add SwiftRemoteMirror to the new runtimes build
2025-08-13 16:41:17 -07:00
Artem Chikin
f7bc37410e Merge pull request #83532 from artemcm/AdjustDarwinCxxInteropCycleHack
[Dependency Scanning][C++ Interop] Avoid `CxxStdlib` overlay lookup for binary Swift dependencies which were not built with C++ interop
2025-08-13 15:29:14 -07:00
Hamish Knight
5e27e83456 Merge pull request #83613 from hamishknight/next-step
[IDE] Perform extension binding after AST mutation
2025-08-13 22:37:56 +01:00
Saleem Abdulrasool
cea749498b RemoteInspection: remove llvm/Config/abi-breaking.h reference
This removes the aforementioned header, assuming that the user will
manually define `LLVM_ENABLE_ABI_BREAKING_CHECKS` if they are interested
in the ABI breaking tests.
2025-08-13 08:48:46 -07:00
Allan Shortlidge
770c6337f6 Merge pull request #83672 from tshortli/refactor-dump-availability-scopes
Frontend: Allow `-dump-availability-scopes` to be used with any action
2025-08-12 23:39:33 -07:00
Anthony Latsis
ec38c6e25d Merge pull request #83645 from swiftlang/jepa-rebranch
[cmake] APIDigester, IDE: Specify Clang link dependencies
2025-08-13 00:27:40 +01:00
Allan Shortlidge
5d3d93478a Frontend: Inherit compiler debugging options during module interface actions.
When building a module interface for the -typecheck-module-from-interface or
-compile-module-from-interface actions, inherit and honor compiler debugging
options and emit debugging output at the end of the interface build.
2025-08-12 15:48:42 -07:00
Allan Shortlidge
901e8becb2 Frontend: Make getPrimaryOrMainSourceFile() a utility on CompilerInstance. 2025-08-12 10:18:33 -07:00
Allan Shortlidge
512cf21148 Frontend: Make -dump-availability-scopes an option instead of a mode.
Allowing it to be specified in conjunction with any frontend mode makes it a
more flexible debugging tool.
2025-08-12 10:18:33 -07:00
Anthony Latsis
26de61d826 [cmake] APIDigester, IDE: Specify Clang link dependencies
This way, CMake will propagate the interface compile definitions of the
Clang dependencies, which is important on Windows because Clang
visibility macro expansions, controlled by compile definitions, must
match between the Swift and Clang library.

See https://github.com/llvm/llvm-project/pull/108276/files#diff-4dd645a8b76bb3886a505258a8c2e598aeddea770e7b0a2b51689124a5ea6e9a.
2025-08-12 18:13:22 +01:00
Chris McGee
eed54bb4b0 Reduce change to compiler invocation and remove options from frontend 2025-08-12 12:04:02 -04:00
Allan Shortlidge
a2aa3364b7 Merge pull request #83655 from tshortli/module-version-missing-warning-group
AST: Introduce a warning group for a versioned `#if canImport` diagnostic
2025-08-11 21:11:31 -07:00
Artem Chikin
9af480d81f Merge pull request #83306 from artemcm/NoMoreCopyAllDependencies
[Dependency Scanning] Reduce the amount of copying of collections of module IDs
2025-08-11 17:19:35 -07:00
Allan Shortlidge
dacd986f1b AST: Introduce a warning group for a versioned #if canImport diagnostic.
This allows developers to control whether these diagnostics are considered
errors when `-warnings-as-errors` is specified.

Resolves rdar://157694667.
2025-08-11 16:06:06 -07:00
Artem Chikin
56a6c14ba0 [Dependency Scanning] Reduce the amount of copying of collections of module IDs
Previously, frequently-used methods like 'getAllDependencies' and 'getAllClangDependencies' had to aggregate (copy) multiple collections stored in a 'ModuleDependencyInfo' into a new result array to present to the client. These methods have been refactored to instead return an iterable joined view of the constituent collections.
2025-08-11 12:18:56 -07:00
Evan Wilde
f174185961 Merge pull request #83601 from etcwilde/ewilde/freebsd-blank-availability-versions
FreeBSD: No availability OS version
2025-08-11 09:17:38 -07:00
Hamish Knight
acf6375d46 Introduce BindExtensionsForIDEInspectionRequest
This allows us to lazily bind extensions after mutating the AST,
ensuring we don't prematurely kick the building of lookup tables.
2025-08-10 23:49:03 +01:00
Hamish Knight
03dd5a2c26 [Frontend] Split off loadAccessNotesIfNeeded
This ought to be requestified, but for now let's split it into its
own function.
2025-08-10 23:49:03 +01:00
nate-chandler
335c551ad9 Merge pull request #83624 from nate-chandler/rdar157291161
[SemanticARCOpts] Fix miscompile at dead-ends.
2025-08-10 11:37:51 -07:00
Ahmed Mahmoud
3cd3c048cf [Diagnostics] Add fix-its for missing set and ) of access modifier 2025-08-10 01:57:02 +03:00
JanBaig
3d1123428c [SIL] Refactor to allow Self operand to hold local projections 2025-08-09 16:59:30 -04:00
JanBaig
ff894c4d01 [Format] Apply clang-format to recent changes 2025-08-09 12:46:18 -04:00
JanBaig
2b648eaf43 [SIL] Mark Self operand as optional for AssignOrInitInst 2025-08-08 18:39:43 -04:00
JanBaig
b2fad4bc15 [TypeLowering] Implement the interface type for the SILDeclRef 2025-08-08 18:12:55 -04:00
Evan Wilde
3fcca83d07 Refactor getMinPlatformVersion
The definitions of how version numbers were extracted from target
triples split between the minimum platform version and for determining
the minimum inlining version.

This resulted in inlinable and transparent functions not being imported
correctly on non-Apple platforms where the version number is retained as
part of the target triple.
Specifically, `_checkExpectedExecutor` was found in the module, but
didn't have the appropriate availability version assigned, resulting in
it failing to import and the compiler silently omitting the check in
SILGen when compiling for FreeBSD.

This patch refactors the implementation of `getMinPlatformVersion` into
a separate function that is used in both places so that they cannot get
out of sync again.

Note: This changes how Windows is handled. getMinPlatformVersion
returned an empty version number for Windows, while the availability
implementation returned the OS version number. This makes both
consistently return the OS version number.
2025-08-08 15:10:04 -07:00
Nate Chandler
cbe383524c [NFC] OwnershipUtils: Add a UsePoint type.
The type is a union of an Operand (a real use) and a SILInstruction (an
implicit use).  Such a type is needed to reflect the fact that with
incomplete lifetimes, values can be implicitly destroyed at the
terminators of blocks in dead end regions (along the vaule's
availability boundary).
2025-08-08 15:08:20 -07:00
Nate Chandler
99091c93ae [NFC] OwnershipUtils: Factored out function.
For historical reasons, the existing function
(`areUsesWithinExtendedScope`) trafficked in operands rather than
instructions.  Now that PrunedLiveness has an API that deals with
instructions, add a function (`areWithinExtendedScope`) which does as
well.  Factor the existing function through this new function.
2025-08-08 14:59:36 -07:00
Nate Chandler
d49e9ea682 [NFC] PrunedLiveness: Factor out areWithinBoundary
For historical reasons, there was an API to check whether operands were
within the boundary which just checked whether those operands' users
were within the buondary.  Make a copy of the method deal in
instructions and factor the original API through it.
2025-08-08 14:53:01 -07:00
Pavel Yaskevich
4e445d1483 Merge pull request #83556 from xedin/rename-nonisolated-caller-to-nonsending
[AST] NFC: Rename function type isolation `NonisolatedCaller` to `Non…
2025-08-08 09:37:17 -07:00
Alex Hoppen
432d59781f [FrontendOptions] Default IndexStoreCompress to false 2025-08-07 22:08:33 +02:00
Chris McGee
6a38bbe73d Qualify the skip synthesized members option with symbol graph for the compiler frontend
Rollback the additional usages of the new options and test cases
2025-08-07 15:44:33 -04:00
Alex Hoppen
2d2adfb017 Merge pull request #82947 from ahoppen/compress-index
[Index] Add an option to compress the record and unit files
2025-08-07 21:12:39 +02:00
Artem Chikin
77a61a242f [Dependency Scanning][C++ Interop] Avoid 'CxxStdlib' overlay lookup for binary Swift dependencies which were not built with C++ interop
In addition to skipping it on textual Swift module dependencies which were built without C++ interop enabled, also skip it over similarly on binary Swift dependencies
2025-08-07 10:41:00 -07:00
Susana Monteiro
d237e2ea41 Merge pull request #83543 from susmonteiro/susmonteiro/overrides-of-pure-virtual-methods
[cxx-interop] Support overriding pure virtual methods from value types
2025-08-07 16:52:25 +01:00
Allan Shortlidge
b4fb7c81c0 AST: Refactor AvailabilityQuery constructors.
Get rid of the boolean arguments for unavailability in AvailabilityQuery's
constructors and introduce a `asUnavailable()` modifier that can be used
instead in the contexts where unavailability is relevant.
2025-08-06 18:01:44 -07:00
Allan Shortlidge
78f50ba741 AST: Refactor ConditionallyAvailableSubstitutions to use AvailabilityQuery.
Conditionally available opaque return types should support availability
conditions that are evaluated in any availability domain. Update
`ConditionallyAvailableSubstitutions` to model its conditions with
`AvailabilityQuery` instead of assuming that conditions are always a single
version query for the current platform.
2025-08-06 18:01:10 -07:00
susmonteiro
5dd038fcc0 [cxx-interop] Support overriding pure virtual methods from value types 2025-08-06 16:46:33 +01:00
Allan Shortlidge
01cfa338d8 Merge pull request #83548 from tshortli/value-generics-availability
AST: Update Swift 6.2 runtime OS versions
2025-08-05 21:22:24 -07:00
Pavel Yaskevich
53ef38e31b [AST] NFC: Rename function type isolation NonisolatedCaller to NonisolatedNonsending
This reduces the number of ways we refer to caller isolated async
functions and matches the name to the attribute spelling.
2025-08-05 17:22:10 -07:00
Nate Chandler
540882f23c [NFC] SIL: Promote OperandToUser to SILInstruction
Put it alongsidde OperandToValue and friends.
2025-08-05 16:27:09 -07:00
Hamish Knight
728368734c Merge pull request #82987 from hamishknight/enable-inlinearray-sugar
Enable InlineArray type sugar
2025-08-05 22:20:39 +01:00
Allan Shortlidge
cdebf2bea8 AST: Update 6.2 runtime OS versions.
Swift 6.2 is aligned with the version 26 of each of Apple's operating systems
and the runtime availability metadata should reflect this.
2025-08-05 13:37:38 -07:00
Adrian Prantl
52fa6a1ceb Merge pull request #82389 from adrian-prantl/153934495
Implement reflection support for Symbolic Extended Existential types.
2025-08-05 09:42:19 -07:00