Commit Graph

21665 Commits

Author SHA1 Message Date
Allan Shortlidge
60f049d9ac Merge pull request #76349 from tshortli/resolve-warnings
Resolve recently introduced warnings
2024-09-09 18:17:09 -07:00
Allan Shortlidge
28bc3ca834 Backtracing: Use internal import in swift-backtracing.
The `swift-backtracing` module is an executable rather than a library so it
should have no reason to use the deprecated `@_implementationOnly import` over
`internal import`.
2024-09-09 12:48:28 -07:00
Allan Shortlidge
ba3cd79b6f Concurrency: Remove superflous _SwiftConcurrencyShims imports.
The `_SwiftConcurrencyShims` module was imported `@_implementationOnly` which
was causing warnings to be emitted during the stdlib build. The module
currently serves no purpose; the only declaration it contains is a defunct
`_SwiftContext` struct which is not referenced by anything. The module needs to
continue to exist for source compatibility, though, since it is part of the
toolchain and imported publicly from other modules.
2024-09-09 12:20:13 -07:00
Artem Chikin
1baff87879 Revert "[CMake] [Darwin] Don't build the SDK overlays by default on Apple platforms" 2024-09-09 09:57:14 -07:00
Alastair Houghton
e98e43141a Merge pull request #75948 from RSilicon/atom
Specify atomicity for compare_exchange_strong
2024-09-08 09:46:09 +01:00
Alastair Houghton
e34d23f56e Merge pull request #76310 from al45tair/eng/PR-135413803
[Windows][Concurrency] Use the same clock as Dispatch.
2024-09-07 08:42:59 +01:00
Ian Anderson
8959dd97fe [CMake] [Darwin] Don't build the SDK overlays by default on Apple platforms
The Apple SDKs have been providing the Darwin overlay since macOS 10.14.4, iOS 12.2, et al. More recently the SDK version has diverged from the Swift version making them incompatible. Stop building the overlay from Swift. Once the SDK overlays aren't being built, the clang overlays need to be built in testing.

%target-swift-emit-pcm doesn't use the sdk, but %target-swift-frontend does, which will cause them to have a mismatch with "builtin headers belong to system modules, and _Builtin_ modules are ignored for cstdlib headers" aka LANGOPT(BuiltinHeadersInSystemModules) aka -fbuiltin-headers-in-system-modules.

rdar://115192929
2024-09-06 13:28:14 -07:00
Alastair Houghton
8e91ae48e6 [Concurrency][Windows] Remove use of GetProcAddress().
Since we're linking `mincore.lib`, we don't need to use
`GetProcAddress()` to find `Query[Unbiased]InterruptTimePrecise()`.

rdar://135413803
2024-09-06 17:16:27 +01:00
Alastair Houghton
86c643ddc8 [Concurrency][Windows] Also update swift_get_clock_res().
I should have updated this to match as well.

rdar://135413803
2024-09-06 15:51:55 +01:00
Alastair Houghton
f5b146b095 [Windows][Concurrency] Use the same clock as Dispatch.
The Concurrency runtime calculates deadlines for scheduling itself
using `swift_get_time()`; unfortunately, on Windows that was using
`QueryPerformanceCounter()`, while Dispatch uses
`QueryInterruptTimePrecise()`.  The problem with that is that the two do
not necessarily correspond *at all*.  In general
`QueryPerformanceCounter()` may be using any of a number of hardware
timers depending on the machine on which we're running.

In the VM I was testing on, the two differed by 20ms, but the worst case
is that they are completely unrelated, in which case `Task.sleep()` will
wait essentially a random amount of time.

rdar://135413803
2024-09-06 15:39:22 +01:00
Mike Ash
7d3451316a [Mirror] Handle fields of thin metatypes.
Fields containing metatypes with no possible subtypes are thin i.e. they have no storage. There is only one possible value they can have: the corresponding type. Mirror attempted to copy the nonexistent field value from the nonexistent storage, producing garbage. Instead, special-case thin metatypes and copy the instance type out of the metatype metadata rather than trying to copy it from the field.

rdar://108280543
2024-09-06 10:38:25 -04:00
Egor Zhdan
0a14f04fe5 Merge pull request #76260 from swiftlang/egorzhdan/cxxshim-maccatalyst
[cxx-interop] Install CxxShim library for macCatalyst
2024-09-06 13:09:21 +01:00
Meghana Gupta
2f37e10674 Rewrite UnsafeRawBufferPointer.Iterator.next to avoid non natural loop in SIL
The current implementation creates a non-natural loop and none of the SIL and
LLVM loop passes will work for such loops. We have to find a way to fix this in
SIL. Until then, rewrite so we get a natural loop in SIL.
2024-09-05 15:35:39 -07:00
Alejandro Alonso
45d7ea39a5 Merge pull request #75518 from Azoy/integer-generics
Implement Value generics
2024-09-05 15:33:46 -07:00
Allan Shortlidge
a39ee131ad Concurrency: swift_deletedAsyncMethodError() should be internal.
This function is an implementation detail of the runtime, not something that
clients of the _Concurrency library should be able to directly name. Make it
`@usableFromInline internal` instead of `public` so that it remains as ABI but
doesn't show up in auto-complete or documentation.
2024-09-05 11:12:58 -07:00
Alejandro Alonso
f431e0064a Fix abi test for new initRaw runtime function 2024-09-04 15:13:51 -07:00
Alejandro Alonso
3d8a9d4554 Implement same type checking at runtime 2024-09-04 15:13:51 -07:00
Alejandro Alonso
f2f82a7de6 Add initRawStructMetadata2 for safety 2024-09-04 15:13:51 -07:00
Alejandro Alonso
8a9303b3cf Consistently negate the value from demangling 2024-09-04 15:13:50 -07:00
Alejandro Alonso
c1dd957c75 Use intptr_t more consistently 2024-09-04 15:13:50 -07:00
Alejandro Alonso
9903d71f91 More changes to get off of ssize_t 2024-09-04 15:13:49 -07:00
Alejandro Alonso
22349bcfb9 Use intptr_t instead of ssize_t and more test fixes 2024-09-04 15:13:49 -07:00
Alejandro Alonso
4f07c060b7 Future proof the initRawStructMetadata entrypoint 2024-09-04 15:13:46 -07:00
Alejandro Alonso
f4f60f4344 Remove Value requirement Add GenericTypeParamKind 2024-09-04 15:13:43 -07:00
Alejandro Alonso
7c85261a77 Add runtime support 2024-09-04 15:13:27 -07:00
Alejandro Alonso
75c2cbf593 Implement value generics
Some requirement machine work

Rename requirement to Value

Rename more things to Value

Fix integer checking for requirement

some docs and parser changes

Minor fixes
2024-09-04 15:13:25 -07:00
Egor Zhdan
0d19a7763c [cxx-interop] Install CxxShim library for macCatalyst
This is a follow-up after the change that enabled Cxx and CxxStdlib overlays on macCatalyst: https://github.com/swiftlang/swift/pull/74994.

The compiler relies on the presence of these shim libraries in the toolchain.

rdar://135275773
2024-09-04 19:09:46 +01:00
Rose
7f2787e249 Use instancetype for the benchmark and SwiftNativeNSObject
This is more for consistency than anything else, really.
2024-09-04 13:07:04 -04:00
Egor Zhdan
03abb1f0f8 Merge pull request #76223 from ishon19/76220-string-should-conform-to-comparable
Add comparable conformance for C++ strings
2024-09-04 12:50:44 +01:00
Alex Hoppen
c5aa49ba64 Revert "Isolated synchronous deinit" 2024-09-03 18:11:26 -07:00
Allan Shortlidge
de963486d0 Merge pull request #76228 from tshortli/actor-label-at-end-of-compound-statement
Concurrency: Suppress a -Wc++23-extensions warning
2024-09-03 17:20:54 -07:00
Kuba Mracek
249f7e6073 [embedded] Handle retain/retain ops inside deinit in Embedded Swift's swift_release 2024-09-03 14:38:03 -07:00
Allan Shortlidge
29f172f3c1 Concurrency: Suppress a -Wc++23-extensions warning.
Fixes the following warning:

```
warning: label at end of compound statement is a C++23 extension [-Wc++23-extensions]
```
2024-09-03 13:09:28 -07:00
Vera Mitchell
b4529a69eb add build-stdlib-docs flag that generates stdlib symbol graphs 2024-09-03 13:52:42 -06:00
Shreyans Pathak
49d9067d3e feat: add comparable conformance for C++ strings 2024-09-03 13:47:27 -04:00
Konrad `ktoso` Malawski
c86e4a8738 Merge pull request #60057 from nickolas-pohilets/mpokhylets/isolated-deinit
Co-authored-by: Konrad `ktoso` Malawski <ktoso@apple.com>
2024-09-04 01:16:56 +09:00
Alejandro Alonso
027a95a1b5 Merge pull request #76097 from jeongHunE/main
[stdlib] Fix the indentation from 1 space to 2 spaces in ArraySlice.s…
2024-09-02 21:22:55 -07:00
Konrad `ktoso` Malawski
c55ad6fa88 Merge branch 'main' into mpokhylets/isolated-deinit 2024-09-02 23:16:17 +09:00
Egor Zhdan
39b8b3c67e Merge pull request #76106 from swiftlang/egorzhdan/cxx-mutable-rac
[cxx-interop] Add `CxxMutableRandomAccessCollection` protocol
2024-09-02 11:35:43 +01:00
Allan Shortlidge
5c30b30947 Merge pull request #76177 from tshortli/availability-visionos
build-script: Copy `libclang_rt.a` from the host toolchain for visionOS
2024-08-31 10:00:13 -07:00
Allan Shortlidge
48f236d09a build-script: Copy libclang_rt.a from the host toolchain for visionOS.
During the toolchain build, when building the Swift standard library for
platforms other than macOS the `libclang_rt.a` needs to be copied out of the
host SDK. That wasn't happening for visionOS.

Resolves rdar://135023111.
2024-08-30 18:15:13 -07:00
Alejandro Alonso
10314365e4 Merge pull request #76144 from Benedicto-H/fix-Dictionary-doc
[stdlib] Fix typos in Dictionary.swift
2024-08-29 21:48:03 -07:00
Allan Shortlidge
a9120c3dc2 Merge pull request #76135 from tshortli/backdeployed-ios-apps-on-macos
SILOptimizer: Allow inlining of transparent functions in `@backDeployed` thunks
2024-08-29 15:06:48 -07:00
Alejandro Alonso
cfd39367a5 Merge pull request #75048 from Benedicto-H/fix/typos-task
[Shims] Fix typos in RefCount.h
2024-08-29 09:28:11 -07:00
Benedicto Hong
5b30f78b53 [stdlib] Fix typos in Dictionary.swift
Hi, I fixed several typos in Dictionary.swift file(#Line: 347, 1194).

- origin comments
```swift
// #347
// Prints "The 'star' image is a glyph.")

// #1194
// Prints "No value found for that key.""
```

- changed comments
```swift
// #347
// Prints "The 'star' image is a glyph.")  // I thought the ' ) ' character was unnecessary, so I removed it.

// #1194
// Prints "No value found for that key.""  // I thought the ' " ' character was unnecessary, so I removed it.
```
2024-08-29 20:31:59 +09:00
Mykola Pokhylets
e0ad7bde82 Merge branch 'main' into mpokhylets/isolated-deinit
# Conflicts:
#	include/swift/Basic/Features.def
#	lib/AST/ASTPrinter.cpp
#	lib/AST/FeatureSet.cpp
2024-08-29 11:28:43 +02:00
Allan Shortlidge
51143aa8ea stdlib: Upstream _stdlib_isOSVersionAtLeast_AEIC().
In the standard library shipped in Apple's SDKs and OSes, the implementation of
`_stdlib_isOSVersionAtLeast()` has diverged in order to solve some tricky
issues related to supporting iOS applications running on macOS. It's now time
to bring that change upstream in order to unblock further changes that depend
on it.

Originally introduced to resolve rdar://83378814.
2024-08-28 22:07:59 -07:00
Egor Zhdan
0ab681514b [cxx-interop] Add CxxMutableRandomAccessCollection protocol
This conforms mutable C++ container types, such as `std::vector`, to `MutableCollection` via a new overlay protocol `CxxMutableRandomAccessCollection`.

rdar://134531554
2024-08-28 12:43:42 +01:00
정훈
193a3063dc [stdlib] Fix the indentation from 1 space to 2 spaces in ArraySlice.swift 2024-08-27 09:01:54 +09:00
Alejandro Alonso
cccacd7a08 Merge pull request #76082 from Changhyun-Kyle/fix-collection-doc
[stdlib] Fix grammatical error in Collection.swift
2024-08-26 13:28:28 -07:00