Commit Graph

12522 Commits

Author SHA1 Message Date
Slava Pestov
9ceb3faee9 Runtime: Add support for Objective-C resilient class stubs
This adds a new tail-allocated field to class context descriptors storing
a pointer to an Objective-C class stub.

When the stub is present, we use the new _objc_realizeClassFromSwift()
entry point to realize the class instead of calling objc_readClassPair().

This should attach categories to the realized class, if they were emitted
to reference the stub.
2019-03-26 18:42:59 -04:00
eeckstein
ba5e3448b5 Merge pull request #23518 from eeckstein/onone-support-abi
Stabilize the ABI of libswiftSwiftOnoneSupport
2019-03-26 11:18:04 -07:00
swift-ci
07a29d5ff7 Merge pull request #23515 from Luigi123/refactor-url 2019-03-26 10:53:39 -07:00
Stephen Canon
fbd1d4cecc Use the blessed (repeating: Scalar) init instead of (Scalar) in simd. (#23534) 2019-03-25 20:32:16 -04:00
Erik Eckstein
00599eeb3c Check for completeness of the SwiftOnoneSupport library
When compiling SwiftOnoneSupport, issue errors for missing functions which are expected in the module.
This ensures ABI compatibility.

rdar://problem/48924409
2019-03-25 14:57:03 -07:00
Erik Eckstein
218cc9b187 Add some pre-specializations for internal stdlib functions in SwiftOnoneSupport
It's very unlikely that those functions are really referenced by Onone executables, but we want to be ABI compatible.
Also, there is no guarantee that this version of SwiftOnoneSupport will always trigger all symbol to be pre-specialized.
If the optimizer changes, we might need to add other explicit pre-specializations of internal stdlib symbols.

rdar://problem/48924409
2019-03-25 14:57:03 -07:00
Nate Cook
b6bb9d2f8c [stdlib] Make unsafe array initializer public (#23134)
[stdlib] Make unsafe array initializer public

This implements SE-0245. The public versions of this initializer call
into the existing, underscored version, which avoids the need for
availability constraints.
2019-03-23 13:18:10 -05:00
Luigi
174d019111 Refactor if statements in URL.swift
I refactored some of the if statements in URL.swift to be guard instead.
This made the code shorter and easier to read.
This mirrors my commit on swift-corelibs-foundation (PR #2034)
2019-03-23 18:07:24 +09:00
Stephen Canon
1a9ae47d06 Teach the importer to import any clang vector type as SIMDn<Scalar>. (#23454)
* Teach the importer to import any vector type as SIMDN<Scalar>.

Instead of having a known set of vector types, check to see if the
element type conforms to SIMDScalar; if it does, see if we have a
SIMDN defined with the right number of elements. If both are satisfied,
import the vector type as that Swift type.

By making this change, we gain the ability to import vector types
that aren't defined in terms of the Darwin simd module, which lets
us use C API with vector types on other platforms. It also lets us
import *every* vector type that Swift can represent, rather than the
small subset that are currently hardcoded.

* Increased test coverage for increased SIMD types that we can import.

Includes some minor cleanup from review. Also eliminates the old
simd_sans_simd test, since we can now import all of these types even when the simd module isn't imported.
2019-03-22 22:11:22 -04:00
Thomas Roughton
e0c9a6e17c SIMD Overlay: inline deprecated methods (#23250)
On Swift 5, using the deprecated `SIMD.init(_ scalar: Scalar)` initialiser rather than `SIMD.init(repeating scalar: Scalar)` will cause the type to fail to be specialised, resulting in performance degradation. Mark this method and `static prefix func -` as `@_transparent` to ensure they are correctly specialised.
2019-03-22 16:19:53 -04:00
Mike Ash
998b833f65 Make sure magic-symbols-for-install-name.c is above GYB_SOURCES in all files. 2019-03-22 10:04:40 -04:00
Doug Gregor
2aea63710e Rewrite install_name for macOS 10.14 only with the Xcode default toolchain.
The install_name trick we are using to make sure that an application
built with a deployment target new enough to *guarantee* that Swift
will be available in the OS (and therefore don't need dylibs bundled)
link directly to /usr/lib/swift/*.dylib, but rewrites the the library
paths to be rpath-relative for older OS's (e.g.,
@rpath/lib/swift/libswiftCore.dylib) doesn't work for sub-minor
version numbers, e.g., the tools can't distinguish between 10.14.4 and
10.14. Therefore, macOS 10.14 is both an "older OS" and a "newer OS".

Hack around the primary problem caused by this---the inability of
first-party Swift programs to launch on macOS 10.14.4---by treating
macOS 10.14 as an "older OS" when building for the Xcode toolchain
(which is used by anyone who will deploy back to an older OS, e.g.,
3rd party applications) but treat it as a "newer OS" when building for
the OS toolchains (which is used when building the OS itself).

Fixes rdar://problem/47007519.
2019-03-22 10:04:40 -04:00
Mike Ash
4fb99998ae [Build] Use magic linker symbols to specify an @rpath-relative install name when targeting pre-stable-ABI OSes.
Magic symbols of the form $ld$install_name$os9.0$@rpath/libswiftCore.dylib tell the linker to use that install name when targeting that OS version. Use these symbols to specify an @rpath install name for all back-deployment libraries when targeting watchOS 2.0-5.1, iOS 7.0-12.1, and macOS 10.9-10.14.

rdar://problem/45027809
2019-03-22 10:04:39 -04:00
Saleem Abdulrasool
3192eb3221 Merge pull request #22208 from linux-on-ibm-z/s390x-storetag-fix
Fix storeEnumTagSinglePayload on big-endian systems
2019-03-21 14:18:12 -07:00
Saleem Abdulrasool
65d4199c7b Merge pull request #23400 from drodriguez/remove-incorrect-docs
[stdlib] Remove documentation piece that it is not longer true.
2019-03-21 09:30:34 -07:00
simon gladman
3a5934d7c5 Rename pointers for vDSP_vsub and vDSP_vsubD to match vDSP function parameter names. 2019-03-21 09:59:13 +00:00
Michael Gottesman
384882d5f3 Merge pull request #23201 from compnerd/patience-is-not-always-a-virtue
build: introduce and switch to GYB_SOURCES
2019-03-20 13:27:32 -07:00
Stephen Canon
60e86b9361 Some cleanup of SIMDVector and SIMDVectorTypes source files. (#23389)
Bring formatting closer in line with the rest of the standard lib, remove "public" from extensions (moving it onto the contents defined therein). Restore Swift project headers that were apparently lost at some point.
2019-03-19 12:44:35 -04:00
simon gladman
f62897ae67 Remove by and from parameter names for divide and subtract operations and fix subtract operation parameter order. 2019-03-19 13:37:04 +00:00
Kyle Murray
cf5bcabd6e Merge pull request #23406 from krilnon/master
[stdlib] Fix a misspelling in a Dictionary doc comment.
2019-03-18 21:35:56 -07:00
Saleem Abdulrasool
7d252cbd75 Merge pull request #23387 from compnerd/i-open-at-the-close
SwiftPrivate: add `isClosed` property
2019-03-18 17:09:27 -07:00
Bob Wilson
ba75030590 Merge pull request #23375 from bob-wilson/llvm-r355981
Stop using the _branchHint function
2019-03-18 16:55:15 -07:00
Kyle Murray
7eab74c066 [stdlib] Fix a misspelling in a Dictionary doc comment.
Fixes rdar://problem/48759246.
2019-03-18 15:34:50 -07:00
Daniel Rodríguez Troitiño
59c669936d [stdlib] Remove documentation piece that it is not longer true.
Since a4e9109 (#17396), both the hashes and the equality of numeric
types inside of AnyHashable do not follow the rules that this part of
the comment was talking about.

I couldn't find an easy example that shows the same behaviour, so I
decided to remove the comment completely.
2019-03-18 14:10:50 -07:00
simon gladman
990a408794 Swift overlays to vDSP_vswsum and vDSP_vswsumD for sliding
window summation over single- and double-precision vectors.
2019-03-18 17:34:08 +00:00
simon gladman
d8e73fc99d Remove unnecessary prefixes to tuple parameters. 2019-03-18 16:21:32 +00:00
Saleem Abdulrasool
46bb45a51a SwiftPrivate: add isClosed property
Since the `_FDOutputStream` type does not conform to a protocol, the
required interface was missed.  The changes in
fbce6e7873 introduced a use of the
`isClosed` property which broke the Windows build.  This should fix the
windows build.
2019-03-18 08:05:26 -07:00
simon gladman
034a33adde Add missing operations: vDSP_zvabs and vDSP_zvmags. 2019-03-18 12:51:22 +00:00
simon gladman
781f163149 Better naming for tuple parameters. 2019-03-18 10:49:11 +00:00
simon gladman
9b833319b0 * Remove parameter labels from commutative operations.
* Fix parameter / operation naming mismatch.
2019-03-18 10:16:07 +00:00
Harlan Haskins
e8d474aa11 Merge pull request #23343 from harlanhaskins/mangled-lassi
[Demangle] Check for old-style mangling in getObjCClassByMangledName
2019-03-17 22:24:34 -07:00
Bob Wilson
ef1d9bc7f8 Stop using the _branchHint function
LLVM r355981 changed various intrinsic functions, including expect,
to require immediate arguments. Swift's _branchHint function has an
expected value that is passed in as an argument, so that it cannot
use LLVM's expect intrinsic. The good news is that _branchHint is only
ever used with immediate arguments, so we can just move the intrinsic
into _fastPath and _slowPath and use those instead of _branchHint.

As was noted in the documentation, the _fastPath and _slowPath names are
confusing but we have passed the point where we can simply rename them.
We could add new names but would still need to keep the old ones around
for binary compatibility, and it is not clear that it is worth the
trouble. I have removed that note from the documentation.
2019-03-17 22:13:51 -07:00
Harlan Haskins
fbce6e7873 [StdlibUnittest] Allow tests to require a new process
When testing runtime lookup changes, we want to make sure each test runs in isolation. Add a new modifier, `.requireOwnProcess()`, to enable tests to guarantee they’re run in isolation.
2019-03-17 17:29:36 -07:00
Simon Gladman
8f9c475939 Swift Overlays to vDSP Linear Interpolation Operations 2019-03-17 07:24:20 +00:00
Simon Gladman
171f6e27de vDSP Swift Overlays to Complex Vector Operations
Swift overlays for calculating phase, copying, conjugating, and general arithmetic against `DSPSplitComplex`.
2019-03-17 06:30:16 +00:00
swift-ci
cf632b903d Merge pull request #23342 from compnerd/who-has-the-time 2019-03-16 21:18:52 -07:00
Saleem Abdulrasool
59fb469ae9 SwiftOnoneSupport: create the import library always
This needs to be added to the release mode builds as well which stopped
generating exported interfaces.
2019-03-16 19:34:35 -07:00
Harlan Haskins
76dd00beb6 [Demangle] Check for old-style mangling in getObjCClassByMangledName
This caused an issue where the runtime was unable to find subclasses of
resilient subclasses of NSObject until they were first registered by their
sugared name with NSClassFromString or were instantiated directly.

rdar://48892003
2019-03-15 19:03:39 -07:00
Saleem Abdulrasool
4473b7464c WinSDK: add convenience conversions for FILETIME/time_t
This conversion is error prone and pretty common.  Provide a helper
initializer and conversion through a getter.
2019-03-15 16:16:56 -07:00
swift-ci
497e94e89d Merge pull request #23235 from mikeash/remove-stable-abi-bit-configuration 2019-03-15 15:31:58 -07:00
swift-ci
6e7202e0f6 Merge pull request #23174 from lorentey/tacoma-narrows 2019-03-15 14:48:33 -07:00
Karoy Lorentey
300595eed4 [Foundation] Collapse as AnyObject as! Foo cast sequences 2019-03-15 13:26:58 -07:00
swift-ci
80657a2675 Merge pull request #22914 from ravikandhadai/loggingAPI-PR 2019-03-14 19:10:53 -07:00
Karoy Lorentey
1162ed6cba [runtime] Report an error for casting failure in _bridgeNonVerbatimFromObjectiveC 2019-03-14 18:20:41 -07:00
Ravi Kandhadai
592bca7202 [oslog] [stdlib-private] Add a prototype of the new os_log swift APIs
that accept string interpolations.

The prototypes are added to stdlib/private directory and will be
used only in tests and in experimental code.
2019-03-14 15:26:21 -07:00
iliaskarim
c8cfb2d6eb Update FixedArray.swift.gyb
Fix typo
2019-03-14 14:40:35 -04:00
simon gladman
0ab30574eb vDSP Swift Overlays to Vector-Vector Extrema and Single-Vector Operations
A suite of Swift overlays to vDSP operations for vector-vector extrema, absolute and negation, in-place reversing and sorting, and single-vector arithmetic.
2019-03-14 16:41:27 +00:00
eeckstein
ece36345b9 Merge pull request #23249 from eeckstein/runtime-malloc-removal2
Avoid malloc allocations in the runtime, part 2
2019-03-14 08:47:41 -07:00
simon gladman
6fad0cf948 Code review changes - better parameter naming for downsample, and rename differenceEquation to twoPoleTwoZeroFilter. 2019-03-14 14:13:24 +00:00
simon gladman
e6e3d424f2 Swift overlays to Accelerate.vDSP 1D and 2D convolution operations. 2019-03-14 13:45:18 +00:00