Commit Graph

17422 Commits

Author SHA1 Message Date
Alastair Houghton
21ac6149e3 Don't use tsd_private.h in compatibility libraries for ARMv7k.
If we include this file, it generates inline assembly, which would be fine
except that when apps are being built with bitcode, that isn't allowed.

rdar://103274667
2023-01-19 16:48:42 +00:00
Alejandro Alonso
7fa0dd0030 Update some missing reflection availability (#63087) 2023-01-18 18:34:55 -08:00
swift-ci
f2302b926b Merge pull request #63034 from xwu/62260-heterogeneous-integer-comparisons-produce-suboptimal-code
[stdlib] Improve performance of heterogeneous binary integer `==` and `<`
2023-01-17 21:23:55 -08:00
Saleem Abdulrasool
4e7d311d75 Merge pull request #63067 from compnerd/demanding-order
build: avoid use of `-external:I` on Windows
2023-01-17 20:04:10 -08:00
Xiaodi Wu
df6a56ecbc [stdlib] Make a stylistic change per reviewer feedback. 2023-01-17 19:39:59 -05:00
Alejandro Alonso
ffac122f9c Update Reflection availability (#63069) 2023-01-17 13:41:12 -08:00
Alejandro Alonso
c7a9360806 [Reflection] Build the _Runtime and Reflection modules (#62973)
* Move Runtime into _Runtime

Fix more _Runtime names

* Add availability to all API

* Build _Runtime and Reflection modules

* Use threading's mutex for all platforms

add stdlib include
2023-01-17 09:30:16 -08:00
Saleem Abdulrasool
9cbaafb77a build: avoid use of -external:I on Windows
Avoid the use of the new `-external:I` to indicate the system headers
for building the standard library on Windows as this will impact the
header search order and due to the compiler swapping and mixed build,
this breaks the runtime build on Windows.
2023-01-17 09:17:53 -08:00
Karoy Lorentey
1241df3fab [stdlib] String.debugDescription: Fix quoting behavior
`String.debugDescription` currently fails to protect the contents of
the string from combining with the opening or closing `”` characters
or one of the characters of a quoted scalar:

```swift
let s = “\u{301}A\n\u{302}B\u{70F}”
print(s.debugDescription)
// ⟹ “́A\n̂B܏”  (characters: “́, A, \, n̂, B, ܏”)
```

This can make debug output difficult to read, as string contents are
allowed to spread over and pollute neighboring meta-characters.

This change fixes this by force-quoting the problematic scalars in
these cases:

```swift
let s = “\u{301}A\n\u{302}B\u{70F}”
print(s.debugDescription)
// ⟹ “\u{301}A\n\u{302}B\u{70F}”
```

Of course, Unicode scalars that don’t engage in such behavior are
still allowed to pass through unchanged:

```swift
let s = “Cafe\u{301}”
print(s.debugDescription)
// ⟹ “Café”
```
2023-01-16 01:15:39 -08:00
swift-ci
7a0bcfa09d Merge pull request #63046 from lorentey/stdlib-5.9
[stdlib] Define and bump to version 5.9
2023-01-16 00:27:03 -08:00
Karoy Lorentey
6118ea552c Merge pull request #63043 from lorentey/gb11
[stdlib] String: Fix forward implementation of grapheme breaking rule 11
2023-01-15 20:13:02 -08:00
Karoy Lorentey
0a041c084d [stdlib] Define and bump to version 5.9 2023-01-15 19:56:18 -08:00
Konrad `ktoso` Malawski
6991319a3d [Concurrency] uncomment isCancelled override decl (#63007) 2023-01-16 09:43:16 +09:00
Karoy Lorentey
a3e517ed36 [stdlib] String: Fix forward implementation of grapheme breaking rule 11
Rule GB11 in Unicode Annex 29 is:

GB11: Extended_Pictographic Extend* ZWJ × Extended_Pictographic

However, our forward grapheme breaking state machine implements it as:

GB11: Extended_Pictographic Extend* ZWJ+ × Extended_Pictographic

We implement the correct rules when going backward, which can cause String values to have different counts whether we’re going forward or back.

The rule as implemented would be fine (Unicode doesn’t care much about the placement of grapheme breaks in invalid sequences), but the directional inconsistency messes with String’s Collection conformance.

rdar://104279671
2023-01-15 16:12:38 -08:00
Xiaodi Wu
f671e50265 [stdlib] Further optimize heterogeneous binary integer comparison 2023-01-15 13:32:24 -05:00
Xiaodi Wu
d6ac4e3476 [stdlib] Improve performance of generic binary integer == and < 2023-01-15 13:32:24 -05:00
Mike Ash
df48847c4a Merge pull request #62997 from mikeash/null-symbolic-reference-fatal-error
[Runtime] Fatal error when resolving a symbolic reference to NULL.
2023-01-13 09:14:14 -05:00
Konrad `ktoso` Malawski
53682358d0 [Concurrency] Fix DiscardingTaskGroup in TASK_TO_THREAD (#63009) 2023-01-13 22:57:33 +09:00
Konrad `ktoso` Malawski
943d1b830b [Concurrency] backdeploy library has no taskGroup_initializeWithFlags (#63006) 2023-01-13 19:08:47 +09:00
Alastair Houghton
6ca5716ef4 Merge pull request #62879 from al45tair/eng/PR-103950409
[Runtime] Make the swift_getTypeByMangled... functions emit error messages.
2023-01-12 20:32:41 +00:00
Mike Ash
7b33d2c0af [Runtime] Fatal error when resolving a symbolic reference to NULL.
We crash in ResolveAsSymbolicReference::operator() when a symbolic reference targets a missing symbol. We usually have very little information about what was missing when this happens. Instead of crashing, explicitly check for NULL and fatal error in that case, including information about the location of the symbolic reference that it came from.
2023-01-12 11:46:57 -05:00
Cory Benfield
9cb3641ce8 Remove checks in UR[M]BP.Iterator.next() (#62965)
Swift tends to emit unnecessary checks and traps when iterating unsafe
raw buffer pointers. These traps are confirming that the position
pointer isn't nil, but this check is redundant with the bounds check
that is already present. We can safely remove it.
2023-01-12 11:04:42 -05:00
Jonathan Grynspan
b2bbf00bd7 Remove unused infrastructure added for runtime attributes (#62971) 2023-01-12 04:16:45 -08:00
Egor Zhdan
0c64fe495d Merge pull request #62869 from apple/egorzhdan/cxx-sequence-docs
[cxx-interop] NFC: Improve documentation comments
2023-01-12 11:56:34 +01:00
swift-ci
8456a7e371 Merge pull request #62954 from kavon/tweak-atomics
Small fix for atomics when completing a future
2023-01-11 17:21:31 -08:00
Egor Zhdan
2ac5ccf7c8 [cxx-interop] NFC: Clarify copying semantics 2023-01-12 00:39:32 +00:00
Kavon Farvardin
ce3da795aa completeFuture should have acquire-release for the exchange
When a completed task updates the queue head to announce
that it's been completed, it only did an acquire exchange.

By also having it also do a release, we will ensure that
prior writes done by the completed task, before the task is
marked completed, will be correctly ordered as happening
before any subsequent reads by tasks waiting on that
completion status.

Co-authored-by: John McCall <rjmccall@apple.com>
2023-01-11 14:11:47 -08:00
Pavel Yaskevich
d0b8b16437 Merge pull request #62976 from DougGregor/builtin-task-group-with-flags-feature
Add BuiltinCreateTaskGroupWithFlags feature and use it to guard uses of the builtin
2023-01-11 13:56:03 -08:00
Egor Zhdan
f61a4bd948 Merge pull request #62945 from apple/egorzhdan/cxx-string-docs
[cxx-interop] NFC: Add documentation comments for string conversion
2023-01-11 22:52:07 +01:00
Doug Gregor
9e76023546 Add BuiltinCreateTaskGroupWithFlags feature and use it to guard the builtin 2023-01-11 13:47:28 -08:00
Egor Zhdan
fb27f392c7 [cxx-interop] NFC: Add documentation comments for string conversion 2023-01-11 12:24:33 +00:00
swift-ci
93a0a6d905 Merge pull request #62914 from ktoso/wip-task-group-twotypes
[Concurrency] DiscardingTaskGroup (rev 3)
2023-01-11 01:37:33 -08:00
Konrad `ktoso` Malawski
4b90cdbe5c Revert "cleanup"
This reverts commit 128e2b2099.
2023-01-11 13:03:22 +09:00
Konrad `ktoso` Malawski
128e2b2099 cleanup 2023-01-11 12:40:25 +09:00
Konrad `ktoso` Malawski
c59122fa92 remove changes in backdeploy lib, not needed 2023-01-11 11:58:34 +09:00
Konrad `ktoso` Malawski
6d63cf4994 fix cast type in getting task record 2023-01-11 11:55:52 +09:00
Doug Gregor
f1607c9258 Merge pull request #62948 from DougGregor/disable-macros-harder
Don't make older compilers parse @expression at all
2023-01-10 17:38:48 -08:00
Doug Gregor
4b9615e244 Don't make older compilers parse @expression at all 2023-01-10 11:32:08 -08:00
Allan Shortlidge
087aacc9fd [TaskLocals] Avoid use of defer in back deployed functions in the standard library.
Older versions of the 5.8 compiler have a bug when generating SIL for functions with `@_backDeploy` containing defer blocks (https://github.com/apple/swift/pull/62444) and for now we need the standard library interface to be compatible with those older compilers.

Resolves rdar://104045168
2023-01-10 10:44:15 -08:00
Doug Gregor
cfa7d379e1 Merge pull request #62932 from DougGregor/stdlib-expression-attr-check 2023-01-09 18:05:20 -08:00
Tim Kientzle
d969611ec5 Merge pull request #62614 from tbkka/tbkka-92945673-RemoteMirror-MPE
[RemoteMirror] Fix handling of zero-sized payloads and extra inhabitant calculations
2023-01-09 16:41:21 -08:00
Allan Shortlidge
dcb07d9854 Merge pull request #62928 from tshortli/remove-inlinable-from-tasklocal-withvalue
[TaskLocals] Remove use of `@inlinable` with `@_backDeploy` temporarily
2023-01-09 14:44:45 -08:00
Doug Gregor
728598907d Allow the standard library to build with a slightly older compiler
Check for the `@expression` attribute before using it. Fixes
rdar://104036723.
2023-01-09 11:46:57 -08:00
Karoy Lorentey
3f808f7311 Merge pull request #62897 from lorentey/character-recognizer-conformances
[stdlib] _CharacterRecognizer: Add Sendable, Equatable, CustomStringConvertible conformances
2023-01-09 11:33:23 -08:00
Alejandro Alonso
c7b3870868 Add Swift Reflection Package (#62819) 2023-01-09 11:17:27 -08:00
Allan Shortlidge
c7c806f768 [TaskLocals] Remove use of @inlinable with @_backDeploy temporarily. 2023-01-09 10:59:53 -08:00
Konrad `ktoso` Malawski
bf5ef5a4b0 undo any changes in backdeploy lib, we don't do any changes there 2023-01-09 19:00:18 +09:00
Konrad `ktoso` Malawski
6f33f2af88 remove even more duplicated methods 2023-01-09 14:42:43 +09:00
Konrad `ktoso` Malawski
f09cef20d9 more cleanup 2023-01-09 14:09:13 +09:00
Konrad `ktoso` Malawski
7845de85c7 remove duplicated status logic 2023-01-09 13:18:23 +09:00