Commit Graph

12522 Commits

Author SHA1 Message Date
Karoy Lorentey
afa253961b [Foundation] NSRange: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
4bdc458c52 [Foundation] Notification: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
5e451e6d8f [Foundation] IndexPath: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
2d5520e80d [Foundation] IndexSet: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
9c46858d05 [Foundation] Locale: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
a0004226b1 [Foundation] Decimal: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
c1049e7b79 [Foundation] DateInterval: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
73be6b8335 [Foundation] DateComponents: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
741122ae65 [Foundation] Date: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
8b7adb35d3 [Foundation] AffineTransform: modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
0867f7e17f [Foundation] String.Encoding: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
81567ed85e [Foundation] CharacterSet: Modernize hashing 2019-04-05 18:07:26 -07:00
Karoy Lorentey
73ad830e40 [Foundation] Calendar: Modernize hashing 2019-04-05 18:07:21 -07:00
ravikandhadai
6317b17188 Merge pull request #23437 from ravikandhadai/loggingAPI-PR
[os_log][stdlib-private] Add tests for checking the correctness of buffer and format string construction in the new OS log APIs.
2019-04-05 16:29:51 -07:00
Karoy Lorentey
569e380337 [Foundation] NSRange: Add an explicit definition for hash(into:)
This replaces the compiler-generated variant (based on hashValue) with a better implementation.
2019-04-05 15:21:24 -07:00
Karoy Lorentey
46225d728a [Foundation] IndexPath: Add explicit hash(into:) definition, hashing *all* components
The new definition diverges from the existing hashValue: it feeds all path components to the hasher, rather than just a limited subset.

Hashing all the bits that are compared in == is necessary to ensure proper operation of the hash table.
2019-04-05 15:21:24 -07:00
Karoy Lorentey
68e64492ce [StdlibUnittest] checkHashable: Add opt-in support for incomplete hashes 2019-04-05 15:21:24 -07:00
Stephen Canon
c5e3f85378 Revert SE-0246 (#23800)
* Revert "Merge pull request #23791 from compnerd/you-know-nothing-clang"

This reverts commit 5150981150, reversing
changes made to 8fc305c03e.

* Revert "Merge pull request #23780 from compnerd/math-is-terrible"

This reverts commit 2d7fedd25f, reversing
changes made to 0205150b8f.

* Revert "Merge pull request #23140 from stephentyrone/mafs"

This reverts commit 777750dc51, reversing
changes made to 0c8920e747.
2019-04-04 19:35:25 -04:00
Karoy Lorentey
668c1f0c6f [test] StdlibUnittest: Cosmetic changes to checkEquatable/checkHashable 2019-04-04 13:56:29 -07:00
Philippe Hausler
02c55f372c Avoid O(n) copies when bridgable NSData objects are available 2019-04-04 09:33:17 -07:00
Saleem Abdulrasool
c697ddd42e Shims: include math.h on Windows
Since we use `_hypotf` on Windows rather than `__builtin_hyptof` due to
a bug in LLVM with the TLI lowering to the wrong builtin, include the
math header to get the proper declaration.
2019-04-04 09:29:58 -07:00
Saleem Abdulrasool
2d7fedd25f Merge pull request #23780 from compnerd/math-is-terrible
Shims: use `_hypotf` on Windows rather than `__builtin_hypot`
2019-04-04 07:44:59 -07:00
Michael Ilseman
3b99358592 Merge pull request #23051 from milseman/textual_contiguity
[SE-0247] Add contiguous string APIs
2019-04-03 19:50:23 -07:00
Saleem Abdulrasool
af6d9e3fc3 Shims: use _hypotf on Windows rather than __builtin_hypot
Unfortunately, `hypotf` is an inline in MSVCRT which forwards to
`_hypotf`.  This repairs the Windows build.
2019-04-03 16:11:42 -07:00
Eric Bainville
b1d4d40516 take DataProtocol as input; simplified errors; fixed availability 2019-04-03 15:20:40 -07:00
Ted Kremenek
777750dc51 Merge pull request #23140 from stephentyrone/mafs
Math functions for Swift
2019-04-03 14:53:16 -07:00
Steve (Numerics) Canon
bcc7e2c901 Obscene rant about linters. 2019-04-03 15:15:28 -04:00
Karoy Lorentey
3c74c0f1cb [stdlib] Change the signature of Dictionary’s bulk initializer (#23758)
The initializer was originally introduced without proper availability; in https://github.com/apple/swift/pull/23643, we fixed this by applying the `@_alwaysEmitIntoClient` attribute. However, this had the unfortunate side-effect that the symbol disappeared from `libswiftCore.dylib`, which somehow confuses some simulator builds.

Try to figure out what’s happening by replacing the third closure argument with an integer return value. This changes the mangled name of the bulk initializer, which should make it more obvious how/why these builds fail.

rdar://problem/49479386
2019-04-03 10:51:36 -07:00
simon gladman
4721423535 Added floatToDouble and doubleToFloat 2019-04-03 13:49:58 +01:00
simon gladman
a0f504b821 Add conversion operations that return the result. 2019-04-03 11:37:33 +01:00
Michael Ilseman
aab8063267 [SE-0247] Add contiguous string APIs
Adds API for querying, enforcing, and using contiguous strings.
2019-04-02 20:30:02 -07:00
Ravi Kandhadai
2f2afd034d [os_log][stdlib-private] Add tests for checking the correctness of
buffer and format string construction in the new OS log APIs.
2019-04-02 17:31:40 -07:00
Karoy Lorentey
ea6ae67a9f [stlib] _NativeSet: Revert spurious change 2019-04-02 16:38:01 -07:00
Steve (Numerics) Canon
3fda509805 Implementation of ElementaryFunctions / Real protocols.
This commit implements SE-0246, by adding conformance to Real to the Float, CGFloat, Double, and Float80 types, implemented either in terms of the system's C math library, existing standard library functionality, or LLVM intrinsics. It includes basic test coverage for these new functions, and deprecates and obsoletes *some* existing functionality in the Platform overlay. We still need to make a decision about how to handle the remaining "tgmath" functions, because obsoleting them is technically a source-breaking change (if users have unqualified names like "exp(1)", it's fine, but it would break users who have used qualified names like "Darwin.exp(1)".)
2019-04-02 18:49:31 -04:00
Steve (Numerics) Canon
2f7435da7d First non-intrinsic functions. 2019-04-02 18:48:08 -04:00
Steve (Numerics) Canon
b8d1481fc6 WOW\! 100% less gratuitous type machinery at runtime\! 2019-04-02 18:48:08 -04:00
Steve (Numerics) Canon
5e5cd76e8d Work in progress towards "Mathsable"
Fundamental decision to be made; should implementation hooks present like `Float.exp(_ x: Float) -> Float` or like `Float.Maths.exp(_ x: Float) -> Float`? Having the intermediate namespace to group them as in the second is definitely nicer, but it requires a little bit of extra machinery, and much more importantly, there doesn't seem to be any way to make access to the static `Maths` associatedtype transparent.
2019-04-02 18:48:08 -04:00
Karoy Lorentey
1ddf99a9da [stdlib] Set, Dictionary: Unify casting operations 2019-04-02 13:10:55 -07:00
simon gladman
df1ed6a879 Merge branch 'master' into accelerate-vDSP-conversion 2019-04-02 17:32:15 +01:00
simon gladman
4cfbaa90b8 Add conversion functions that return the result. 2019-04-02 17:29:26 +01:00
Michael Ilseman
ff39c345fd Merge pull request #22869 from milseman/gab_barg
[SE-0248] String Gaps
2019-04-02 09:28:34 -07:00
simon gladman
1a66a0f00f Merge branch 'master' into accelerate-vDSP-miscConversions 2019-04-02 16:19:30 +01:00
simon gladman
0606fdd98b Create versions of window and ramp generation operations that return a result. 2019-04-02 16:13:01 +01:00
Stephen Canon
60fc39e72a Improve codegen for init(signOf: magnitudeOf:) (#23727)
This can map straight to the LLVM copysign intrinsic for builtin types, which both gets us better codgen and lets the compiler plug this operation into other LLVM-level optimizations.
2019-04-02 09:49:18 -04:00
simon gladman
fb9fa8dea3 Merge branch 'master' into accelerate-vDSP-fillClearGenerate 2019-04-02 10:07:52 +01:00
Hiroki Nagasawa
f85ca6c01a Remove redundant space in first(where:) of Sequence (#23365) 2019-04-01 10:56:16 -05:00
simon gladman
d84b0652fb Merge branch 'master' into accelerate-vDSP-complexOperations 2019-04-01 15:30:40 +01:00
simon gladman
9f752aa0d9 Add versions of operations that return the result. 2019-04-01 14:31:05 +01:00
simon gladman
fd42237e45 Merge branch 'master' into accelerate-vDSP-elementwiseVectorArithmetic 2019-04-01 10:58:18 +01:00
Saleem Abdulrasool
19cd786ca6 platform: correct case for WinSDK module (NFC)
This adjusts the case so that it can build on case sensitive file
systems (e.g. ext4).
2019-03-31 13:07:42 -07:00