Commit Graph

18295 Commits

Author SHA1 Message Date
Doug Gregor
6265f0c542 [SE-0395] Rename _Observation module to Observation
The review of SE-0395 is down to small details at this point that won't
affect the overall shape of the API much. Rename the model in
anticipation of that.
2023-06-30 11:01:02 -07:00
swift-ci
1bcd73c55f Merge pull request #64933 from ktoso/wip-group-param-docs
[docs][Concurrency] Fix typo in method signature in code snippets of groups
2023-06-29 22:27:47 -07:00
Konrad `ktoso` Malawski
6bfef94c9e [docs][Concurrency] Include required parameter in group docs
[docs][Concurrency] Fix typo in method signature in code snippets of groups
2023-06-30 12:17:57 +09:00
Dario Rexin
36914d9a68 Merge pull request #67039 from drexin/wip-mp-gen-destr-inject-tag
Support destructiveInjectEnumTag in generic multi payload enums with layout strings
2023-06-29 19:20:38 -07:00
Yuta Saito
af9b8293e0 Merge pull request #67014 from swiftwasm/pr-5212f18969d0b9d9853af4bc8293cb156ac57eec
[wasm][stdlib] Add wasi-libc support for Heap.cpp
2023-06-30 09:00:08 +09:00
Yuta Saito
c5058c0831 Merge pull request #67013 from swiftwasm/pr-cd0bac9cf59ab923c6e0d79638c7c6cfbb5a2b50
[build] Fix cmake config for reflection test without dynamic stdlib
2023-06-30 08:59:18 +09:00
Dario Rexin
8114ecc3e0 [Runtime] Add destructiveInjectEnumTag support for generic multi payload enums with layout strings 2023-06-29 16:34:10 -07:00
Dario Rexin
622f7a26e9 Merge pull request #67022 from drexin/wip-sp-gen-destr-inject-tag
Support destructiveInjectEnumTag in generic single payload enums with layout strings
2023-06-29 16:33:30 -07:00
Guillaume Lessard
98c50c3504 Merge pull request #67003 from glessard/idiomatic-rebinding-7
Rebind Memory Idiomatically
2023-06-29 13:53:09 -07:00
Dario Rexin
89d37da9ee [Runtime] Add destructiveInjectEnumTag support for generic single payload enums with layout strings 2023-06-29 10:37:51 -07:00
Yuta Saito
21d1e961bc [build] Fix cmake config for reflection test without dynamic stdlib
Build SwiftReflectionTest only if swift-reflection-test is available
because it depends on the tool and the tool is not available when no
dynamic stdlib is built
2023-06-29 11:22:38 +00:00
swift-ci
578ed42ba2 Merge pull request #66544 from kateinoigakukun/pr-30e1f2f61604200ebbd6a0a47877b209ab785d86
[Concurrency] Fix calling convention mismatch in AsyncStream
2023-06-29 03:04:15 -07:00
Yuta Saito
cc6f53efed [wasm][stdlib] Add wasi-libc support for Heap.cpp
Pointers returned by malloc() are 16-byte aligned on wasi-libc, even
it's 32-bit architecture. See wasi-libc's dlmalloc configuration:
aecd368c6d/dlmalloc/src/dlmalloc.c (L31)
2023-06-29 08:32:09 +00:00
Dario Rexin
964a51f4e9 [Runtime] Abstract tag handling for generic single payload enums (#67002)
* [Runtime] Abstract tag handling for generic single payload enums

This functionality will be shared across multiple functions, so adding the abstraction in preparation of that.

* Update BytecodeLayouts.cpp
2023-06-28 22:13:58 -07:00
Yuta Saito
7aa6cbbe2d Merge pull request #66851 from kateinoigakukun/katei/patch-series/driver-wasm-toolchain
Re-land `static-executable-args.lnk` changes
2023-06-29 12:38:51 +09:00
Dario Rexin
8733969222 [Runtime] Fix sign-compare warning in BytecodeLayouts (#67001) 2023-06-28 19:14:37 -07:00
Guillaume Lessard
fd7ced19ea [gardening] a simplification 2023-06-28 16:37:41 -07:00
Dario Rexin
3524945cd4 [IRGen+Runtime] Implement getEnumTag for singleton enums in layout strings (#66985) 2023-06-28 14:25:34 -07:00
Mike Ash
811950eb93 Merge pull request #66959 from mikeash/standard-protocol-manglings-go-faster
[Runtime] Fast-path lookup of protocol descriptors with standard manglings.
2023-06-28 09:48:44 -04:00
Dario Rexin
ca664141cc [IRGen+Runtime] Add support for initializeBufferWithCopyOfBuffer to layout strings (#66965) 2023-06-27 18:05:30 -07:00
Alejandro Alonso
bd11fceff5 Merge pull request #66949 from Azoy/minimal-must-stand
[stdlib] Make _createOffsetBasedKeyPath and _rerootKeyPath only available with…
2023-06-27 14:23:00 -07:00
Mike Ash
516c21a790 [Runtime] Fast-path lookup of protocol descriptors with standard manglings.
We weren't taking advantage of standard manglings in _findProtocolDescriptor like wo do in _findContextDescriptor. Extract out the "standard mangling" code and call it from both to speed up those searches.

rdar://111235115
2023-06-27 14:15:15 -04:00
Evan Wilde
250082df25 [NFC] Reformat all the LLVMs
Reformatting everything now that we have `llvm` namespaces. I've
separated this from the main commit to help manage merge-conflicts and
for making it a bit easier to read the mega-patch.
2023-06-27 09:03:52 -07:00
Evan Wilde
f3ff561c6f [NFC] add llvm namespace to Optional and None
This is phase-1 of switching from llvm::Optional to std::optional in the
next rebranch. llvm::Optional was removed from upstream LLVM, so we need
to migrate off rather soon. On Darwin, std::optional, and llvm::Optional
have the same layout, so we don't need to be as concerned about ABI
beyond the name mangling. `llvm::Optional` is only returned from one
function in
```
getStandardTypeSubst(StringRef TypeName,
                     bool allowConcurrencyManglings);
```
It's the return value, so it should not impact the mangling of the
function, and the layout is the same as `std::optional`, so it should be
mostly okay. This function doesn't appear to have users, and the ABI was
already broken 2 years ago for concurrency and no one seemed to notice
so this should be "okay".

I'm doing the migration incrementally so that folks working on main can
cherry-pick back to the release/5.9 branch. Once 5.9 is done and locked
away, then we can go through and finish the replacement. Since `None`
and `Optional` show up in contexts where they are not `llvm::None` and
`llvm::Optional`, I'm preparing the work now by going through and
removing the namespace unwrapping and making the `llvm` namespace
explicit. This should make it fairly mechanical to go through and
replace llvm::Optional with std::optional, and llvm::None with
std::nullopt. It's also a change that can be brought onto the
release/5.9 with minimal impact. This should be an NFC change.
2023-06-27 09:03:52 -07:00
Saleem Abdulrasool
50d2f4d3ed Merge pull request #66895 from STREGA/add-directinput
Add DirectInput
2023-06-27 07:22:39 -07:00
Alejandro Alonso
141fa804b1 Make _createOffsetBasedKeyPath and _rerootKeyPath only available with reflection 2023-06-26 23:09:39 -07:00
eeckstein
c8ec463312 Merge pull request #66920 from eeckstein/managedbuffer-inlinable-deinit
stdlib: make deinit of `ManagedBuffer` inlinable
2023-06-27 06:52:48 +02:00
Dario Rexin
fc6834daf6 [IRGen+Runtime] Add getEnumTag for layout strings on simple single payload enums (#66941) 2023-06-26 19:32:51 -07:00
Alejandro Alonso
0bb142f1fc Merge pull request #66870 from Azoy/keypath-offset-spi-fix
[stdlib] Add support for classes in _createOffsetBasedKeyPath
2023-06-26 11:24:45 -07:00
Erik Eckstein
a5744b2bb5 stdlib: make deinit of ManagedBuffer inlinable
This allows to eliminate dead allocations of a ManagedBuffer object.

https://github.com/apple/swift/issues/66496
2023-06-26 12:10:15 +02:00
Konrad `ktoso` Malawski
da34a4ef88 Merge pull request #66912 from apple/ktoso-patch-15 2023-06-24 17:44:39 +09:00
Dario Rexin
253d8fbf33 [IRGen+Runtime] Add getEnumTag for layout strings on generic single payload enum (#66911) 2023-06-23 20:43:28 -07:00
Konrad `ktoso` Malawski
0a2defed98 [Concurrency] Fix code snippet on task group docs
Code snippet was missing required of: parameter.
2023-06-24 10:59:13 +09:00
Dario Rexin
270089f297 [IRGen+Runtime] Layout string getEnumTag for fixed size enums subset (#66899)
* [IRGen+Runtime] Layout string getEnumTag for fixed size enums subset

getEnumTag impl for layout strings of fixed sized enums that use a function to fetch the enum tag

* Fix potential UB in IRGen
2023-06-23 18:10:55 -07:00
STREGA
9cc41fa80d Add DirectInput 2023-06-23 14:33:44 -04:00
Alastair Houghton
e5ece81cc9 [Freestanding] Remove uses of stat() and dlsym().
We shouldn't be using stat() or dlsym() in the freestanding
runtime.

rdar://111214571
rdar://106555012
2023-06-23 17:05:59 +01:00
Egor Zhdan
12f01ce23a Merge pull request #66855 from apple/egorzhdan/libstdcxx-arch-independent
[cxx-interop] Make libstdc++ header and modulemap arch-independent
2023-06-23 12:10:17 +01:00
Dario Rexin
36ddb77fcd [IRGen+Runtime] Layout string getEnumTag for generic multi payload enums (#66872)
We already store all necessary information to extract the tag in the layout string, so we should utilize it for the getEnumTag witness
2023-06-22 19:07:50 -07:00
Alejandro Alonso
d9d26eec9d Add support for classes in _createOffsetBasedKeyPath 2023-06-22 14:07:41 -07:00
Egor Zhdan
3e28a7c525 [cxx-interop] Make libstdc++ header and modulemap arch-independent
This moves `libstdcxx.modulemap` and `libstdcxx.h` from `*.xctoolchain/usr/lib/swift/macosx/arm64e` to `*.xctoolchain/usr/lib/swift/macosx` to simplify distribution.

rdar://110788977
2023-06-22 22:03:57 +01:00
Alastair Houghton
4f4d0147ca Merge pull request #66721 from al45tair/eng/PR-110665213
[Threading][TSan] Fix TSan errors from lazy init on Linux.
2023-06-22 20:03:00 +01:00
Dario Rexin
37220ed37f [Runtime] Handle generic multi payload enums in resilient resolve (#66848)
* [Runtime] Handle generic multi payload enums in resilient resolve

* Update BytecodeLayouts.cpp

* Update BytecodeLayouts.cpp
2023-06-22 12:02:46 -07:00
Dario Rexin
c3ae41381d [Runtime] Use proper offset in generic multi payload enum layout strings (#66856) 2023-06-22 12:02:33 -07:00
Dario Rexin
806fd1b58b [Runtime] Handle generic single payload enums in resilient resolve (#66849) 2023-06-22 10:53:55 -07:00
David Smith
e20be0edc6 Revert [Runtime] Let CF provide us with state, avoiding runtime lookup. rdar://111104451 (#66606) 2023-06-22 10:24:51 -07:00
Philippe Hausler
c5018f32c1 [Observation] Ensure lock storage rounding works for non-integral lock types (#66832) 2023-06-22 09:19:00 -07:00
Egor Zhdan
e064d23d74 Merge pull request #66764 from apple/egorzhdan/cxx-set-insert
[cxx-interop] Allow inserting elements into `std::set` from Swift
2023-06-22 15:26:57 +01:00
Yuta Saito
a613ab2521 Revert "Revert "Merge pull request #66793 from kateinoigakukun/pr-a75d757a3dcce5b990423cf1ab73ba4cd2f95b10""
This reverts commit 7aa4a8de06.
2023-06-22 08:31:32 +00:00
Yuta Saito
ad9409b517 [static-stdlib] NFC: Generalize the static-executable-args.lnk file generation
This patch makes the build system to copy the lnk files for each
stdlib targets if needed instead of only for the Linux target.

This is the take 2 of the patch. The first one was reverted in
7aa4a8de06
2023-06-22 08:30:37 +00:00
swift-ci
9b6e27e538 Merge pull request #66813 from Catfish-Man/bridge-flip-followup
Use swift::once instead of swift_once to clean up the code a little, and make sure we unconditionally set the state from CF to make sure it's set even if we failed a lazy load earlier
2023-06-21 22:59:22 -07:00