Commit Graph

21665 Commits

Author SHA1 Message Date
Nate Chandler
091368ba21 [CoroutineAccessors] Added read.
The name is a placeholder for the mutating single-yield coroutine
accessor.
2024-09-26 18:10:39 -07:00
Nate Chandler
98a2e6a7df [CoroutineAccessors] Added modify.
The name is a placeholder for the mutating single-yield coroutine
accessor.
2024-09-26 18:10:39 -07:00
Amritpan Kaur
1c494c4d89 [StdLib] Handle nil property descriptors. 2024-09-25 12:54:52 -07:00
Kuba (Brecka) Mracek
d3c5149714 Merge pull request #76658 from kubamracek/embedded-managed-buffer
[embedded] Add support for ManagedBuffer to Embedded Swift
2024-09-25 02:54:55 -07:00
Kuba Mracek
0b50c2155e Don't emit upcast to the same type in SimplifyAllocRefDynamic, add test, add comment 2024-09-24 08:48:51 -07:00
Justice Adams
579d2bc942 set install dir correctly for libSwiftRemoteMirror 2024-09-23 15:34:18 -07:00
Kuba Mracek
c7a5569c4f [embedded] Add support for ManagedBuffer to Embedded Swift
This makes ManagedBuffer available and usable in Embedded Swift, by:

- Removing an internal consistency check from ManagedBuffer that relies on metatypes.
- Making the .create() API transparent (to hoist the metatype to the callee).
- Adding a AllocRefDynamicInst simplification to convert `alloc_ref_dynamic` to `alloc_ref`, which removes a metatype use.
- Adding tests for the above.
2024-09-23 13:32:50 -07:00
Konrad `ktoso` Malawski
b9319d80f1 Merge branch 'main' into wip-experimental-isolated-deinit 2024-09-23 09:01:06 +09:00
Konrad `ktoso` Malawski
62b04be2fa Revert "Revert "[Distributed] remote calls over-retain returned values"" 2024-09-21 14:50:35 +09:00
Konrad `ktoso` Malawski
9779137dc9 Revert "[Distributed] remote calls over-retain returned values" 2024-09-21 13:58:43 +09:00
Konrad `ktoso` Malawski
3f371fd0a6 Merge pull request #76595 from ktoso/wip-release-dist-execute-return
[Distributed] remote calls over-retain returned values
2024-09-21 08:21:38 +09:00
Tim Kientzle
5d5627ae82 Merge pull request #76586 from tbkka/tbkka-enum-with-CF
Better support CoreFoundation types in RemoteMirror
2024-09-20 13:09:26 -07:00
Meghana Gupta
961e6ea104 Merge pull request #76294 from meg-gupta/rewritenext
Rewrite UnsafeRawBufferPointer.Iterator.next
2024-09-20 12:10:39 -07:00
Konrad `ktoso` Malawski
d89347bed0 Merge branch 'main' into wip-experimental-isolated-deinit 2024-09-20 18:34:45 +09:00
Konrad `ktoso` Malawski
b3c5bc47fe Merge pull request #76560 from amartini51/task_docs_style 2024-09-20 15:06:12 +09:00
Konrad `ktoso` Malawski
a12420a739 [Distributed] Must deinitialize return value of remoteCall
resolves rdar://136338200
resolves rdar://136313477
2024-09-20 14:33:46 +09:00
Guillaume Lessard
af262949a9 Merge pull request #76583 from glessard/nc-generics-annotation-cleanup
[gardening] remove obsolete annotations
2024-09-19 19:33:24 -07:00
Tim Kientzle
da5383c4c3 Better support CoreFoundation types in RemoteMirror
This plugs a hole where we failed to recognize a CF type when it
appeared as the payload of an enum stored as a property.  Curiously,
RemoteMirror is able to reflect this when the enum appears by itself,
just not when it's stored as a property.

The simplest fix is to hook into the TypeInfo calculation which
computes a TypeInfo (basically, the tree of fields) from a TypeRef
(basically, the name of the type, including generic context).
Specifically, we sometimes end up here with a "type alias" that
none of the lookup support seems to be able to handle.  Fortunately,
these aliases demangle into a pretty predictable shape, so this
just pattern-matches the specific demangle tree shape to recognize
these as "type aliases in the `__C` module whose name starts with `CF`
and ends with `Ref`".

Resolves rdar://82465109
2024-09-19 13:50:41 -07:00
Guillaume Lessard
a35dea18c5 [gardening] remove obsolete annotations 2024-09-19 12:56:31 -07:00
Alex Martini
44ecc6325f Revise for documentation style
- Use the spelling "canceled" per Apple Style Guide
- Use code voice for symbol name
- Use contractions
- Avoid parenthesis for asides
- Change "it" to "that function" to reduce ambiguity
2024-09-18 15:42:14 -07:00
Alastair Houghton
0963036734 [Build] Make sure we declare LINUX_STATIC dependencies on Musl.
Everywhere there's a `SWIFT_MODULE_DEPENDS_LINUX Glibc`, there should be
a corresponding `SWIFT_MODULE_DEPENDS_LINUX_STATIC Musl`.

This usually won't bite us, depending on build order and parallelism, but
I hit one of these yesterday so went looking to see if there were any
others.

rdar://136208589
2024-09-18 09:40:58 +01:00
Konrad `ktoso` Malawski
fc03688e63 Merge pull request #76508 from swiftlang/ktoso-patch-17 2024-09-18 13:17:26 +09:00
Konrad `ktoso` Malawski
57bf319577 Update Task.swift 2024-09-18 09:38:02 +09:00
Konrad `ktoso` Malawski
6c8d0c9e1b Apply suggestions from code review
Co-authored-by: Alex Martini <amartini@apple.com>
2024-09-18 09:29:04 +09:00
Konrad `ktoso` Malawski
5e29d51674 Apply suggestions from code review
Co-authored-by: Alex Martini <amartini@apple.com>
2024-09-18 09:13:18 +09:00
Tony Allevato
9279ddfd1b Merge pull request #76519 from allevato/various-fixes
[NFC] Small cleanup in stdlib/public/runtime.
2024-09-17 15:06:14 -04:00
Tony Allevato
c68c4333b9 [NFC] Small cleanup in stdlib/public/runtime.
These changes fix minor issues that cause compilation errors with our
C++ toolchain's stricter default settings:

* `Exception.cpp`: The return type of `__cxa_begin_catch` should be
  `void *`, not `void` (see https://libcxxabi.llvm.org/spec.html).
* `Leaks.mm`: `''` is not a valid C char literal; use `'\0'` instead.
2024-09-17 10:45:28 -04:00
Konrad `ktoso` Malawski
7d1ce789ad Revert "Revert "Isolated synchronous deinit"" 2024-09-17 17:35:38 +09:00
Konrad `ktoso` Malawski
6d37240ef2 Update Task.cancel() with more details
Add more details into cancel() docs, some developers were worried if they are allowed to call it concurrently and multiple times etc.
2024-09-17 09:38:43 +09:00
Kuba (Brecka) Mracek
142df19324 Merge pull request #76231 from kubamracek/embedded-deinit-release
[embedded] Handle retain/retain ops inside deinit in Embedded Swift's swift_release
2024-09-16 16:13:08 -07:00
Ian Anderson
7961e8d3e2 Merge pull request #76471 from ian-twilightcoder/tgmath_fix
Import tgmath_h instead of Darwin.C.tgmath
2024-09-16 15:53:28 -07:00
Mike Ash
b7d7159782 [Runtime] Support lazy ObjC realization of Swift classes.
When the ObjC runtime indicates that it supports lazy realization, avoid forcing realization of classes while setting them up. This saves time and memory for classes that never touch the parts of the ObjC runtime that trigger realization

rdar://136102084
2024-09-16 17:12:26 -04:00
Meghana Gupta
58c6a2fb31 Merge pull request #76455 from meg-gupta/enablestdlib
Enable NonEscapableTypes in standard library and make the feature suppressible
2024-09-16 11:52:41 -07:00
Stephen Canon
a4c20e043b Add borrowing _withUnprotectedUnsafePointer (#76446)
* Add non-inout `_withUnprotectedUnsafePointer`

For withUnsafePointer we have both an inout and a borrowing form, allowing it to be used with immutable values. Add a parallel form for the unprotected variant.

* Update LifetimeManager.swift
2024-09-16 14:11:34 -04:00
Kuba Mracek
b4431db2c5 [embedded] Add a more detailed explaining comment to swift_release_n_ 2024-09-16 10:37:40 -07:00
Mike Ash
bc6c027a1f [Concurrency] Add a debug variable that holds the current version of the concurrency library.
This allows lldb to know which version of the internals layout it needs to use.

rdar://135886268
2024-09-16 09:14:03 -04:00
Ian Anderson
488c47b6be Import tgmath_h instead of Darwin.C.tgmath
Recent Apple SDKs moved tgmath.h from Darwin.C.tgmath to tgmath_h.

rdar://135982993
2024-09-13 17:56:58 -07:00
Meghana Gupta
9184923089 Enable experimental feature NonescapableTypes in the stdlib 2024-09-13 01:54:20 -07:00
Ian Anderson
52d9d8006d Merge pull request #76359 from ian-twilightcoder/dont-build-overlays-on-apple
[CMake] [Darwin] Don't build the SDK overlays by default on Apple platforms
2024-09-12 06:14:01 -07:00
Alastair Houghton
3494c40fef Merge pull request #76399 from al45tair/eng/PR-135787913
[Backtracer][macOS] Fix crashing thread index when Rosetta is in use.
2024-09-12 11:21:55 +01:00
Ian Anderson
5bf2c937ab [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.

rdar://115192929
2024-09-11 22:26:37 -07:00
Mike Ash
ea6e5e707f Merge pull request #76047 from mikeash/remote-mirror-resilient-superclasses
[RemoteMirror] Fix generic subclasses of resilient superclasses.
2024-09-11 18:19:19 -04:00
Jonathan Grynspan
db7a030a71 Extend internal _mangledTypeName() function to take non-copyable types. (#76041)
`_mangledTypeName()` returns the Swift-mangled typename of a given type. This PR extends it to take non-copyable types as well.

Related to our use case in Swift Testing, but not to the PR directly: #69146 #69147 #71112

Resolves rdar://134278607.
2024-09-11 16:11:58 -04:00
Doug Gregor
b272a05ea9 Merge pull request #76363 from DmT021/wp/print-diagnostic-groups
[Diagnostics] Add -print-diagnostic-groups flag
2024-09-11 13:04:07 -07:00
Mike Ash
6cf878cb48 Merge pull request #76371 from mikeash/unsafe-at-any-cvalistpointer
[Stdlib] Mark CVaListPointer as @unsafe.
2024-09-11 14:29:16 -04:00
Mike Ash
b35a2a11f1 Merge pull request #76309 from mikeash/mirror-thin-metatypes
[Mirror] Handle fields of thin metatypes.
2024-09-11 10:52:05 -04:00
Konrad `ktoso` Malawski
4aaf47181e Merge pull request #75878 from jamieQ/stream-termination 2024-09-11 22:42:52 +09:00
Dmitrii Galimzianov
a8b71ea97f Add -print-diagnostic-groups flag
This change adds the `-print-diagnostic-groups` flag as described by SE-0443.
2024-09-11 13:34:42 +02:00
Alastair Houghton
4c47540ecf [Backtracer][macOS] Fix crashing thread index when Rosetta is in use.
If you're using Rosetta 2, there are ARM64 threads in your process as
well, which the backtracer skips.  Unfortunately doing that messed up
the crashing thread index, so the backtracer might have crashed or
told you that a different thread was crashing than the one you
thought.

This only affects running x86-64 code on an Apple Silicon Mac.

rdar://135787913
2024-09-11 10:44:35 +01:00
Mike Ash
3937ceecc7 [Stdlib] Mark CVaListPointer as @unsafe.
rdar://135604375
2024-09-10 14:49:38 -04:00