Commit Graph

12522 Commits

Author SHA1 Message Date
swift-ci
93d6eb9478 Merge pull request #21442 from compnerd/module-map 2018-12-19 14:57:52 -08:00
Karoy Lorentey
624135641d Merge pull request #21057 from lorentey/actually-deprecate-hashValue
[Sema] Emit a deprecation warning if a Hashable type only implements hashValue
2018-12-19 22:47:16 +00:00
Saleem Abdulrasool
f8b41740e5 core: remove unsupported architecture conditional
AArch64 ILP32 support has not yet been integrated into the frontend.
Remove the conditional compilation for the target.
2018-12-19 13:56:18 -08:00
Michael Ilseman
5a6d2dfa59 [String] Switch ABI to only use 4 discriminator bits.
In anticipation of potential future HW features, e.g. armv8.5 memory
tagging, only use the high 4 bytes as discriminator bits in
_BridgeObject rather than the top 8 bits. Utilize two perf flags to
cover this instead. This requires shifting around a fair amount of
internal complexity.
2018-12-19 13:54:50 -08:00
Saleem Abdulrasool
0bdf536c8a Platform: improve WinSDK coverage further
Additional APISets are required to implement the Foundation API surface.
Expand the module to include that.  Unfortunately, I have not been able
to get the ImageHelp or the DebugHelp APIs or the RTLSupport APISet
covered under the module.  Those are required to get stack captures to
work.
2018-12-19 13:53:15 -08:00
Michael Ilseman
5d67236bc0 [String] Refactor 32-bit StringObject.
Remove Discriminator, Flags, etc., abstractions from
StringObject. These cause code divergence between 32-bit and 64-bit
ABI, complicate ABI changes, and otherwise contribute to bloat.
2018-12-19 11:19:08 -08:00
Max Moiseev
ab87c708f2 Merge pull request #21337 from moiseev/atomic-int-reshuffle
[stdlib] tee _stdlib_AtomicInt > SwiftPrivate
2018-12-19 10:00:39 -08:00
Max Moiseev
f370c676c0 Merge pull request #20962 from compnerd/libc-extras
PrivateLibcExtras: Port to Windows
2018-12-19 10:00:15 -08:00
Maxim Moiseev
165fe328c3 [stdlib] tee _stdlib_AtomicInt > SwiftPrivate
Turns out some people used this type despite it being prefixed with
`_stdlib_`, so we have to keep it, with an obsoletion message this time.
Second copy of the same type is kept available past Swift 5 in
SwiftPrivate for use in tests.
2018-12-18 16:12:47 -08:00
Saleem Abdulrasool
e86c1714a2 stdlib: extend WinSDK module for Foundation
When building foundation, we end up including the interlocked module
through CoreFoundation.  Extend the modulemap for this.
2018-12-18 15:17:17 -08:00
Karoy Lorentey
9d61bad1e5 [stdlib] Keep the first duplicate key instead of the last 2018-12-18 09:49:58 -08:00
Karoy Lorentey
f862ad3741 [stdlib] Doc updates 2018-12-18 09:49:58 -08:00
Karoy Lorentey
f0e04f73f4 [stdlib] Process elements from back to front 2018-12-18 09:49:58 -08:00
Karoy Lorentey
039891c24b [stdlib] Dictionary: Add support for non-unique keys in bulk loading init 2018-12-18 09:49:58 -08:00
Karoy Lorentey
f1f5e0f2bf [stdlib] Dictionary: Add unsafe bulk-loading initializer
Interface inspired by this Array pitch:
https://forums.swift.org/t/array-initializer-with-access-to-uninitialized-buffer/13689
2018-12-18 09:49:58 -08:00
Nate Cook
646849ee64 Doc fix
Co-Authored-By: lorentey <klorentey@apple.com>
2018-12-18 17:27:08 +00:00
Doug Gregor
9af6623386 Merge pull request #21379 from DougGregor/there-and-back-again-a-simd-operator-tale
Move SIMD operators back into the Swift standard library
2018-12-17 13:53:55 -08:00
Saleem Abdulrasool
1ff7823d9b Merge pull request #21369 from compnerd/winsdk
platform: widen winsdk modulemap
2018-12-17 11:09:59 -08:00
Doug Gregor
ad17e8a3ab [SIMD] Delete unnecessary comment on debugDescription.
It maakes documentation works by overriding the default.
2018-12-17 11:08:46 -08:00
Doug Gregor
69c9fbc3c8 Move SIMD operators back into the Swift standard library
Moving them out to SIMDOperators didn't help, but the type checker hack
might. Move them back into the Swift standard library where they belong,
but leave SIMDOperators there to smooth over any short-term
incompatibilities.
2018-12-17 11:07:32 -08:00
Saleem Abdulrasool
39f2ac98b7 SwiftPrivate: fix dependencies on Windows
This module needs MSVCRT and WinSDK on Windows.  Track the dependencies.
2018-12-16 22:26:44 -08:00
Saleem Abdulrasool
d70911e1ff SwiftPrivateLibcExtras: port to Windows
Enable the libc extras to be built for Windows.  This is a dependency
for StdlibUnittests.
2018-12-16 22:11:07 -08:00
Saleem Abdulrasool
df5712d1fd platform: widen winsdk modulemap
Add NamedPipe API Set for LibcExtras.
2018-12-16 22:11:07 -08:00
Saleem Abdulrasool
e918218b4c stdlib: make CommandLine inspection work
This implements commandline access on Windows by using the Windows Shell
API to access the commandline information and making it available in
Swift.  This is needed for the correct invocation of the child process
in the unit tests.
2018-12-16 14:04:38 -08:00
swift-ci
b9a1ad28bb Merge pull request #21353 from compnerd/_setjmp 2018-12-15 11:59:04 -08:00
Saleem Abdulrasool
df1bcb76e4 test: add ClangImporter test for _setjmp APINote
This ensures that we do not allow someone to import `_setjmp` on Windows
which is not annotated with `__attribute__((__returns_twice__))` and
cannot be adjusted without assistance from Microsoft.
2018-12-15 09:24:01 -08:00
Doug Gregor
34113d1f86 Merge pull request #21339 from DougGregor/simd-custom-string-convertible
[SIMD] Add CustomDebugStringConvertible conformance for SIMD types.
2018-12-14 20:43:36 -08:00
Luciano Almeida
2bc5623bdf [stdlib] Resolving some FIXME comments on Set type. (#20631)
* Fixing some fixmes on stdlib Set

* Adding @inline attr

* Fixing spaces

* Adding isEmpty as fast path in other places where is possible.

* Quotes on variable name on comment.

* Update stdlib/public/core/Set.swift

Co-Authored-By: LucianoPAlmeida <passos.luciano@outlook.com>

* Adding benchmark for isDisjoint Set method

* Adding empty sets to benchmark

* Fixing the factor on benchmarks and naming warnings for empty 5 words
2018-12-14 22:11:12 -06:00
swift-ci
8ea5a86dcb Merge pull request #21335 from adrian-prantl/42300829 2018-12-14 18:35:14 -08:00
Doug Gregor
fbf4bb738d [SIMD] Add CustomDebugStringConvertible conformance for SIMD types.
The old SIMD types had a conformance to CustomDebugStringConvertible,
but the new ones do not, causing a source compatibility
regression. Add back a CustomDebugStringConvertible conformance.

Fixes rdar://problem/46746829.
2018-12-14 17:00:17 -08:00
Adrian Prantl
a100d3efb4 Add a comment about keeping the runtime and LLDB in sync.
rdar://problem/42300829
2018-12-14 16:00:09 -08:00
Saleem Abdulrasool
3225e36d63 stdlib: reorder add_subdirectory to repair the Windows build
Due to the horrible attrocities against software of the attempt to perform
cross-compilation in the swift build system, we need to emulate the linking
behaviour for Windows with the link against the import library.  The emulation
requires the custom creation of import library targets.  In order to actually
get the linking semantics correct, the dependendency targets must be created
prior to use (unlike standard CMake).  The reordering ensures that we get
correct linkage when building for Windows.

Perform a simple optimization to avoid a number of string comparisions for the
host system.
2018-12-14 13:56:16 -08:00
eeckstein
18e190542f Merge pull request #21306 from eeckstein/dictionary-code-size
stdlib: Code size improvements for Dictionary for -Osize
2018-12-14 10:05:43 -08:00
Saleem Abdulrasool
ca0a622e54 Merge pull request #21293 from compnerd/msvcrt-fileio
Platform: make MSVCRT more Unix-libc like
2018-12-13 23:37:35 -08:00
Erik Eckstein
aae60ff271 stdlib: Code size improvements for Dictionary for -Osize
The first change is to remove some @inline(__always) attributes. Those were added before we had the guaranteed-by-default calling convention. They are not necessary anymore.

The second change is to not specialize some slow-path functions. This results that no specialization code for these functions is generated at the client side. Instead those functions are directly called in the libSwiftCore.
Note that Key-related hash and equality comparisons are still specialized, because otherwise the performance hit for Osize would be too big.

Some Dictionary benchmarks regress a bit with -Osize, but the code size wins are big.

rdar://problem/46534453
2018-12-13 16:59:19 -08:00
Saleem Abdulrasool
04a5d84575 Platform: make MSVCRT more Unix-libc like
Since `stdin`, `stdout`, and `stderr` are defined via macros, we cannot see them
on the swift side.  Replicate these by hand.  Expose `STDIN_FILENO`,
`STDOUT_FILENO`, and `STDERR_FILENO` for compatibility with other libc
implementations.  This reduces the need for changing the codebase unnecessarily
for MSVCRT.
2018-12-13 16:01:42 -08:00
Philippe Hausler
9e9a791e94 Revert "[Foundation] Fallback to presuming 32-bit platforms if we dont explicitly know that it is 64 bit; this allows for better portability (#21290)"
This reverts commit 77c7a69ae2.
2018-12-13 15:19:57 -08:00
Doug Gregor
cacd72f18c [Runtime] Properly unique foreign witness tables.
The Name field of a type descriptor is not the appropriate
way to compare types for uniquing. Instead, use TypeContextIdentity.

Fixes rdar://problem/46685973.
2018-12-13 13:43:36 -08:00
Lily Vulcano
d5f5ba6402 Merge pull request #21297 from millenomi/fix-crash-init-cocoaDictionary
Build crash fix: AnyObject -> NSDictionary
2018-12-13 13:25:15 -08:00
Philippe Hausler
77c7a69ae2 [Foundation] Fallback to presuming 32-bit platforms if we dont explicitly know that it is 64 bit; this allows for better portability (#21290) 2018-12-13 12:39:52 -08:00
Max Moiseev
bdc68189bf Merge pull request #21265 from moiseev/scenekit-switch-default
Use @unknown default in a switch over SCNGeometryPrimitiveType
2018-12-13 11:53:37 -08:00
Lily Vulcano
d57f714a29 Build crash fix: AnyObject -> NSDictionary
As seen in swift crashers while building https://github.com/apple/swift/pull/20103
2018-12-13 11:03:43 -08:00
Itai Ferber
d4e42c0dd1 Merge pull request #20225 from phausler/inline_data_and_dataprotocol
DataProtocol and new inline Data
2018-12-12 16:10:13 -08:00
Max Moiseev
83ccb23c97 Merge pull request #20958 from jshier/add-result
SE-0235: Add Result<Success, Failure: Error> to Standard Library
2018-12-12 14:00:15 -08:00
Maxim Moiseev
7e211c6615 Use @unknown default in a switch over SCNGeometryPrimitiveType
<rdar://problem/39029889>
2018-12-12 13:51:50 -08:00
Mike Ash
115922304e Merge pull request #21038 from sarveshtamba/master
Change 'isValidPointerForNativeRetain' check for PowerPC(ppc64le)
2018-12-12 14:03:34 -05:00
swift-ci
93023eb3c1 Merge pull request #21250 from rjmccall/revert-memory-tagging-future-proofing 2018-12-12 09:57:57 -08:00
John McCall
190943ea05 Revert "Future-proof the ARM64 ABI by not reserving the entire top byte."
This reverts commit d44851304b.
This patch does not work with our current assumptions about BridgeObject.
2018-12-12 12:01:22 -05:00
Ben Cohen
929539b4ab Merge branch 'master' into remove-strideable-closed-range-operator 2018-12-12 08:03:50 -08:00
John McCall
570840f670 Merge pull request #21204 from rjmccall/remove-xi-witnesses
Remove the extra-inhabitant value witness functions
2018-12-12 01:46:00 -05:00