Commit Graph

21434 Commits

Author SHA1 Message Date
eeckstein
6bf39cccd6 Merge pull request #70787 from eeckstein/boolean-literal-folding
Mandatory optimizations: constant fold boolean literals before the DefiniteInitialization pass
2024-01-11 11:39:44 +01:00
Konrad `ktoso` Malawski
70b1c0e43c [Concurrency] Major cleanup of assert/precondition/assume isolated docs (#70800)
Co-authored-by: Alex Martini <amartini@apple.com>
2024-01-10 23:48:32 -08:00
Konrad `ktoso` Malawski
ef80d778dc [Concurrency] Fix the missing builtin guards for DiscardingTaskGroup (#70837) 2024-01-10 22:55:38 -08:00
Kavon Farvardin
29d6d6aaf0 [NCGenerics] disable mangling roundtrip checking
This is a temporary measure until I get a chance to fix the symbol
mangling. This round-tripper is exactly flagging the current
known issue in that all of the symbols get extra `Copyable` and
`Escapable` requirements mangled into them, and thus reconsituting the
type from the mangled name doesn't give you the same type back.
2024-01-10 19:37:21 -08:00
Kavon Farvardin
8b870e9e6c [NCGenerics] fix Copyable/Escapable declarations
When building the stdlib with noncopyable generics enabled,
requirements for Copyable and Escapable  end up being inferred on the
protocols Copyable and Escapable, themselves. So we need to opt-out
Copyable from requiring Escapable, and vice versa.
2024-01-10 19:37:21 -08:00
Guillaume Lessard
8d0991f9d0 [se-0405] improve examples in documentation 2024-01-10 14:32:26 -08:00
Guillaume Lessard
98273aa6c2 Update stdlib/public/core/StringCreate.swift
Was off by one.
2024-01-10 14:32:26 -08:00
Guillaume Lessard
fa9c80ae08 [test] round out testing for String.init?(validating:as:) 2024-01-10 14:32:26 -08:00
Alejandro Alonso
e37ecac163 Merge pull request #68857 from Azoy/atomics
[stdlib] Atomics
2024-01-10 12:03:08 -08:00
Dave Lee
b4feec6c5e [stdlib] Correct String initializer reference in print docs 2024-01-10 11:05:54 -08:00
Erik Eckstein
d4730e02ce stdlib: add a semantic attribute to Bool.init(_builtinBooleanLiteral:)
This is required for being able to constant fold boolean literals before the DefiniteInitialization pass
2024-01-10 16:12:53 +01:00
Yuta Saito
7cccbcc84f [DiscardingTG] Remove reabstraction thunk for () -> Void to () -> T (#70537)
Concurrency runtime expects discarding task operation entrypoint
function not to have result type, but the current SILGen
implementation generates reabstraction thunk to convert `() -> Void`
to `() -> T` for the operation function.

Since the `T` is always `Void` for DiscardingTG, the mismatch of result
type expectation does not cause any problem on most platforms, but the
signature mismatch causes a problem on WebAssembly.

This patch introduces new builtin operations for creating discarding
task, which always takes `() -> Void` as the operation function type.
2024-01-10 07:17:15 +09:00
Jeremy Schonfeld
2404013f78 [SE-0270] Add Collection Operations on Noncontiguous Elements (#69766)
* Adds RangeSet/DiscontiguousSlice to the stdlib

* Remove redundant DiscontiguousSlice.Index: Comparable conformance

* Attempt to fix embedded build

* Attempt to fix macOS test failures

* Fix Constaints/members.swift failure on linux

* Add exceptions to ABI/source checker to fix macOS tests

* Fix incremental dependency test failure

* Remove inlining/unfreeze implementation for future improvements

* Simplify indices(where:) implementation

* Address review feedback

* Add test for underscored, public slice members

* Address feedback on inlining, hashing, and initializing with unordered arrays

* Fix ABI checker issues

* Remove MutableCollection extension for DiscontiguousSlice

* Make insertion return a discardable Bool

* Fix ABI checker tests

* Fix other ABI checker tests due to dropping MutableCollection subscript
2024-01-09 14:02:19 -08:00
AtariDreams
e2d2ca05d6 waitQueue.compare_exchange_strong in the true loop can be weak (#70636) 2024-01-09 16:49:43 +09:00
Jeremy Schonfeld
b46adbb4d7 Merge pull request #70726 from jmschonfeld/undeprecate-iscontiguousascii
Un-deprecate _StringGuts._isContiguousASCII
2024-01-08 15:43:33 -08:00
Pavel Yaskevich
d61eac29d8 Merge pull request #70613 from honghoker/fix-typo
Fix typo whiteSpace between line comment
2024-01-08 09:17:32 -08:00
Jaap Wijnen
dfe1e691a8 [AutoDiff] Add missing vjp, jvp functions to existing FloatingPoint initializers (#70688)
Adds derivatives to already existing initializers that allow converting between floating point type. For example converting a Float to a Double.

Co-authored-by: Jaap Wijnen <jaap@passivelogic.com>
2024-01-05 13:29:04 -08:00
Guillaume Lessard
4d8723e57c Merge pull request #65325 from AtariDreams/calloc
Some methods swap the number of elements and the size arguments
2024-01-04 20:14:01 -08:00
Jeremy Schonfeld
e59ba66970 Un-deprecate _StringGuts._isContiguousASCII 2024-01-04 14:58:41 -08:00
Slava Pestov
93ad779f84 Merge pull request #70694 from slavapestov/two-ci-fixes
A couple of small fixes for CI
2024-01-04 10:39:22 -05:00
Dario Rexin
65343add82 [Embedded] Enable SIMD types in embedded Swift (#70674)
* [Embedded] Enable SIMD types in embedded Swift

* Incorporate feedback and add test

* Update simd.swift
2024-01-04 07:28:36 -08:00
Guillaume Lessard
b67b2cb2c5 link to issue regarding initializer renaming 2024-01-03 14:38:05 -08:00
Slava Pestov
ab28449be7 stdlib: Don't build with -enable-experimental-associated-type-inference for now
Some CI jobs use an older toolchain, which chokes when building the stdlib
with this flag.

Fixes rdar://119895175.
2024-01-03 16:28:22 -05:00
Guillaume Lessard
3e73445a3e Merge pull request #61093 from glessard/se0370-primary-associated-types
[stdlib] use a primary associated type
2024-01-03 10:59:57 -08:00
Alejandro Alonso
d8604601d7 Rename AtomicValue to AtomicRepresentable 2024-01-03 13:27:47 -05:00
Kuba (Brecka) Mracek
1efcb415e9 Merge pull request #70217 from kubamracek/embedded-set
[embedded] Add Set to the embedded stdlib
2024-01-03 08:13:52 +01:00
Max Desiatov
672386c39f Merge pull request #70629 from apple/maxd/embedded-wasm
stdlib/public/CMakeLists.txt: Enable embedded Wasm
2024-01-02 23:42:44 +00:00
Rokhini Prabhu
91936343a5 Merge pull request #70601 from apple/dev/rokhinip-task-to-thread-preset
Add support for task-to-thread model as a build-preset
2024-01-02 11:20:50 -08:00
Max Desiatov
bf655c14ef Add wasm64-unknown-none-wasm triple to stdlib/public/CMakeLists.txt 2024-01-02 17:13:12 +00:00
Max Desiatov
d10405ec1e Use wasm32-unknown-none-wasm triple in stdlib/public/CMakeLists.txt 2024-01-02 17:08:00 +00:00
Max Desiatov
0d35c42cf3 Fix error message typo in stdlib/public/core/StaticString.swift (#70643) 2024-01-02 08:11:52 +00:00
Max Desiatov
2730e16f38 Fix missing quote in stdlib/public/CMakeLists.txt 2023-12-26 18:47:37 +00:00
Max Desiatov
f2c804a724 Fix use of wasm32 arch in `stdlib/public/CMakeLists.txt 2023-12-26 14:16:14 +00:00
Max Desiatov
c56085a66c stdlib/public/CMakeLists.txt: Enable embedded Wasm
Running `swiftc` with `wasm32-none-none` or `wasm32-unknown-none` currently fails, as this embedded target is not built. Let's include it in the list of embedded targets.
2023-12-26 14:12:32 +00:00
Rose
873a423da6 Some methods swap the number of elements and the size arguments
For calloc, the variable denoting the of elements comes first,
then the variable denoting the size of each element. However, both
arguments are swapped when calling this function in many places in this codebase.
2023-12-23 11:00:31 -05:00
honghoker
2fdb8b0481 Fix typo whiteSpace between line comment 2023-12-24 00:05:57 +09:00
Rokhini Prabhu
61bec0d786 Always clear out the SchedulerPrivate fields before enqueueing the task
into the executor
2023-12-21 19:22:05 -08:00
Rokhini Prabhu
6dbf4d2e20 Add support for task-to-thread model to be specified on as part of build presets 2023-12-21 16:00:25 -08:00
Guillaume Lessard
b869a3cabe [se-0405] improve readability of double-optional unwrapping 2023-12-21 10:44:52 -08:00
Guillaume Lessard
4617553ee7 [se-0405] improve slow path 2023-12-21 10:44:52 -08:00
Guillaume Lessard
0ba58de1e1 [se-0405] improve fast path 2023-12-21 10:44:52 -08:00
Guillaume Lessard
148a7e2eff [stdlib] make __SharedStringStorage able to own a pointer 2023-12-21 10:44:52 -08:00
Guillaume Lessard
566fbf4fec [se-0405] update availability to a realistic release target 2023-12-21 10:44:52 -08:00
Guillaume Lessard
92df9b4bdb Apply suggestions from code review
Co-authored-by: Ben Rimmington <me@benrimmington.com>
2023-12-21 10:44:52 -08:00
Guillaume Lessard
f7006880c7 [se-0405] adapt implementation from staging package 2023-12-21 10:44:52 -08:00
Kuba Mracek
bde23e2c2f [embedded] Avoid using reinterpretCast in set bridging 2023-12-20 14:39:38 +01:00
Kuba Mracek
29a7c52433 [embedded] #if the entire _BridgeStorage struct instead of sprinkling a bunch of #ifs inside 2023-12-20 14:32:48 +01:00
Kuba Mracek
25f971d344 [embedded] Add explaining comment about _swiftEmptyArrayStorage/_swiftEmptySetSingleton 2023-12-20 14:08:16 +01:00
Kuba Mracek
943c7c2ee5 [embedded] Drop 'public' from forward declaration of arc4random_buf 2023-12-20 14:04:35 +01:00
Allan Shortlidge
9a0eb73302 Merge pull request #70547 from tshortli/diagnose-unreachable-cant-back-deploy
AST/SILGen: Use @_alwaysEmitIntoClient diagnostic helper in unavailable code
2023-12-20 00:16:29 -08:00