Commit Graph

21821 Commits

Author SHA1 Message Date
Guillaume Lessard
96f6f5e25a Merge pull request #82442 from glessard/rdar147500261-utf8span-32bit 2025-06-27 08:18:46 -07:00
Alastair Houghton
80791035a3 [Concurrency] Prevent negative sleeps from sleeping forever.
Requests to sleep until a negative timestamp would result in sleeping
until `UINT64_MAX` nanoseconds from the start of the relevant clock,
which is about 585 years.

rdar://154346018
2025-06-27 11:15:05 +01:00
Ben Rimmington
1b1e9d4d80 [stdlib] Update InlineArray documentation (#82363)
Remove misleading big O notation from initializers.
2025-06-27 11:14:24 +01:00
Guillaume Lessard
4927c0c1c8 [stdlib] improve more accessor declarations 2025-06-26 14:57:21 -07:00
Guillaume Lessard
c8092f50d1 [stdlib] simplify borrowing accessors 2025-06-26 14:57:21 -07:00
Guillaume Lessard
bbfe648c54 [stdlib] improve accessor declarations 2025-06-26 14:57:21 -07:00
Alejandro Alonso
883716bd1a Merge pull request #80858 from Azoy/remove-wubp-inlinearray
[stdlib] Remove _withUnsafeBufferPointer APIs on InlineArray
2025-06-26 14:44:08 -07:00
Alastair Houghton
f7f4a19baf Merge pull request #82417 from al45tair/eng/PR-153531418
[Concurrency] Rename Dummy(Main|Task)Executor.
2025-06-26 10:53:57 +01:00
Guillaume Lessard
791dd4cb0a [stdlib] name your constants better
- computed properties have an ABI impact; a function is fine here
2025-06-25 22:01:28 -07:00
Alejandro Alonso
596b015994 Adjust ABI test and guard address of property 2025-06-25 14:08:53 -07:00
Alejandro Alonso
6953a7c6f9 Update InlineArray.swift 2025-06-25 14:00:16 -07:00
Alejandro Alonso
5ac3a655d4 Update InlineArray.swift 2025-06-25 14:00:15 -07:00
Alejandro Alonso
db13bf0802 Update InlineArray.swift 2025-06-25 14:00:14 -07:00
Alejandro Alonso
8058bd26f6 Remove underscored with buffer pointer APIs on InlineArray 2025-06-25 14:00:12 -07:00
Gábor Horváth
7f7a5b19eb Merge pull request #81024 from swiftlang/gaborh/fix-cpp-benchmarks
[cxx-interop] Reenable C++ benchmarks
2025-06-25 12:30:01 +02:00
Konrad `ktoso` Malawski
989ec93762 Merge branch 'main' into wip-deprecate-extractisolation 2025-06-25 16:57:52 +09:00
Guillaume Lessard
4a13c916d7 [stdlib] name your constants 2025-06-24 17:19:48 -07:00
Guillaume Lessard
e8f0d52fe2 [gardening] labels for conditional compilation markers 2025-06-24 17:10:37 -07:00
eeckstein
830a842b7b Merge pull request #82455 from eeckstein/adress-of-borrow-feature
Guard InlineArray addressors with feature flag
2025-06-24 20:58:18 +02:00
Gabor Horvath
3dda301496 [cxx-interop] Reenable C++ benchmarks
The underlying issue was fixed in #82309

rdar://149402670
2025-06-24 17:57:42 +01:00
David Smith
08233afee9 Extend the existing memoization of NSString's Hashable conformance to cover AnyObjects that are actually NSStrings as well (#82440)
Fixes rdar://154123172 (Consider memoizing the lookup for NSString's
conformance to Hashable)
2025-06-24 08:21:13 -07:00
Erik Eckstein
0dbc63a00b Guard InlineArray addressors with feature flag
To be able to parse a recent Swift.swiftinterface file with a 6.2 compiler.
This is a follow-up fix for https://github.com/swiftlang/swift/pull/81441

rdar://154118968
2025-06-24 16:02:54 +02:00
Konrad `ktoso` Malawski
a28515ec7e Merge pull request #82372 from ktoso/wip-NeverErrorTaskShouldNotThrowInOperation 2025-06-24 15:35:43 +09:00
Guillaume Lessard
0473190189 [stdlib] adjust small string for contiguity 2025-06-23 18:38:33 -07:00
Guillaume Lessard
3aad241019 [stdlib] address 32-bit watchOS ABI issue 2025-06-23 18:31:16 -07:00
Adrian Prantl
31a9b798bb Merge pull request #82356 from adrian-prantl/catchall
[reflection] Fine-tune error messages
2025-06-23 15:13:10 -07:00
Alastair Houghton
0d14682f99 [Concurrency] Rename Dummy(Main|Task)Executor.
`UnimplementedExecutor` seems like a better name.

rdar://153531418
2025-06-23 16:47:50 +01:00
Allan Shortlidge
008efc432f stdlib: Fix missing unsafe operators in more places.
Add `unsafe` where it is still missing. I missed these in previous passes due
to conditional compilation.
2025-06-22 18:46:57 -07:00
3405691582
3bb369cd91 Use libpthread primitives for OpenBSD mutexes.
There has been some discussion as to whether this is the right approach,
centered around internal pointers in the underlying mutex structure.
After much thought, let's commit this for now. The argument:

* While it is true that OpenBSD has futex(2) and in fact is used in
  the underlying implementations in Dispatch. I'm not confident right now
  creating robust locking primitives by hand from futexes.
  It would be ideal to just delegate all of this to Dispatch, but
  Dispatch doesn't expose a ready-use API for mutexes. Cobbling one
  together might be possible, but that would take some time and finesse.

* While recent versions of C and C++ have language support for mutexes,
  they are implemented in many cases by libpthread anyway, so there
  is nothing inherently gained right now by not using the pthread API
  other than portability.

* While the concern for internal pointers for the pthread API is
  important, the OpenBSD is mitigated by the fact that pthread_mutex_t is
  pointer-valued on the platform. The concern that this might not always
  be the case is mitigated by the fact that this commit does not attempt
  to use the pthread implementation as a catch-all for all platforms.

* The alternative is to use MutexUnavailable, but given Foundation has
  some dependencies on Mutex, this may cause problems elsewhere
  throughout the port.
2025-06-21 10:26:39 -04:00
Konrad 'ktoso' Malawski
57a6a9931a [Concurrency] Task.immediate returning Never error must not have throwing operation
rdar://153855920
2025-06-20 09:32:37 +09:00
Saleem Abdulrasool
157fdd3977 Merge pull request #82342 from compnerd/unsafe
stdlib: handle `unsafe` annotations in additional places
2025-06-19 11:10:14 -07:00
Egor Zhdan
e4fb2549b9 Merge pull request #82309 from swiftlang/egorzhdan/span-shared-cache
[cxx-interop] Make usages of Swift Span `@_alwaysEmitIntoClient` in the overlay
2025-06-19 16:46:07 +01:00
Saleem Abdulrasool
2ee8787712 Merge pull request #82343 from compnerd/ntapi
Platform: expose NTAPI
2025-06-18 23:09:01 -07:00
michael-yuji
cf2f7154a5 Merge pull request #77836 from michael-yuji/mchiu/freebsd
[FreeBSD] Adding FreeBSD support
2025-06-18 19:59:48 -07:00
Adrian Prantl
45198dc0ee [reflection] Fine-tune error messages 2025-06-18 16:29:39 -07:00
Adrian Prantl
edc7109989 Merge pull request #82244 from adrian-prantl/expected-lowering
[Reflection] Add lightweight error handling to ReflectionContext
2025-06-18 10:08:43 -07:00
Saleem Abdulrasool
e049493d77 Platform: expose NTAPI
The NTAPIs are sometimes required to access some system information. At
the very least, the types defined here are useful to expose.
2025-06-18 09:51:52 -07:00
Saleem Abdulrasool
c17e67e1a9 stdlib: handle unsafe annotations in additional places
This applies more annotations in the `INTERNAL_CHECKS_ENABLED` disabled
paths, Windows, 32-bit, and non-ObjC paths. Interestingly enough, there
are a couple of compiler intrinsics which are also uncovered.
2025-06-18 09:46:17 -07:00
(null)
bc870eff36 removed duplicated 2025-06-17 16:07:39 -04:00
(null)
aaf283258b Merge branch 'main' into mchiu/freebsd 2025-06-17 15:41:57 -04:00
(null)
cf041b126e address pltaform orders and other nits 2025-06-17 15:37:49 -04:00
(null)
d6811260a9 Merge commit '665515c781999a81094bbe4f8302a7cb1a6a6b39' into mchiu/freebsd 2025-06-17 15:12:23 -04:00
Guillaume Lessard
e29b425a6b Merge pull request #82277 from glessard/rdar153219174-UMBP-mutableSpan
[stdlib] add missing computed properties
2025-06-17 11:51:06 -07:00
Egor Zhdan
67e2024417 [cxx-interop] Make usages of Swift Span @_alwaysEmitIntoClient in the overlay
This fixes a regression where projects that use the C++ stdlib overlay stop building because of a linker error:
```
ld: Shared cache eligible dylib cannot link to ineligible dylib '@rpath/libswiftCompatibilitySpan.dylib'.
```

Usages of `Span<T>` would generally cause a type metadata accessor to be emitted for `Swift.Span`. This becomes a problem with backdeployment, since Span is partially defined in a compatibility binary.

This change adds `@_alwaysEmitIntoClient` to generic usages of `Span` to prevent the type metadata accessor from being emitted into `libswiftCxx.a`.

rdar://152192080
2025-06-17 19:42:14 +01:00
Valeriy Van
61ab279986 Fix doc comment in DropWhile.swift (#82290) 2025-06-17 10:38:02 -07:00
Adrian Prantl
868c9912aa [Reflection] Add lightweight error handling to ReflectionContext
Reflection metadata lookup failures are notoriously difficult to debug
because there is no error handling in TypeLowering outside of
compile-time #ifdef'd fprintf(stderr) calls. The nicest thing to do
would be to adopt llvm::Expected<> but TypeLowering is also included
in the standard library, which only has access to a tiny subset of the
LLVM Support library. This patch adds a place to store a pointer to
the first encountered error, which can then be converted to an
llvm::Error at the API level.
2025-06-17 09:47:11 -07:00
Egor Zhdan
f6e61728c5 Merge pull request #82161 from swiftlang/egorzhdan/template-param-nullability
[cxx-interop] Import nullability of templated function parameters correctly
2025-06-17 16:51:47 +01:00
Valeriy Van
d22a24744f Fix bug making ~0x1 mask in stdlib/toolchain/CompatibilityDynamicReplacements/DynamicReplaceable.cpp (#82264)
Solves #62665.
2025-06-17 09:03:16 -04:00
Guillaume Lessard
0433cd292c [stdlib] add UMBP.mutableSpan accessor 2025-06-16 22:28:21 -07:00
Guillaume Lessard
f952ca5988 [stdlib] add URMBP.mutableBytes accessor 2025-06-16 22:28:21 -07:00