This apinote file needs to be accessible in the locally built Android SDK as it's being built with build.ps1, so that swift-foundation can be built with that file present. This change ensures that the file is copied over into the local build directory for that Android SDK, in addition to being included in the installed component
This change also places the component into lib/swift/apinotes, as that's where the clang importer already looks for API notes
* [stdlib] Remove docs from default implementations
Customized docs were not removed:
public static var isSigned: Bool
public static var max: Self
public static var min: Self
public var description: String
public var magnitude: Self
public init<T: BinaryInteger>(_ source: T)
public func distance(to other: Self) -> Int
public func advanced(by n: Int) -> Self
* [stdlib] Remove unused docs for "unsafe" methods
* [stdlib] Remove inherited "ReportingOverflow" docs
* [stdlib] Remove inherited docs for operators
Customized docs were not removed.
(`+`, `-`, `*`, `+=`, `-=`, `*=`)
Non-inherited docs were not removed.
(`&+`, `&-`, `&+=`, `&-=`, `&*=`)
* [stdlib] Reattach doc comments to their APIs
Use `rstrip()` to remove the trailing newline.
<https://docs.python.org/3/library/stdtypes.html#str.rstrip>
* [stdlib] Remove inherited docs from integer types
* [stdlib] Remove FIXME(ABI) comments
* [stdlib] Remove unused docs for operators
* [stdlib] Update example code for `-=` and `*=`
* [stdlib] Update internal gyb comments
* [stdlib] Move docs to BinaryInteger overrides
* [stdlib] Remove unused gyb code
* [stdlib] Fix `&-` and `&*` examples
* Add missing period at end of sentence
* Add missing period
Co-authored-by: LamTrinh.Dev <me@lamtrinh.dev>
---------
Co-authored-by: LamTrinh.Dev <me@lamtrinh.dev>
The executor may execute and free the task while the enqueue code is still finishing up. If that code tries to get an async backtrace (for example, if it calls malloc/free with malloc stack logging enabled) then it will find a dangling pointer in the current task TSD, and dereferencing it may crash.
rdar://130125017
This fills in a number of missing cases:
* MPEs with closure payloads
* MPEs with many non-payload cases
* MPEs with class existential payloads
* MPEs with existential metatype payloads
Resolves rdar://132270733
Resolves rdar://128705332
**Background:**
Each RemoteMirror test runs two processes: A host process runs the
RemoteMirror library and queries memory data from a target process. The host
and target communicate by passing strings back and forth with requests to read
particular information in memory. The target is pure Swift; the host is
C/C++.
**What this change does:**
Without this, the host makes very many small requests to the target.
Each of those requests has to be individually parsed by the target
using String operations from the debug stdlib. Actually transferring
the raw bytes is relatively quick.
With this, the host requests and caches "pages" of about 4k and
satisfies most requests from previously-fetched data. This dramatically
reduces the total number of operations.
**Performance notes:**
The following notes only count the time to compile and run the 78 tests in the
validation-tests/Reflection directory using `lit.py`; it does not include time
to rebuild the project before running tests.
**Performance with debug stdlib:**
(That is: `build-script -ra --debug-swift-stdlib`) Before this change, I got
tired of waiting after about 15 minutes and it was about 1/4 done. Some very
simplistic profiling showed >99% of the time being spent in stdlib String
operations in the target process. Activity Monitor shows that individual tests
run for about 6 minutes of CPU time each.
With this change, the tests run in about 70s of wall time. Almost all of the
time seems to spent compiling the tests; the tests themselves run too quickly to
even show up in the Activity Monitor.
**Performance with release stdlib:**
(That is: `build-script -ra`)
The tests run in about 70s of wall time with or without this change.
The subscript function from CxxRandomAccessCollection did not perform any bounds-checks.
This means that C++ containers that don't provide the operator[] (or C++ containers used in generic contexts) didn't have bounds-checks.
Fixes rdar://126570011
SWIFT_DEBUG_VALIDATE_UNCHECKED_CONTINUATIONS works by tracking the context pointers of active continuations, and verifying that a resumed context is in the set of active continuations. However, the resume calls are passed the task pointer, not the context pointer. The context pointer is recovered from the task. If the task has been destroyed, the context pointer is invalid. This can result in a weird error message or it can crash if the context pointer is used before checking it against the active continuations.
Instead, track tasks that are suspended pending an unchecked continuation. If the task is destroyed, we'll still be passed the dangling pointer and check that pointer against the tracking info. We must be sure to check that before trying to use anything inside it.
rdar://131858544
- when compiling embedded cross compile target standard libraries, include AVR
- add 16-bit pointer as a conditional compilation condition and get the void pointer size right for gyb sources
- attempt to fix clang importer not importing __swift_intptr_t correctly on 16 bit platforms
- changed the unit test target to avr-none-none-elf to match the cmake build
[AVR] got the standard library compiling in a somewhat restricted form:
General
- updated the Embedded Runtime
- tweaked CTypes.swift to fix clang import on 16 bit platforms
Strings
- as discussed in https://forums.swift.org/t/stringguts-stringobject-internals-how-to-layout-on-16-bit-platforms/73130, I went for just using the same basic layout in 16 bit as 32 bit but with 16 bit pointers/ints... the conversation is ongoing, I think something more efficient is possible but at least this compiles and will probably work (inefficiently)
Unicode
- the huge arrays of unicode stuff in UnicodeStubs would not compile, so I skipped it for AVR for now.
Synchronization
- disabled building the Synchronization library on AVR for now. It's arguable if it adds value on this platform anyway.
Extend the _unsafeInheritExecutor_ workaround to all remaining APIs in the
Concurrency library that have adopted `#isolation` default arguments to
(safely) stay in the caller's isolation domain...
... except one. Clock.measure() is currently running into problems with
the type checker workaround and needs a little more thought.
Fixes rdar://131760111.
When initializing a range set with a group of overlapping, identical,
or empty ranges, the initializer can exhibit poor performance due
to removing the unneeded ranges during processing. This change uses
a partitioning scheme instead, only removing the unnecessary ranges
at the end of initialization.
It should no longer be necessary to provide an `@_alwaysEmitIntoClient` version
of `_diagnoseUnavailableCodeReached()`. This workaround was originally added to
provide compatibility with projects that were misconfigured to compile against
a newer stdlib but link against an older one.
Resolves rdar://119892482.