Commit Graph

9403 Commits

Author SHA1 Message Date
Itai Ferber
6171d68bfa Merge pull request #25065 from ikesyo/fix-dataprotocol-lastrange
Fix `DataProtocol.lastRange(of:)` (and cherry-pick Data.swift changes from swift-5.0-branch)
2019-05-28 09:54:16 -07:00
Sho Ikeda
44f0e93747 Merge pull request #25067 from ikesyo/avoid-fallthrough-where-appropriate
[gardening] Avoid fallthrough where appropriate (for readability/understandability)
2019-05-29 00:27:05 +09:00
Sho Ikeda
2019a97e55 Merge pull request #25066 from ikesyo/use-isempty-over-count
[gardening] Use `Collection.isEmpty` over `Collection.count`
2019-05-29 00:24:48 +09:00
Turushan Aktay
c61691919b Fix documentation typos. 2019-05-26 14:17:45 +02:00
Sho Ikeda
c1bb945124 [gardening] Avoid fallthrough where appropriate (for readability/understandability) 2019-05-26 09:50:02 +09:00
Sho Ikeda
a35c9f0c60 [gardening] Use Collection.isEmpty over Collection.count 2019-05-26 09:35:20 +09:00
swift-ci
b088acb66e Merge pull request #24767 from ikesyo/remove-unnecessary-breaks 2019-05-25 16:15:06 -07:00
Sho Ikeda
55b300f852 Fix DataProtocol.lastRange(of:) (and cherry-pick Data.swift changes from swift-5.0-branch)
`DataProtocol.lastRange(of:)` is correct in swift-5.0-branch, but not in master and swift-5.1-branch.
2019-05-26 07:26:33 +09:00
Federico Zanetello
afcf4b6991 fix documentation typo (#25061) 2019-05-25 12:43:49 -05:00
Arnold Schwaighofer
b127aac1ce Merge pull request #24781 from aschwaighofer/fix_some_type_dynamic_replacement
Fix dynamic replacement of some type when used with associated types
2019-05-23 16:36:32 -07:00
Arnold Schwaighofer
0297476da5 Add missing swiftrt-coff change 2019-05-22 11:23:17 -07:00
David Smith
5fba88c78e Merge pull request #24386 from Catfish-Man/noble-from-a-distant-land
Avoid O(n) character accesses in String.UTF8View._foreignCount
2019-05-21 14:40:27 -07:00
David Smith
803227a46b Avoid O(n) character accesses in String.UTF8View._foreignCount 2019-05-21 13:22:42 -07:00
Pavol Vaskovic
06685bcb51 Merge pull request #24898 from Gumichocopengin8/fix-warnings
[stdlib] Fix withUnsafeBytes warnings in NWEndpoint
2019-05-19 22:16:43 +02:00
Keita Nonaka
7d8c54329c fix withUnsafeBytes warnings 2019-05-19 00:39:01 -04:00
Arnold Schwaighofer
5c3a4d329b Fix dynamic replacement of some type when used with associated types
rdar://50638228
2019-05-18 10:34:52 -07:00
Slava Pestov
e0bba70923 Foundation: Provide a Hashable.hashValue witness for _BridgedStoredNSError conformers
Previously we would synthesize this in Sema, but this no longer
works when conformance checking is triggered by SILGen.
2019-05-18 11:35:05 -04:00
swift-ci
3c25d99652 Merge pull request #24806 from colemancda/posixErrorLinux 2019-05-15 18:28:45 -07:00
Alsey Coleman Miller
1f15c87f35 Added missing Linux POSIX errors 2019-05-15 14:03:11 -05:00
Stephen Canon
fa778ec368 Deprecate nearbyint and rint on CGFloat (#24784)
These functions have never actually been supported in Swift, because Swift does not model the dynamic floating point environment. They may have worked occasionally in the past, but that was only accidental. Deprecate them with an explanatory message.
2019-05-15 11:04:03 -04:00
swift-ci
d1cc7136dd Merge pull request #23793 from phausler/data_mapped_perf_bug 2019-05-15 07:58:32 -07:00
Brent Royal-Gordon
dce879f508 Revert "[Foundation] Fix availability of NSValue.value(of:)" 2019-05-15 05:17:42 -07:00
Philippe Hausler
8a751bd4de Add tests and validate Data and DispatchData as sequences 2019-05-14 17:12:44 -07:00
Bob Wilson
6160545800 Merge pull request #24498 from lorentey/nsvalue-availability
[Foundation] Fix availability of NSValue.value(of:)
2019-05-14 15:22:22 -07:00
Stephen Canon
6971335803 Switch from using deprecated float3-style names to SIMD3<Float> in overlays. (#24743) 2019-05-14 13:20:13 -04:00
Mike Ash
1a0c785384 Merge pull request #24729 from mikeash/fix-isa-mask-assert
[Runtime] Don't check objc_debug_isa_class_mask when back deploying.
2019-05-14 12:30:11 -04:00
Sho Ikeda
6eead16283 [gardening] Remove unnecessary breaks 2019-05-15 00:54:33 +09:00
Doug Gregor
54d3930ae8 [Runtime] Adjust to conforming type when instantiating witness table.
When we find a protocol conformance descriptor for a given type, make sure
we adjust to the conforming type of that descriptor (following the superclass
chain as needed) before instantiating the witness table.

Fixes rdar://problem/49741838.
2019-05-13 20:53:02 -07:00
Mike Ash
c42ec7ab35 [Runtime] Don't check objc_debug_isa_class_mask when back deploying.
Older OSes may not have this value or may have a different value. We only want to check going forward, because newer runtimes don't run on older OSes except in certain testing scenarios.

rdar://problem/50700856
2019-05-13 11:37:19 -04:00
Ted Kremenek
4beb673b8e Bump compiler version to Swift 5.1 (#24671)
* Bump version to Swift 5.1

* Update tests with compiler version bump

* Undo flatMap and math obsolescences
2019-05-13 07:32:39 -07:00
Xiaodi Wu
da9f67c781 [docs] Update trailingZeroBitCount documentation (#24713)
* [docs] Update `trailingZeroBitCount` documentation

Document the required behavior for `trailingZeroBitCount` when the value is zero. Namely, in that scenario, `trailingZeroBitCount` should be equal to `bitWidth`.

* [docs] Address reviewer comments on `trailingZeroBitCount` docs
2019-05-13 08:53:28 -04:00
Patrick Pijnappel
70be266440 Merge pull request #23293 from PatrickPijnappel/range-overlaps-performance-impl
[stdlib] Refactor Range Overlaps for Performance
2019-05-13 22:00:23 +10:00
swift-ci
b2542a3134 Merge pull request #24127 from Gumichocopengin8/fix-build-warnings 2019-05-13 04:26:53 -07:00
Slava Pestov
97be86bbca Runtime: Don't try to register class stubs on older objc runtimes
This will allow us to emit class stubs unconditionally, rather than
checking the -enable-resilient-objc-class-stubs flag.

Part of <rdar://problem/49090631>.
2019-05-10 21:26:09 -04:00
Brent Royal-Gordon
ea515bff5c Merge pull request #24699 from mikeash/fix-isa-mask-assert
[Runtime] In the assert for SWIFT_ISA_MASK, tolerate it if objc_debug_isa_class_mask is not available.
2019-05-10 17:01:02 -07:00
Mike Ash
3ec3d9b6dd [Runtime] In the assert for SWIFT_ISA_MASK, tolerate it if objc_debug_isa_class_mask is not available.
rdar://problem/50674635
2019-05-10 17:27:32 -04:00
Nate Cook
841eb4cf5e [stdlib] Revise collection difference documentation (#24675)
* Revise CollectionDifference documentation.
2019-05-10 20:57:46 +02:00
Mike Ash
14a20eea03 Merge pull request #24616 from mikeash/hardcode-swift-isamask
[Runtime] Use a #define for the value of swift_isaMask.
2019-05-10 13:31:57 -04:00
Mike Ash
b85c600395 [Runtime] Use a #define for the value of swift_isaMask.
This allows _swift_getClassOfAllocated to use a constant instead of loading from a global, and allows swift_isaMask to be computed without a static initializer. Debug builds verify that the #define matches the value from libobjc.

rdar://problem/22375602 rdar://problem/46385113
2019-05-10 09:37:51 -04:00
Saleem Abdulrasool
99134680b3 Merge pull request #24636 from compnerd/custom-cross
stubs: configure flags based on SDK target
2019-05-09 16:17:18 -07:00
Steve (Numerics) Canon
d5819c9329 Also apply @inlinable to AccelerateBuffer default implementations. 2019-05-09 18:01:07 -04:00
Stephen Canon
e6406d878d Drop @inline(__always) from Accelerate overlay; it doesn't do what you want. (#24641)
@inline(__always) does not imply inlinable, which means that it effectively does nothing in the context of the Accelerate overlay. I have replaced all of these with @inlinable where that can be done as a one-line change. Functions that switch over open enums and more complex API (DCT, DFT, FFT) will require more sophisticated corrections, which we can undertake in later commits. For now, they have been rolled back to simply being normal public API.
2019-05-09 17:10:34 -04:00
Saleem Abdulrasool
08dfdf0bff stubs: configure flags based on SDK target
Due to the custom build system implemented in CMake for Swift, we cannot
properly detect the target and set flags appropriately.  Instead, assume
that if the primary variant is an Apple target, that all targets are
Apple variants.  This fixes cross-compilation on macOS.
2019-05-09 08:09:32 -07:00
Mike Ash
213efbbfaa [Runtime] Avoid +class overrides when initializing an ObjC class.
swift_getInitializedObjCClass called [c class] to trigger class initialization, and returned the value. This wreaked havoc when the class in question overrides +class. Instead, ignore the return value and return c. Switch from +class to +self, which is much less likely to be overridden. Calling an overridden method could have performance downsides or even cause unwanted side effects.

rdar://problem/49853091
2019-05-08 16:17:56 -04:00
Mike Ash
0ea82d6890 Merge pull request #24534 from mikeash/swiftnativexxx-warnings-fix
[Stdlib] Fix warnings about designated initializers in SwiftNativeXXX classes.
2019-05-08 13:26:28 -04:00
Daniel Rodríguez Troitiño
47be3d68bd Merge pull request #24547 from drodriguez/android-remove-uuid-from-glibc
[android] Remove uuid.h from Android's Glibc.
2019-05-07 10:58:44 -07:00
Davide Italiano
92daf4ba04 Merge pull request #24217 from dcci/check-boundaries-reflection
[Reflection] Check that the offset is within the section.
2019-05-07 10:10:18 -07:00
Daniel Rodríguez Troitiño
562b79dcf7 [android] Remove uuid.h from Android's Glibc.
Android doesn't ship with uuid.h, so having a module pointing to that
header is an error.
2019-05-06 17:31:45 -07:00
Davide Italiano
b4434fdd8d [Reflection] Fix the computation of boundaries in getFieldName(). 2019-05-06 17:27:20 -07:00
Saleem Abdulrasool
8047351375 WinSDK: correct FIONBIO 2019-05-06 17:24:21 -07:00