Commit Graph

184973 Commits

Author SHA1 Message Date
Saleem Abdulrasool
548bff6c78 utils: fix summary emission with caching
This updates the SCCache invocation for the summary printing which needs
to be adjusted for the use of the downloaded sccache.
2025-05-23 09:09:33 -07:00
Mykola Pokhylets
de3a87c0ab Merge branch 'main' into mpokhylets/weak-let 2025-05-23 17:26:49 +02:00
Saleem Abdulrasool
a478db9022 Merge pull request #81733 from compnerd/sccache
utils: download sccache for Windows
swift-DEVELOPMENT-SNAPSHOT-2025-05-23-a
2025-05-23 07:53:35 -07:00
Saleem Abdulrasool
b3b9924a42 Merge pull request #81732 from compnerd/expansion
utils: extend the experimental runtime build
2025-05-23 07:52:54 -07:00
susmonteiro
7686f05f28 [cxx-interop] Ensure consistent checks for exportable fields 2025-05-23 15:21:34 +01:00
Eric Miotto
6adc1870b2 Merge pull request #81723 from edymtt/edymtt/disable-some-sanitizers-tests-on-ios-arm64e
Disable tests that require arm64e slices for iOS sanitizers
2025-05-23 06:44:48 -07:00
Doug Gregor
43f6feaf19 Merge pull request #81738 from DougGregor/no-unchecked
Remove the note that suggests using `@unchecked`
2025-05-23 13:46:22 +01:00
Alastair Houghton
cd7701cd82 [Build] Add catalyst support to SwiftStdlibCurrentOS.
Add catalyst support for SwiftStdlibCurrentOS.

Also, set a minimum deployment target when building Concurrency;
this stops the build failing when we're trying to build on older
systems where Concurrency didn't really exist yet.

rdar://150966361
2025-05-23 10:31:56 +01:00
Charles Zablit
9ed8b664fd Merge pull request #81071 from charles-zablit/charles-zablit/windows/fix-psutil-install-arm64
[Windows] fix psutil installation on arm64
2025-05-23 09:56:09 +01:00
Doug Gregor
a922e8e356 Remove the note that suggests using @unchecked
`@unchecked Sendble` is dangerous, and almost always the wrong thing to
use. Don't have the compiler suggest it.
2025-05-23 09:12:51 +01:00
Pavel Yaskevich
9e562881fe [TypeChecker] Improve diagnostics for access to actor-isolated values outside of the actor
Replaces generic `expression is 'async' but is not marked with 'await`
diagnostic with a tailed one for cases where there is an access to an
actor-isolated value outside of its actor without `await` keyword.

This makes the diagnostics for async and sync contexts consistent
and actually identifies a problem instead of simply pointing out
the solution.

Resolves: rdar://151720646
2025-05-23 00:20:18 -07:00
Saleem Abdulrasool
0d32d8be69 utils: make unify SDKSettings plist and json
Alter the PList and JSON to match contents. While the primary consumer
for the PList is SPM, this synchronises the two just in case. This is in
response to feedback from @jakepetroules.
2025-05-22 21:49:50 -07:00
Saleem Abdulrasool
9ae142c9d3 Merge pull request #81724 from compnerd/settings
utils: flesh out SDKSettings.json further on Windows
2025-05-22 21:43:09 -07:00
Saleem Abdulrasool
4539e0ab25 utils: download sccache for Windows
When `-EnableCaching` is specified, download a specific version of
sccache to enable easy enablement.
2025-05-22 21:28:13 -07:00
Michael Gottesman
d816f0fe99 Merge pull request #81691 from gottesmm/pr-9f39c3c00daaa015dbbad351349202f5f9238db6
[sema] Change non-sendable -> non-Sendable in diagnostics.
2025-05-22 21:20:37 -07:00
Saleem Abdulrasool
7b17c47a2c utils: extend the experimental runtime build
This adjusts the experimental runtime build to include the overlay,
StringProcessing, Synchronization. This is a first step towards getting
a sufficient amount of the SDK overlay built so that we can start
statically linking a real world program (swift-driver).
2025-05-22 20:59:38 -07:00
Evan Wilde
a313a63bba Merge pull request #81662 from etcwilde/ewilde/aarch64-freebsd
Fix the ARM architecture on FreeBSD
2025-05-22 20:21:17 -07:00
Ben Barham
0b7fbb6419 [Driver] Add missing -default-isolation to the old driver
Resolves rdar://151643763.
2025-05-22 19:07:44 -07:00
Allan Shortlidge
a18ed7a617 Merge pull request #81701 from tshortli/member-import-visibility-public-module-name
Tests: Verify `MemberImportVisibility` honors `-public-module-name`
2025-05-22 18:31:32 -07:00
Saleem Abdulrasool
77fdaa9dd7 utils: flesh out SDKSettings.json further on Windows
Add additional properties into the SDKSettings.json that we generate.
2025-05-22 16:09:09 -07:00
eeckstein
efa07a7557 Merge pull request #81702 from eeckstein/fix-test
InitializeStaticGlobals: handle `InlineArray.init(repeating:)` also for arm64_32
2025-05-23 00:55:20 +02:00
Henrik G. Olsson
262a53f599 [Swiftify] Update availability for CxxSpan<->Span, fix lifetimebound on parameters with reference type (#81634)
Update availability for CxxSpan<->Span, fix lifetimebound on parameters
with reference type

Because swift-ide-test doesn't care about typechecking,
std-span-interface.swift passed despite containing 2 separate errors.
This updates the test file to properly exercise the entire compilation
pipeline for the macro expansions, by running swift-frontend
-emit-module and calling each macro expansion.

The first issue was that CxxSpan initializers taking [Mutable]Span still
had their availability set to Swift 6.2+, even after back-deploying
caused [Mutable]Span to have availability back to Swift 5.0. Since
_SwiftifyImport expansions copy the availbility of Span, this resulted
in the macro expansions calling unavailable initializers. Interestingly
enough, this manifested itself in the form of a tripped assert in SIL
verification, because although we do now typecheck the expansions from
_SwiftifyImport, the compilation can still keep going after
`shouldEmitFunctionBody` returns false: the macro expansion declaration
is still there, but is now missing its definition, despite not being
external.

The second issue was when parameters with C++ reference types were
annotated with `[[clang::lifetimebound]]`. For parameters with a type
that is `Escapable`, this is normally done using `@lifetime(borrow
foo)`. However C++ reference parameters are imported as `inout`, which
requires the `@lifetime(&foo)` syntax.

rdar://151493400
rdar://151678415
2025-05-22 15:36:19 -07:00
Henrik G. Olsson
526c68333c [Swiftify] Fix __sized_by and nullable return values (#81693)
Nullable return Spans did not include __swiftifyOverrideLifetime,
resulting in a lifetime error when returning the Span. Meanwhile return
values for __sized_by did not use the correct label for the call to the
RawSpan initializer, using `count` instead of `byteCount`.

rdar://151804085
rdar://151799287
2025-05-22 15:34:58 -07:00
eeckstein
789f657335 Merge pull request #81717 from eeckstein/fix-dse
DeadStoreElimination: don't assume that the operand of an `dealloc_stack` is an `alloc_stack`.
2025-05-22 23:47:56 +02:00
Eric Miotto
00334acf37 Disable tests that require arm64e slices for iOS sanitizers
We started building iOS sanitizers when switching to
`LLVM_ENABLE_RUNTIMES` to build compiler-rt, and turns out they
currently provide only the arm64 slice.

Addresses rdar://151782340
2025-05-22 14:40:07 -07:00
Allan Shortlidge
78faa1aad2 Tests: Verify MemberImportVisibility honors -public-module-name. 2025-05-22 13:49:16 -07:00
Evan Wilde
6d85ef58ef Merge pull request #81622 from etcwilde/ewilde/wmo-swift-testing
Build Swift-Testing with WMO
2025-05-22 13:07:25 -07:00
Hamish Knight
89f7a82c39 Merge pull request #81673 from hamishknight/macrotrail
[IDE] Better handle macro trailing closures
2025-05-22 20:01:31 +01:00
Michael Gottesman
3ed4059a60 [sema] Change non-sendable -> non-Sendable in diagnostics.
This matches send non sendable but importantly also makes it clear that we are
talking about something that doesn't conform to the Sendable protocol which is
capitalized.

rdar://151802975
2025-05-22 11:37:58 -07:00
Rintaro Ishizaki
6f24696878 Merge pull request #81612 from calda/cal--trailing-comma-missing-from-6.1
Add trailing comma support in cases missing from Swift 6.1
2025-05-22 11:30:28 -07:00
Eric Miotto
794fe00351 Merge pull request #81680 from edymtt/edymtt/fix-target-case-find-swift-core
[Runtimes][CMake] Rename `SwiftCore` target to `swiftCore`
2025-05-22 11:19:15 -07:00
Egor Zhdan
a91dc9e322 Merge pull request #81704 from swiftlang/egorzhdan/rm-symbolic-remnants
[cxx-interop] Remove remnants of symbolic import mode
2025-05-22 18:26:04 +01:00
Michael Gottesman
904ebc6784 [send-non-sendable] Recurse to the full underlying value computation instead of just the object one when computing the underlying object of an address.
Otherwise, depending on the exact value that we perform the underlying look up
at... we will get different underlying values. To see this consider the
following SIL:

```sil
  %1 = alloc_stack $MyEnum<T>
  copy_addr %0 to [init] %1
  %2 = unchecked_take_enum_data_addr %1, #MyEnum.some!enumelt
  %3 = load [take] %2
  %4 = project_box %3, 0
  %5 = load_borrow %4
  %6 = copy_value %5
```

If one were to perform an underlying object query on %4 or %3, one would get
back an underlying object of %1. In contrast, if one performed the same
operation on %5, then one would get back %3. The reason why this happens is that
we first see we have an object but that it is from a load_borrow so we need to
look through the load_borrow and perform the address underlying value
computation. When we do that, we find project_box to be the value. project_box
is special since it is the only address base we ever look through since from an
underlying object perspective, we want to consider the box to be the underlying
object rather than the projection. So thus we see that the result of the
underlying address computation is that the underlying address is from a load
[take]. Since we then pass in load [take] recursively into the underlying value
object computation, we just return load [take]. In contrast, the correct
behavior is to do the more general recurse that recognizes that we have a load
[take] and that we need to look through it and perform the address computation.

rdar://151598281
2025-05-22 10:11:40 -07:00
Erik Eckstein
b760ab0679 DeadStoreElimination: don't assume that the operand of an dealloc_stack is an alloc_stack.
It can also be a `partial_apply`.
Fixes a compiler crash
https://github.com/swiftlang/swift/issues/81698
rdar://151822502
2025-05-22 19:08:30 +02:00
Pavel Yaskevich
55b29fea4b Merge pull request #81690 from xedin/rdar-151797372
[CSApply] Don't inject global actor into closure type if it's marked …
2025-05-22 09:33:36 -07:00
Evan Wilde
c99295756f Merge pull request #81366 from etcwilde/ewilde/observe-freebsd-pthread-nullability
[FreeBSD]: Optional observation pthread primitives
2025-05-22 09:27:03 -07:00
Doug Gregor
ca0e984c94 Merge pull request #81703 from DougGregor/more-migratable-features
Make `InferIsolatedConformances` and `StrictMemorySafety` migratable features
2025-05-22 16:48:30 +01:00
Shubham Sandeep Rastogi
b286b1c3a5 Set the Compilation directory when generating the Skeleton CU
When creating a skeleton Compile Unit, the DIFile passed
in, it always uses the include path. This leads to the DW_AT_comp_dir
being wrong, if the -file-compilation-dir option is passed, we need to
use the remapped compilation dir passed in to the DIFile instead.

This patch fixes that problem.
2025-05-22 08:37:10 -07:00
Alastair Houghton
3305e89ff9 Merge pull request #81639 from swiftlang/revert-81472-eng/PR-151147606
Revert "[Concurrency] Add underscore prefixes for not yet official API."
2025-05-22 15:36:52 +01:00
Erik Eckstein
9e70eb814c InitializeStaticGlobals: handle InlineArray.init(repeating:) also for arm64_32
This needs matching a different builtin for scalar conversion for the `index_addr` index.

Fixes a test failure on watchos
rdar://151761870
2025-05-22 15:33:27 +02:00
Egor Zhdan
4487cd4c10 [cxx-interop] Remove remnants of symbolic import mode
Symbolic import mode was removed in b51cfa5c. This removes a reference to it from a test.
2025-05-22 13:39:32 +01:00
Slava Pestov
278248e6c6 Merge pull request #81576 from slavapestov/fix-rdar145184871
Sema: Don't diagnose implied conformance of imported type to Sendable
2025-05-22 08:01:40 -04:00
Doug Gregor
32267f4971 Finish comment 2025-05-22 12:15:53 +01:00
Doug Gregor
2eeb3946e3 Add unnecessary REQUIRES: line for a feature 2025-05-22 12:13:39 +01:00
Andrew Trick
58adb0e972 Merge pull request #81685 from atrick/lifedep-unprint-feature
Diagnostic message: suppress printing "requires LifetimeDependence"
2025-05-22 03:30:38 -07:00
Hamish Knight
52d8b36af4 [Completion] Suggest trivial trailing closures for macros
Follow the same logic as function decl completion and suggest a
trailing closure for trivial cases.

rdar://150550747
2025-05-22 11:16:10 +01:00
Doug Gregor
414adb55ca Add optional language features to the supported features output
Optional language features don't have a specific "-enable-*" flag, because
they're rare and don't fit the same upcoming/experimental distinction. Add
a flag_name field to provide the flag name as well.
2025-05-22 11:07:13 +01:00
Doug Gregor
7f2649ff33 Add the set of diagnostic categories to each migratable feature
The name of a migratable feature might differ from the names of the
diagnostic groups containing the diagnostics that are used to drive
migration for that feature. Provide the set of diagnostic categories
that are associated with each migratable feature as part of the
supported features list.
2025-05-22 11:07:13 +01:00
Doug Gregor
6a800c98b5 Add addition test case for "if case unsafe" 2025-05-22 11:07:13 +01:00
Doug Gregor
abad2fae0f Make the optional feature StrictMemorySafety migratable
This feature is essentially self-migrating, but fit it into the
migration flow by marking it as migratable, adding
`-strict-memory-safety:migrate`, and introducing a test.
2025-05-22 11:07:13 +01:00