Commit Graph

10155 Commits

Author SHA1 Message Date
Stephen Canon
9e61aaefba Temporarily remove the global min(a,b) and max(a,b) SIMD functions. (#23960)
These are triggering a bad compile-time regression for some expressions; that's a bug that should be fixed, but we don't know how to fix it yet, so we'll need to remove these in the short-term, and possibly spell them differently in the medium term.
2019-04-12 16:30:32 +02:00
Andrew Trick
3571f583fc Add -disable-access-control to the SwiftOnoneSupport library build.
The purpose of this module is to prespecialize generic methods in the
stdlib. All symbols exposed by the ABI must be explicitly identified
to maintain ABI compatibility. Some of those ABI-exposed symbols
reference internal stdlib types.

Given that we want the prespecialized code to live in the separate
SwiftOnoneSupport library, and we want the module to explicitly list
all the symbols required for ABI stability, there's no way around
disabling access control when building it. In fact, that flag does
precisely what we want.

This should be harmless because
- no one imports SwiftOnoneSupport.swiftmodule
- these internal symbols were always being exposed in
SwiftOnoneSupport.dylib, so nothing changes there
2019-04-11 12:14:35 -07:00
Ross Bayer
a316fa9590 Merge pull request #23903 from Rostepher/shims-with-stdlib
[Build System: CMake] Install the Swift shims in the stdlib component.
2019-04-09 19:11:53 -07:00
Bob Wilson
207bf788f2 Merge pull request #23896 from bob-wilson/branchHint-followup
Move the legacy _branchHint function to LegacyABI.swift
2019-04-09 16:47:56 -07:00
Eric Bainville
1b6f1120e1 made enums RawRepresentable, added availability for all top-level declarations, cosmetic changes 2019-04-09 14:52:44 -07:00
Michael Ilseman
b39ead1774 Merge pull request #23863 from milseman/string_cleaning
[gardening] Clean up many String computed vars
2019-04-09 14:02:39 -07:00
Ross Bayer
1a31c3ad9c [Build System: CMake] Install the Swift shims in the stdlib component. 2019-04-09 13:00:26 -07:00
Bob Wilson
0cf186f25d Move the legacy _branchHint function to LegacyABI.swift 2019-04-09 11:44:35 -07:00
Stephen Canon
f4b2916de6 [SE-0251] Additions to SIMD types. (#23421)
* Additions to SIMD types.

- extension from 2 and 3-element vectors to 3- and 4-element vectors.
- the .one member
- swizzles via subscript-by-simd
- min/max/sum reductions
- min/max/clamp on vectors-of-comparable
- any and all

- Make permute subscript wrap on vector length, even for SIMD3 dictionaries. Also restore min/max to globals, rather than static functions.
2019-04-09 18:53:45 +02:00
Eric Bainville
4261de491d changes from vode review 2019-04-09 09:05:42 -07:00
Karoy Lorentey
582b65b993 Revert "[Foundation] Data: Hash the entire contents, not just an arbitrary subset"
This reverts commit b711ed9f90.
2019-04-08 18:48:52 -07:00
Karoy Lorentey
7f1dd3ef23 [Foundation] Fix bizarre indentation issues 2019-04-08 18:46:44 -07:00
Karoy Lorentey
2ab2431dbd [Foundation] URL is actually already Hashable
I’m not sure why I was so convinced it wasn’t, but this certainly simplifies things.
2019-04-08 18:30:16 -07:00
Michael Ilseman
f7cdda2720 [gardening] Clean up many String computed vars 2019-04-08 15:16:48 -07:00
Eric Bainville
dafba928a6 rename error states from code review 2019-04-08 13:22:44 -07:00
Eric Bainville
be2e93aa7a Merge branch 'master' into dev/DataProtocol-inputs 2019-04-08 09:15:21 -07:00
Saleem Abdulrasool
d845e7bdbf runtime: force unaligned start/stop markers
The sections to which the start/stop symbols are being applied do not
guarantee pointer alignment.  In particular, the field metadata is
aligned to a 4-byte boundary, which is less then the pointer alignment
of `uintptr_t`.  This results in extra padding in the data which is
going to cause the iteration to run off the end.  A similar byte
alignment is forced for the markers in the ELF case as well.  This fixes
one of the reflection tests on Windows where we were attempting to
decode the padding as an entry.
2019-04-07 12:12:13 -07:00
Karoy Lorentey
f859dd1316 [Foundation] URL: Fix availability of the new hash(into:) implementation 2019-04-05 19:25:27 -07:00
Karoy Lorentey
b711ed9f90 [Foundation] Data: Hash the entire contents, not just an arbitrary subset 2019-04-05 18:07:30 -07:00
Karoy Lorentey
6f40a4abf9 [Foundation] Measurement: Fix hashing 2019-04-05 18:07:30 -07:00
Karoy Lorentey
28e4688c05 [Foundation] PersonNameComponents: Modernize hashing 2019-04-05 18:07:30 -07:00
Karoy Lorentey
a23c3f36bd [Foundation] UUID: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
23cc71935b [Foundation] URLRequest: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
590f40770e [Foundation] URLComponents: Modernize hashing 2019-04-05 18:07:29 -07:00
Karoy Lorentey
10cb05ae6c [Foundation] URL: Add hash(into:) implementation
Note: URL does not implement Hashable.
2019-04-05 18:07:29 -07:00
Karoy Lorentey
b41eb97896 [Foundation] TimeZone: Modernize hashing 2019-04-05 18:07:29 -07:00
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
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
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
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