Commit Graph

21434 Commits

Author SHA1 Message Date
Alex Lorenz
e6461882c8 Merge pull request #76841 from hyp/eng/stdlib-pragma-clang-diag
[stdlib][android] ignore the -Wgnu-offsetof-extensions in ExecutorChe…
2024-10-07 08:04:43 -07:00
Konrad `ktoso` Malawski
d41c9c2e8b [Distributed] improve control flow of result buffer init detection 2024-10-07 23:26:47 +09:00
swift-ci
48648e95a7 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-07 04:14:40 -07:00
Egor Zhdan
168413ef61 Merge pull request #76823 from swiftlang/egorzhdan/msvc-bit-module
[cxx-interop] Modularize __msvc_bit_utils on Windows
2024-10-07 12:10:55 +01:00
Alastair Houghton
54a495527e [Concurrency] Remove C++ runtime references from embedded Concurrency.
In embedded mode, we mustn't have references to the C++ library, because
some embedded platforms don't include the C++ library.

Additionally, it's good to avoid use of global operator new and operator
delete, because they can be globally overridden and this has bitten us
in the past.

rdar://137286187
2024-10-07 10:30:27 +01:00
Mykola Pokhylets
cb4c880af1 Move TaskLocal.h out of ABI folder, because it describes implementation details 2024-10-06 14:37:11 +02:00
swift-ci
61d99dd045 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-05 03:06:15 -07:00
Konrad `ktoso` Malawski
e8c25a456d [Distributed] fix deinitialization of result buffer 2024-10-05 14:40:11 +09:00
Egor Zhdan
16e7cbeafa [cxx-interop] Modularize __msvc_bit_utils on Windows
`__msvc_bit_utils.hpp` was added in a recent version of MSVC, and it is causing build errors for SwiftCompilerSources:
```
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\numeric:598:12: error: function '_Select_countr_zero_impl<unsigned long long, (lambda at C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\numeric:598:55)>' with deduced return type cannot be used before it is defined
    return _Select_countr_zero_impl<_Common_unsigned>([=](auto _Countr_zero_impl) {
```

This change references the `__msvc_bit_utils.hpp` header from the modulemap. Since we still need to support older versions of Visual Studio that do not provide `__msvc_bit_utils.hpp`, this also teaches ClangImporter to inject an empty header file named `__msvc_bit_utils.hpp` into the system include directory, unless it already exists.

rdar://137066642
2024-10-04 13:15:20 +01:00
swift-ci
a658eaa0e8 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-04 03:35:39 -07:00
Egor Zhdan
1f39eee77f Merge pull request #76861 from swiftlang/egorzhdan/glibc-remove-wasi
[Glibc] Remove WASI gyb logic from the modulemap
2024-10-04 11:21:45 +01:00
swift-ci
433a6d8469 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-03 19:47:13 -07:00
Kuba (Brecka) Mracek
341d6305ff Merge pull request #76767 from kubamracek/embedded-concurrency-task-groups
[Concurrency] Enable TaskGroup/DiscardingTaskGroup in Embedded Swift
2024-10-03 19:29:54 -07:00
swift-ci
6db692928d Merge remote-tracking branch 'origin/main' into rebranch 2024-10-03 18:33:24 -07:00
Konrad `ktoso` Malawski
6dea968c7e Merge pull request #76858 from swiftlang/revert-76627-revert-76623-revert-76595-wip-release-dist-execute-return 2024-10-04 10:26:49 +09:00
Egor Zhdan
5b9186e445 [Glibc] Remove WASI gyb logic from the modulemap
This is a minor cleanup of the generated Glibc modulemap.

WASI no longer uses the Glibc modulemap since 902d75e6.
2024-10-04 01:00:24 +01:00
swift-ci
53aec1363d Merge remote-tracking branch 'origin/main' into rebranch 2024-10-03 15:14:28 -07:00
Konrad `ktoso` Malawski
41d8962783 Revert "Revert "Revert "[Distributed] remote calls over-retain returned values""" 2024-10-04 06:53:43 +09:00
Egor Zhdan
0c106006db [Glibc] Remove Android gyb logic from the modulemap
This is a minor cleanup of the generated Glibc modulemap.

Android no longer uses the Glibc modulemap since 57b89d53.
2024-10-03 19:37:11 +01:00
swift-ci
4505e5a30d Merge remote-tracking branch 'origin/main' into rebranch 2024-10-03 09:35:14 -07:00
Egor Zhdan
535a9412df [cxx-interop] Conform std::map to ExpressibleByDictionaryLiteral
This adds an automatic conformance for `std::map` and `std::unordered_map` to Swift's `ExpressibleByDictionaryLiteral` protocol.

This makes it possible to pass a dictionary literal as an argument to a function that takes a `std::map` as parameter.

rdar://137126474
2024-10-03 13:33:40 +01:00
swift-ci
cd956f3b28 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-03 04:53:49 -07:00
Egor Zhdan
9169d81bd5 Merge pull request #76830 from swiftlang/egorzhdan/cxx-set-array-literal
[cxx-interop] Conform `std::set` to `ExpressibleByArrayLiteral`
2024-10-03 12:44:07 +01:00
swift-ci
d9badbc2dd Merge remote-tracking branch 'origin/main' into rebranch 2024-10-03 03:17:27 -07:00
Konrad `ktoso` Malawski
f45f683f24 Merge pull request #76627 from swiftlang/revert-76623-revert-76595-wip-release-dist-execute-return 2024-10-03 19:15:59 +09:00
swift-ci
b8a5d2d6d7 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-03 01:35:42 -07:00
Konrad `ktoso` Malawski
dea3b59331 Merge pull request #76250 from ktoso/wip-experimental-isolated-deinit 2024-10-03 17:19:10 +09:00
swift-ci
143233255c Merge remote-tracking branch 'origin/main' into rebranch 2024-10-02 22:33:49 -07:00
Kuba (Brecka) Mracek
762e7898de Merge pull request #76760 from kubamracek/embedded-asyncstream
[Concurrency] Include more pieces of Concurrency in Embedded (AsyncStream, continuations)
2024-10-02 22:23:17 -07:00
Alex Lorenz
f72ea6526f [stdlib][android] ignore the -Wgnu-offsetof-extensions in ExecutorChecks.cpp
ExecutorChecks.cpp no longer builds for android as -Wgnu -Werror is used for stdlib
2024-10-02 17:31:37 -07:00
swift-ci
78bf2cd399 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-02 14:54:18 -07:00
Mike Ash
4c385e4334 Merge pull request #76797 from mikeash/isequal-nil
[Runtime] Handle nil parameter to -[SwiftObject isEqual:]
2024-10-02 17:51:43 -04:00
Ben Barham
eddc289fd9 Merge pull request #76761 from bnbarham/nostd-for-unicode
[embedded] Skip C++ stdlib for unicode stubs
2024-10-02 14:27:12 -07:00
Egor Zhdan
f37f42fc7e [cxx-interop] Conform std::set to ExpressibleByArrayLiteral
Swift's own `Set` conforms to `ExpressibleByArrayLiteral`. This change conforms instantiations of C++ `std::set` to `ExpressibleByArrayLiteral` as well.

This makes it possible to pass an array literal as an argument to a function that takes a `std::set` as parameter.

rdar://137126325
2024-10-02 19:27:51 +01:00
Kuba (Brecka) Mracek
4b68c3fa6f Merge pull request #76766 from kubamracek/embedded-dont-avoid-any-actor
[Concurrency] Drop the cloned code for Embedded around 'any Actor'
2024-10-02 10:47:49 -07:00
Kuba Mracek
ed441eb1bf [Concurrency] Include more pieces of Concurrency in Embedded (AsyncStream, continuations)
We have been only including a subset of files and functionality on Embedded Concurrency, let's instead include all the
source files, and have a fine grained opt out on things that don't yet work. Namely, this is still avoiding clocks, task
sleeping and custom executors.

Add a test for AsyncStream and continuations on Embedded Concurrency.
2024-10-02 09:22:36 -07:00
Egor Zhdan
7f597c63ae Merge pull request #76726 from swiftlang/egorzhdan/char8_t
[cxx-interop] Support `char8_t` C++20 type
2024-10-02 16:10:17 +01:00
eeckstein
4a069c9926 Merge pull request #76790 from eeckstein/add-ast-module
SwiftCompilerSources: introduce the AST module
2024-10-02 10:50:18 +02:00
Alastair Houghton
f8d6012d9a Merge pull request #76483 from al45tair/eng/PR-135380149
[Concurrency] Build executors as their own separate object modules.
2024-10-02 09:39:46 +01:00
Erik Eckstein
5502373018 SIL: rename AssociatedTypeProtocolWitness -> AssociatedConformanceWitness in SILWitnessTable
To be consistent with the naming convention in the AST
2024-10-02 07:10:30 +02:00
Michael Gottesman
cb8e8b505a Fix syntax highlighting by changing how we include COMPATIBILITY_OVERRIDE_INCLUDE_PATH.
The way that we include COMPATIBILITY_OVERRIDE_INCLUDE_PATH freaks out the
syntax highlighting of editors like emacs. It causes the whole file to be
highlighted like it is part of the include string.

To work around this, this patch creates a separate file called
CompatibilityOverrideIncludePath.h that just includes
COMPATIBILITY_OVERRIDE_INCLUDE_PATH. So its syntax highlighting is borked, but
at least in the actual files that contain real code, the syntax highlighting is
restored.
2024-10-01 16:17:16 -07:00
Kuba Mracek
7e00fe4b36 [embedded] Use hasFeature(Embedded) instead of in TaskGroup.swift+DiscardingTaskGroup.swift 2024-10-01 15:00:53 -07:00
Kuba Mracek
a2dcb6045c [embedded] Introduce a new swift_taskGroup_initializeWithOptions runtime entrypoint 2024-10-01 14:56:38 -07:00
Dario Rexin
a5bb53aee9 [Runtime] Properly compute offset for unmanaged properties in generic CVW instantiation
rdar://137066879

An unmanaged property does not map to an operation in CVW, instead it will be copied like primitive values. When instantiating the layout string, we correctly do not emit an operation, but we compute the offset to the next field as if we did. This is causing the offset to be incorrect and subsequent operations to be executed on the wrong address, causing crashes or other misbehavior.
2024-10-01 11:25:14 -07:00
Mike Ash
c928203780 [Runtime] Handle nil parameter to -[SwiftObject isEqual:]
The parameter is nullable, and isEqual: should always return nil in that case. We need to check for nil before doing anything else.

rdar://136825667
2024-10-01 14:05:39 -04:00
Alastair Houghton
cf77aa37df [Concurrency] Fix macOS build issue.
We need to use the `swift` namespace in `NonDispatchGlobalExecutor.cpp`.

rdar://135380149
2024-10-01 14:02:52 +01:00
Doug Gregor
af49172b55 Mark Range.init(uncheckedBounds:) and ClosedRange.init(uncheckedBounds:) as @unsafe 2024-09-30 15:20:36 -07:00
Kuba Mracek
9b56ea03d2 [Concurrency] Drop the cloned code for Embedded around 'any actor' 2024-09-30 10:30:09 -07:00
Alastair Houghton
e6882f243f [Concurrency] Fix Linux/Windows build issues.
Define `NOMINMAX` and `WIN32_LEAN_AND_MEAN` when including `<Windows.h>`.

Don't export the interface from DLLs.

Make sure we include `<new>` when using placement operator new.

rdar://135380149
2024-09-30 17:18:09 +01:00
Alastair Houghton
837513dc16 [Concurrency] Fix test failures, add struct layout checks.
We were missing a field in `SwiftJob`, which broke various things.  To
avoid that problem in future, this PR adds a set of static asserts to
check the layout of various structures and that we're using the same
values as well.

Also added some functions to the ABI, and fixed things so that if you
enable the debug logging the library still builds (there was an extra
`_` in `Actor.cpp` that caused a build failure).

Finally, renamed `Hooks.cpp` to `ConcurrencyHooks.cpp`.

rdar://135380149
2024-09-30 17:16:33 +01:00