Commit Graph

7762 Commits

Author SHA1 Message Date
Robert Widmann
b9fe66e0e8 Add documentation to _DependenceToken 2019-11-21 10:48:18 -08:00
Mao ZiJun
d5e2533cef improved OptionSet.remove's code style 2019-11-21 14:55:39 +09:00
Mao ZiJun
a8fd973876 fixed OptionSet's remove method 2019-11-21 11:25:41 +09:00
swift-ci
598042b521 Merge pull request #21550 from valeriyvan/patch-1 2019-11-18 15:27:40 -08:00
Slava Pestov
50872964dd Merge pull request #28289 from slavapestov/generic-parameters-are-unreliable-witnesses
Revert "Sema: Look for generic parameters first when inferring an associated type"
2019-11-16 01:56:16 -05:00
Nate Cook
8bfe519413 [stdlib] Use RRC.filter in removeAll(where: _) (#18825) 2019-11-15 16:24:27 -06:00
Slava Pestov
55e3797471 Revert "Sema: Look for generic parameters first when inferring an associated type"
This breaks source compatibility a little bit more than we'd like, so
reverting it for now.

Fixes <rdar://problem/57213598>.

This reverts commit 04fbcc0149.
2019-11-15 14:32:13 -05:00
Nate Cook
7c0ed24867 [stdlib] Document Windows implementation of SystemRandomNumberGenerator (#28268) 2019-11-15 10:38:44 -06:00
Slava Pestov
04fbcc0149 Sema: Look for generic parameters first when inferring an associated type
Previously we did this as a last resort if inference fails. The new
behavior is technically source-breaking, but I suspect nobody
relied on the old behavior.

This can help avoid cycles by eliminating some unnecessary validation work.

Fixes <https://bugs.swift.org/browse/SR-11407>, <rdar://problem/54979757>.
2019-11-13 23:42:08 -05:00
Michael Ilseman
1d63710a06 Merge pull request #28016 from milseman/swept_under_the_bridge
[stdlib] [gardening] Refactor bridging from StringStorage.swift
2019-11-06 13:43:32 -08:00
Dan Zheng
53e61a9587 [AutoDiff upstream] Add the _Differentiation module. (#27511)
The `_Differentiation` module is the experimental support library for
differentiable programming. It is built when the build-script flag
`--enable-experimental-differentiable-programming` is enabled.

The `Differentiable` protocol generalizes all types that work with
differentiation. It is a core piece of the differentiable programming
project. Other parts depending on the `Differentiable` protocol will
be upstreamed piece by piece.

The `Differentiable` protocol is compiler-known and will be used during
type-checking, SILGen, and the SIL differentiation transform.
2019-11-06 11:31:12 -08:00
Hamish Knight
1bc56dcc11 [stdlib] Mark some parameters @_nonEphemeral
These include the pointer-to-pointer and pointer-to-buffer-pointer
initialiser parameters amongst a couple of others, such as
`Unmanaged.fromOpaque`, and the source for the `move[...]` family of
methods.
2019-11-03 08:42:26 -08:00
Michael Ilseman
8463e53df3 [stdlib] [gardening] Refactor bridging from StringStorage.swift
Add StringStorageBridge.swift to separate out ObjC interop
functionality.

NFC
2019-11-01 17:25:08 -07:00
David Smith
ed1f9b30ef Implement both -isEqual: and -isEqualToString: to directly call the internal _isEqual, to avoid a redundant ObjC message send + type check 2019-10-28 16:36:13 -07:00
David Smith
637af2f9fe Merge pull request #27709 from Catfish-Man/bridge-to-the-future
Optimize accessing Swift arrays via ObjC
2019-10-23 00:19:06 -07:00
David Smith
d9cef0afef Optimize accessing Swift Arrays from ObjC 2019-10-22 20:57:36 -07:00
Julian Lettner
e819acdc29 Merge pull request #27808 from apple/tsan-empty-array-storage
[TSan] Do not report benign race on `_swiftEmptyArrayStorage`
2019-10-21 18:39:36 -07:00
David Smith
282e0c858b Merge pull request #27826 from Catfish-Man/last-object-standing
Bridging fidelity: allow removeLastObject() on empty NSMutableArrays
2019-10-21 18:32:24 -07:00
David Smith
da6adc8ba2 Bridging fidelity: allow removeLastObject() on empty NSMutableArrays 2019-10-21 17:20:32 -07:00
Julian Lettner
381dcc24fc [TSan] Do not report benign race on _swiftEmptyArrayStorage
A previous commit [1] identified and fixed a benign race on
`_swiftEmptyArrayStorage`.  Unfortunately, we have some code duplication
and the fix was not applied to all the necessary places.  Essentially,
we need to ensure that the "empty array storage" object that backs many
"array like types" is never written to.

I tried to improve the test to capture this, however, it is very
finicky.  Currently, it does not go red on my system even when I remove
the check to avoid the benign race in Release mode.

Relevant classes: Array, ArraySlice, ContiguousArray, ArrayBuffer,
ContiguousArrayBuffer, SliceBuffer.

[1] b9b4c789f3

rdar://55161564
2019-10-21 11:22:25 -07:00
David Smith
a1c1779c9f Guard against passing endIndex to foreignScalarAlign when back-deploying to 5.0 stdlibs 2019-10-18 14:24:23 -07:00
swift-ci
a91d4aaa52 Merge pull request #27670 from Catfish-Man/fastscii-2 2019-10-15 18:39:45 -07:00
David Smith
007ff00617 Add fast paths for String(decoding:…, as: Unicode.ASCII.self) 2019-10-15 17:26:23 -07:00
Dan Zheng
2bd55f6755 [Autodiff upstream] Add build-script flag for differentiable programming. (#27595)
Add `--enable-experimental-differentiable-programming` build-script flag.

The build-script flag enables/disables standard library additions
related to differentiable programming. This will allow official Swift
releases to disable these additions.

The build-script flag is on by default to ensure testing of
differentiable programming standard library additions. An additional
driver flag must be enabled to use differentiable programming features:
https://github.com/apple/swift/pull/27446
2019-10-14 14:34:48 -07:00
David Smith
3d321c1905 Fix the new Swift NSMutableArray subclass to match edge case behavior in two more cases 2019-10-02 15:47:51 -07:00
own2pwn
3ec5e76ee3 Update FloatingPointTypes.swift.gyb (#27461)
Corrects intent that this type seems to be available only on MacOS targets.
2019-10-02 15:41:42 -04:00
swift-ci
d1c87f3c93 Merge pull request #24270 from natecook1000/nc_lazyscan_fix 2019-09-28 20:53:45 -07:00
Nate Cook
f6547cc828 Address feedback from @amartini51. 2019-09-26 13:25:15 -05:00
David Smith
1cce12f20c Add an Array-based NSMutableArray subclass 2019-09-24 18:15:33 -07:00
David Smith
90037745ad Add C calling convention shims for creating arrays and strings from buffers 2019-09-24 13:06:54 -07:00
David Smith
b8fb2e5eae Merge pull request #27155 from Catfish-Man/shim-shim-sher-ee-2
Remove stdlib and runtime dependencies on Foundation and CF
2019-09-13 09:43:38 -07:00
Doug Gregor
5285afdbe6 [SIMD] Use @_alwaysEmitIntoClient rather than @_transparent 2019-09-12 21:31:36 -07:00
David Smith
1efa946caf Remove stdlib and runtime dependencies on Foundation and CF 2019-09-12 18:03:14 -07:00
Doug Gregor
87516934cd [SIMD] Add disambiguating += and -= operators.
The introduction of += and -= default implementations on
AdditiveArithmetic introduces an ambiguity with the += and -=
implementations on SIMD (where Scalar: FloatingPoint). Break the
ambiguity by adding another set of definitions of += and -= on
AdditiveArithmetic & SIMD where Self.Scalar: FloatingPoint.

Fixes rdar://problem/55278156.
2019-09-12 17:54:46 -07:00
Nate Cook
06102a9ffa Minor additional revisions 2019-09-11 10:09:55 -05:00
Karoy Lorentey
9638e9167c [doc] ManagedBuffer: Fix cross-reference to isKnownUniquelyReferenced 2019-09-10 18:52:26 -07:00
Karoy Lorentey
6bc4c85005 [doc] Avoid use of “iff” in public API documentation 2019-09-10 18:52:01 -07:00
Nate Cook
ce28cdee93 Update the error message when subscripting String with Int. (#27069)
Instead of referring to a doc comment that isn't really accessible to the
developer, let's be accurate about what type they should be using here.
2019-09-10 12:23:09 -05:00
swift-ci
b8f42d6165 Merge pull request #26466 from nvzqz/is_concrete_builtin 2019-08-28 19:10:37 -07:00
swift-ci
7039277e4d Merge pull request #26906 from amartini51/master 2019-08-28 13:44:31 -07:00
swift-ci
f804efd5af Merge pull request #25430 from natecook1000/nc-prefixwhile-degyb 2019-08-28 13:21:05 -07:00
Nate Cook
55f9be3291 Switch "may" to "might" per comments from @amartini51. 2019-08-28 13:37:00 -05:00
Alex Martini
64c32f3331 Add missing ) and code voice.
rdar://problem/46680213
2019-08-28 10:36:34 -07:00
Michael Gottesman
447f00892a [ownership] Enable ownership lowering on overlays. I still need to flip the switch to enable this on the tests/rest of the world. 2019-08-27 18:26:15 -07:00
Nikolai Vazquez
6e542bf22a Annotate Swift._isConcrete with @_transparent
Returns `false` otherwise in Debug builds because it is generic.
2019-08-27 16:51:09 -07:00
Nikolai Vazquez
890409effd Elaborate in docs for Swift._isConcrete 2019-08-27 16:51:09 -07:00
Nikolai Vazquez
ba0612f2e9 Add Builtin.isConcrete<T>(T.Type) -> Int1
Returns `true` if `T.Type` is known to refer to a concrete type. The
implementation allows for the optimizer to specialize this at -O and
eliminate conditional code.

Includes `Swift._isConcrete<T>(T.Type) -> Bool` wrapper function.
2019-08-27 16:51:09 -07:00
Karoy Lorentey
895f13657f Merge pull request #26760 from lorentey/♪-hold-me-use-me-autorelease-me-♬
[stdlib] AutoreleasingUnsafeMutablePointer: eliminate questionable pointer use
2019-08-27 10:22:04 -07:00
Arnold Schwaighofer
fe69a86929 Revert "Remove stdlib and runtime dependencies on Foundation and CF"
It is causing bots to fail.

* Revert "The __has_include(<os/system_version.h>) branch here wasn't quite right, we'll just use the dlsym one for now"

This reverts commit f824922456.

* Revert "Remove stdlib and runtime dependencies on Foundation and CF"

This reverts commit 3fe46e3f16.

rdar://54709269
2019-08-26 13:00:08 -07:00
Steve (Numerics) Canon
273616f513 Remove BuiltinMath funcs for Float80/Android
These were previously removed in SE-0246, so they weren't modified when Float80 was removed elsewhere on Android. Reverting SE-0246 on master triggers an Android break.
2019-08-24 21:48:15 -04:00