Commit Graph

12522 Commits

Author SHA1 Message Date
swift-ci
4dc763aa4b Merge pull request #23964 from atrick/fix-prespecialize 2019-04-16 16:57:57 -07:00
Max Moiseev
bd59b2220f Merge pull request #23860 from ebainville/dev/DataProtocol-inputs
DataProtocol inputs in Compression overlay
2019-04-16 16:11:29 -07:00
Gwen Mittertreiner
c79bb5b607 Provide inotify from glibc 2019-04-16 15:54:34 -07:00
swift-ci
fb29702abf Merge pull request #24056 from colemancda/windowsPosixError 2019-04-16 10:48:39 -07:00
Andrew Trick
d8a3b1eef5 Guard _ArrayBuffer with #if _runtime(_ObjC) 2019-04-16 10:14:22 -07:00
Alsey Coleman Miller
32fb4980e8 Compile POSIXError.swift for Windows 2019-04-16 02:06:45 -05:00
Alsey Coleman Miller
371b7ca764 Added POSIXErrorCode for Windows
https://docs.microsoft.com/en-us/cpp/c-runtime-library/errno-doserrno-sy
s-errlist-and-sys-nerr
2019-04-16 01:59:04 -05:00
Andrew Trick
700f81613b Rewrite SwiftOnoneSupport and add missing required prespecialization symbols.
In the prior revision, this file combined two approaches:

- the old approach of doing some fun things with arrays and hoping
  that any important public and internal generic symbols will happen
  to be specialized

- the new approach of explicitly specializing a generic symbol by
  annotating a dummy "proxy" function with the actual generic mangled
  name, then calling that proxy with an argument of the type to be
  specialized.

Unfortunately, the symbols exposed by SwiftOnoneSupport have become
ABI. Therefore, the old approach can break over time because changes
to the compiler and standard library will affect which symbols happen
to be specialized. It can be extremely difficult to debug why those
symbols have gone missing.

The new approach will work to ensure ABI stability, but the
implementation was incomplete and the style of implementation would
not work in many cases. It was still relying on the old approach to
cover the generic symbols that weren't explicitly specialized. Also,
it wasn't clear to anyone reading the source what specializations of
those generic symbols are intended and required by the ABI.

This commit completely removes the old approach to prespecialization.

All generic symbols required by the ABI are now explicitly listed.

There are now several different proxy functions declared as methods
within the generic type that they represent. The parameter types of
each proxy function now match the parameter types of the generic
function. This guarantees that the compiler can correctly apply the
proxy function's subsitution map to the generic function's generic
signature. For example, it now handles subtitution of dependent types
(like Range<T>), substitutions that are not in the first parameter
position, and subsitition that occur in multiple parameters.

The proxy functions are now directly invoked with the concrete
argument type needed for specialization. There's no other incidental
code.

It is now possible to read this source and understand which standard
library functions need to be prespecialized on which types.
2019-04-15 20:51:35 -07:00
Zhuowei Zhang
5cdb32f624 [stdlib] fix prototype declaration in RuntimeShims.h
_swift_stdlib_getHardwareConcurrency's declaration isn't a proper prototype:
it's missing `void` inside the brackets.

Found while compiling the stdlib to WebAssembly, which fails with:

Functions with 'no-prototype' attribute must take varargs: _swift_stdlib_getHardwareConcurrency

This shouldn't impact existing platforms.
2019-04-15 19:03:28 -07:00
swift-ci
388c21ac64 Merge pull request #24000 from Catfish-Man/thread-specific-doh 2019-04-15 18:08:06 -07:00
Saleem Abdulrasool
b6ca2fb786 Merge pull request #24028 from colemancda/posixErrorGlibc
[stdlib] Include POSIXError as part of Glibc
2019-04-15 17:05:12 -07:00
swift-ci
73edb17824 Merge pull request #23802 from Catfish-Man/transparently-false 2019-04-15 16:28:58 -07:00
David Smith
584fbfc245 Avoid the overhead of looking up the current CFAllocator in String bridging 2019-04-15 15:28:00 -07:00
Karoy Lorentey
e08b219448 Merge pull request #23683 from lorentey/casting-improvements
[stdlib] Fix Set/Dictionary casting issues
2019-04-15 10:56:38 -07:00
David Smith
7db8cb1ea3 SR-10294: convertBoolToDarwinBool and friends should be inlined 2019-04-15 09:00:29 -07:00
simon gladman
f454132641 Add pseudo code to inverted clip description. 2019-04-15 13:25:50 +01:00
Alsey Coleman Miller
787bc36f6d [stdlib] Include POSIXError as part of Glibc 2019-04-14 17:03:06 -05:00
Yigitcan Yurtsever
68c00792df Fix doc typo on yearForWeekOfYear case in DateComponents 2019-04-12 18:58:52 -07:00
Karoy Lorentey
13bc567085 [Foundation] Notification: Add note on == not being reflexive and stabilize hashing
The `ObjectIdentifier(object as AnyObject)` is not necessarily stable; this breaks reflexivity for ==, and it makes the hash encoding nondeterministic.
2019-04-12 15:26:40 -07:00
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
Ross Bayer
ecd3af833d Merge pull request #23898 from Rostepher/layouts-install-with-compiler
[Build System: CMake] Install the layouts-*.yaml files in the compiler component.
2019-04-09 19:11:41 -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
Ross Bayer
d1f4ddc1b3 [Build System: CMake] Install the layouts-*.yaml files in the compiler component. 2019-04-09 11:55:58 -07:00
Bob Wilson
0cf186f25d Move the legacy _branchHint function to LegacyABI.swift 2019-04-09 11:44:35 -07:00
swift-ci
5a2e73f7c8 Merge pull request #23890 from compnerd/let-a-var 2019-04-09 10:17:48 -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
Saleem Abdulrasool
70b6bdae0d StdlibUnittest: make a var a let (NFC)
Silences a suggestion from the compiler to convert a value which is not
mutated into a `let` binding rather than a `var` binding.
2019-04-09 08:50:23 -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
Mishal Shah
c4626baf88 Un-set CMAKE_C_COMPILER_LAUNCHER and CMAKE_CXX_COMPILER_LAUNCHER in s… (#23806)
[CMake] Add check for distcc before setting CMAKE_C_COMPILER_LAUNCHER and CMAKE_CXX_COMPILER_LAUNCHER
2019-04-08 12:53:35 -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