Commit Graph

13406 Commits

Author SHA1 Message Date
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
Ross Bayer
23a868e9f2 Merge pull request #24382 from Rostepher/usr-lib-install-name-dir
[Build System: CMake] Update the default install_name_dir to /usr/lib/swift for the standard library and overlays.
2019-05-13 15:05:22 -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
Nate Cook
ab5846c8a9 Shorten parameter name in doc example. 2019-05-10 03:34:44 +02: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
Mike Ash
d7c0a61c93 Merge pull request #24618 from mikeash/self-awareness-class-struggle
[Runtime] Avoid +class overrides when initializing an ObjC class.
2019-05-09 16:31:10 -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
f75060c768 Merge pull request #24529 from mikeash/remote-mirror-watchos-pointer-size-fix
[Reflection] Switch Remote Mirror back to uintptr_t for pointers on watchOS.
2019-05-09 09:21:35 -04:00
Mike Ash
5b2df468fc [Reflection] Include TargetConditionals.h for WatchOS detection, not Availability.h.
While we're in there, make SwiftReflectionTest's debugLog function take an @autoclosure so we don't waste a ton of time constructing log messages that are never logged.
2019-05-08 17:51:33 -04: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
Daniel Rodríguez Troitiño
7d0b78d00f [android] Stop leaking FDs in parent test process.
In the Android paths of the spawnChild function, the parent was creating
a pipe that was never closed, which led to FD starvation. In some tests
with a lots of expected crashes, the childs will not spawn anymore since
the linker would not have enough descriptors to open the shared
libraries, while in other tests which closed the child descriptors as
part of the last test, the parent process will hang waiting those
descriptors to be closed, which will never had happened.

The solution is implement the missing parts of the code, which tried to
read from the pipe in the parent side (using select and read, taking
pieces from other parts of the code). This should match the fork/execv
path used by Android and Haiku to the spawn code used by the rest of the
platforms.

This change fixes StdlibUnittest/Stdin.swift,
stdlib/InputStream.swift.gyb,
stdlib/Collection/FlattenCollection.swift.gyb and
stdlib/Collection/LazyFilterCollection.swift.gyb, which were the last 4
tests failing in Android AArch64.
2019-05-06 17:15:07 -07:00
Mike Ash
3ad6e46930 [Stdlib] Fix warnings about designated initializers in SwiftNativeXXX classes. 2019-05-06 17:15:53 -04:00
Michael Gottesman
4d4d6f6779 Merge pull request #24508 from compnerd/matchy-matchy
build: rename `LLVM_COMPONENT_DEPENDS`
2019-05-06 11:45:36 -07:00
Nicholas Maccharoli
cd5055711a Fix syntax error in comment code
Closing parentheses is missing in the example code.
2019-05-06 01:38:47 +09:00
Saleem Abdulrasool
218b37e1bb build: rename LLVM_COMPONENT_DEPENDS
This is not a target dependency but a target link.  Name the parameter
to be less misleading.  This also makes the name identical to the LLVM
parameter.
2019-05-04 19:58:28 -07:00
Karoy Lorentey
fbe5563d60 [Foundation] Fix availability of NSValue.value(of:) 2019-05-03 19:55:03 -07:00
David Smith
1192b914d2 Merge pull request #24457 from Catfish-Man/two-by-two-length-of-blue
Fix bounds check in bridged ASCII String comparison
2019-05-03 18:28:55 -07:00
Davide Italiano
1acedc6c69 [Reflection] Check that the offset is within the section.
<rdar://problem/49043621>
2019-05-03 17:09:09 -07:00
Patrick Pijnappel
87f02b173b [stdlib] Refactor range overlaps for performance 2019-05-04 09:15:21 +10:00
David Smith
008699e52d Fix bounds check in bridged ASCII String comparison 2019-05-03 15:55:58 -07:00
Ross Bayer
2493986369 Merge pull request #24419 from Rostepher/toolchain-apinotes
[Build System: CMake] Install the apinotes in the 'compiler' install component.
2019-05-03 11:45:18 -07:00
Joe Groff
6c779bb487 Merge pull request #24445 from jckarter/opaque-type-remote
Debugger support for opaque types.
2019-05-03 08:18:59 -07:00
Ross Bayer
c10b815ba4 [Build System: CMake] Install the apinotes in the 'compiler' install component when compiling for Darwin platforms.
Setting the CMake cache variable SWIFT_INCLUDE_APINOTES to true will override the default behavior and unconditionally create the install targets.
2019-05-02 18:42:37 -07:00
ravikandhadai
6069814d66 Merge pull request #24335 from ravikandhadai/oslog-refactoring
[os_log][stdlib-private] Refactor new os log APIs based on string interpolation for enabling optimizations.
2019-05-02 15:16:43 -07:00
Karoy Lorentey
d6f44ccdd8 Merge pull request #24421 from lorentey/blow-up-overlays
[CMake] Split overlay list to multiple lines (NFC)
2019-05-02 11:50:09 -07:00
Mike Ash
8d2b1bbf7b Merge pull request #24394 from mikeash/decode-the-undecodable
[Stdlib] Make the SwiftNativeNSXXXBase classes gracefully handle being decoded with NSKeyedUnarchiver.
2019-05-02 10:06:06 -04:00
Karoy Lorentey
1dbb4830c5 [CMake] Split overlay list to multiple lines 2019-05-01 18:53:52 -07:00