Commit Graph

5783 Commits

Author SHA1 Message Date
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
swift-ci
3256392211 Merge pull request #26630 from Catfish-Man/shim-shim-sher-ee 2019-08-23 17:08:59 -07:00
David Smith
3fe46e3f16 Remove stdlib and runtime dependencies on Foundation and CF 2019-08-23 14:10:23 -07:00
Stephen Canon
d80b1d39a3 Backout SE-0246 (#26809)
* Revert "Add availability information to the new Math function protocols (#24187)"

This reverts commit d2f695935f.

* Revert "SE-0246: Protocols and static functions (#23824)"

This reverts commit 57a4553832.

* Expected abi changes.
2019-08-23 16:41:17 -04:00
Karoy Lorentey
b8dc0f4735 [stdlib] AutoreleasingMutableUnsafePointer: switch to _unsafeReferenceCast for extra validation 2019-08-22 14:25:19 -07:00
Nate Cook
90f9dd480e Merge branch 'master' into nc_lazyscan_fix 2019-08-22 10:47:47 -05:00
Nate Cook
3dcdd451a6 [stdlib] Revisons to lazy prefix documentation. 2019-08-22 10:42:42 -05:00
Karoy Lorentey
88630e8ea3 [stdlib] AutoreleasingUnsafeMutablePointer: use typed pointers rather than UnsafeRawPointer
This improves code generation in -Onone mode. (UnsafeRawPointer.load/.storeBytes isn’t @_transparent and it doesn’t get specialized in unoptimized builds.)
2019-08-21 18:43:57 -07:00
Karoy Lorentey
b9e3ada255 [stdlib] Make Unmanaged.takeUnretainedValue, .takeRetainedValue transparent
This improves codegen in debug builds.
2019-08-21 18:31:28 -07:00
Karoy Lorentey
61c5ac118d [stdlib] AutoreleasingUnsafeMutablePointer: update docs 2019-08-21 18:25:55 -07:00
Alex Martini
f040edaa85 Typo fix: of of -> of
rdar://problem/54218099
2019-08-21 10:40:18 -07:00
Karoy Lorentey
6a92bb9e2e [stdlib] AutoreleasingUnsafeMutablePointer: eliminate questionable pointer use
AutoreleasingUnsafeMutablePointer is pointing to a +0 reference, but in its pointee property’s getter/setter implementations, it is loading the pointer into regular Unsafe[Mutable]Pointers. Those are assuming that the addressed memory contain a +1 reference, which can mislead the compiler into doing optimizations that aren’t valid.

Change the getter/setter implementations so that they use UnsafeRawPointer and load/store Unmanaged values instead. As long as Unmanaged.passUnretained(_:) and Unmanaged.takeUnretainedValue() do the right thing, then AutoreleasingUnsafeMutablePointer won’t have issues, either. (This boils down to ensuring that loading a strong reference out of an unmanaged(unsafe) value works correctly.)
2019-08-20 20:15:49 -07:00
swift-ci
5f80f77343 Merge pull request #26747 from natecook1000/nate/doc_copymemory_backwards 2019-08-20 12:49:57 -07:00
Nate Cook
15f78fc7af Document that raw copyMemory methods handle overlapping memory. 2019-08-20 13:15:20 -05:00
Greg Titus
dd4c6053a7 Warning fixes for core stdlib. 2019-08-15 10:14:50 -07:00
David Smith
bd3643a1b2 Merge pull request #26588 from Catfish-Man/shadow-backflip
Re-shim tagged NSString creation
2019-08-12 18:01:23 -07:00
David Smith
f559a94f1b Redo CFStringCreateWithBytes shim 2019-08-12 15:15:10 -07:00
Michael Gottesman
bd4953475a [ownership] Compile stdlibCore with ownership stripping after serialization. 2019-08-12 03:32:59 -07:00
Scott Perry
15904df5d4 Review feedback from @lorentey 2019-08-10 09:30:25 -07:00
Scott Perry
e01e964dd9 Review feedback from @xwu 2019-08-09 12:35:32 -07:00
Scott Perry
6c992d91b2 Return nil on applying() failure instead of crashing (rdar://problem/53663769) 2019-08-08 16:50:13 -07:00
Karoy Lorentey
d7e57347ee [stdlib] Unify _NativeDictionary.subscript._modify’s two yields to work around SR-10604 2019-08-07 17:15:04 -07:00
swift-ci
b2d83d4c99 Merge pull request #26422 from Catfish-Man/its-about-sending-a-message 2019-08-07 15:57:00 -07:00
David Smith
d0ed51925b Review comments and subsequent build fix on https://github.com/apple/swift/pull/26422 2019-08-07 13:42:51 -07:00
Stephen Canon
fb2128b33b Remove doc comments from concrete floating-point types (#26399)
* Remove doc comments from concrete floating-point types

... when they are already present on the protocol. I don't *think* that we need them anymore for xcode documentation purposes. There are reasonable arguments both ways on this:
1. when you're editing the concrete implementations, it's sometimes nice to have the doc comment right there.
2. but it needlessly repetitive, and introduces the opportunity for comments to get out of sync.
3. it also adds noise; it would be nice for information density if the implementation only had implementation notes.

* Add examples to documentation for FloatingPoint.isCanonical

In particular, document that subnormal encodings are treated as non-canonical zeros on platforms that flush to zero.

* Additional fixes by @xwu and @natecook1000 .
2019-08-06 18:17:37 -04:00
David Smith
0887299d9e Fix sub-scalar index distances in foreign UTF8 views 2019-08-02 16:45:42 -07:00
Alex Langford
184d942ba0 [CMake] add_swift_target_library shouldn't implicitly set INSTALL_IN_TARGET
This makes it more explicit what the install component of a target
library is if you don't see one (and its marked as IS_SDK_OVERLAY).
Explicit in this case makes more sense, as you don't have to rely on
knowledge of how `add_swift_target_library` is implemented to understand
what component is used to install the target.
2019-08-02 13:51:52 -07:00
David Smith
c5fc715746 Reimplement the CF stub system using ObjC. The primary effect of this is to break the link-time dependency on the CF symbols, but it also improves performance a bit.
One additional tweak (setting the scalar-aligned bit on foreign indices) had to be made to avoid a performance regression for long non-ASCII foreign strings.
2019-08-01 19:56:45 -07:00
Karoy Lorentey
a25e53468e [gardening] Delete StringGutsVisitor.swift (#26393) 2019-07-29 19:08:46 -07:00
Xiaodi Wu
a078c33ceb [stdlib] Change documented behavior of FloatingPoint.significand (#26390) 2019-07-29 11:08:04 -04:00