Commit Graph

13406 Commits

Author SHA1 Message Date
moatom
2e95a0d265 Fix include guards 2019-06-02 12:10:43 +09:00
Slava Pestov
ec4c597156 stdlib: ManagedBuffer.init(_doNotCallMe:) was ABI in Swift 5 and should be @usableFromInline 2019-06-01 00:08:05 -04:00
Karoy Lorentey
fb55fc3be8 [redux][Foundation] Fix availability of NSValue.value(of:) (#25179)
* [Foundation] Fix availability of NSValue.value(of:)

(cherry picked from commit fbe5563d60)

* [Foundation] NSValue.value(of:): Reinstate runtime OS version check
2019-05-31 17:36:24 -07:00
Mishal Shah
d543dd9a61 Merge pull request #25136 from porglezomp-misc/fix/stdlib-unittest-race
Fix a potential race condition in StdlibUnittest
2019-05-31 14:18:30 -07:00
Joe Groff
dd91bc2180 Install compatibility archive alongside shared libraries.
Although it's a static archive, its use is only relevant to dynamically linked builds of the
standard library. (If you're statically linking a Swift runtime into your process, you don't
need to worry about compatibility with older runtimes.)
2019-05-31 13:11:20 -07:00
Joe Groff
6442f3ede0 Install swiftCompatibility50 as part of the compiler component 2019-05-31 13:11:20 -07:00
Joe Groff
dffd1b27a1 Use autolinking to pull in compatibility libraries.
Many build systems that support Swift don't use swiftc to drive the linker. To make things
easier for these build systems, also use autolinking to pull in the needed compatibility
libraries. This is less ideal than letting the driver add it at link time, since individual
compile jobs don't know whether they're building an executable or not. Introduce a
`-disable-autolink-runtime-compatibility` flag, which build systems that do drive the linker
with swiftc can pass to avoid autolinking.

rdar://problem/50057445
2019-05-31 13:11:14 -07:00
eeckstein
896a0b0fe3 Merge pull request #25154 from eeckstein/dynamic-replaceable
IRGen/runtime: change the code generation for dynamically replaceable functions
2019-05-30 20:00:57 -07:00
Ben Cohen
e9d4687e31 De-underscore @frozen, apply it to structs (#24185)
* De-underscore @frozen for enums

* Add @frozen for structs, deprecate @_fixed_layout for them

* Switch usage from _fixed_layout to frozen
2019-05-30 17:55:37 -07:00
Erik Eckstein
7a5de47aa1 runtime: change the naming of TLS related stuff to make it more general and not specific to exclusivity checking.
Just a refactoring, NFC
2019-05-30 15:28:16 -07:00
Erik Eckstein
2ea531c3b3 IRGen/runtime: change the code generation for dynamically replaceable functions
Instead of a thunk insert the dispatch into the original function.
If the original function should be executed the prolog just jumps to the "real" code in the function. Otherwise the replacement function is called.
There is one little complication here: when the replacement function calls the original function, the original function should not dispatch to the replacement again.
To pass this information, we use a flag in thread local storage.
The setting and reading of the flag is done in two new runtime functions.

rdar://problem/51043781
2019-05-30 15:28:16 -07:00
swift-ci
9571d46c89 Merge pull request #25131 from stephentyrone/de-gyb-fixedarray 2019-05-29 20:02:27 -07:00
Cassie Jones
dc395a1d1d Replace objc version of getSystemVersionPlistProperty with swift version
The comment in the function said:
// This function is implemented in Objective-C because Swift does not support
// failing initializers.
which hasn't been true since swift 1.1.
2019-05-29 18:51:31 -07:00
Cassie Jones
2d21059030 Fix an over-release in StdlibUnittest
Fixes rdar://51245681
2019-05-29 18:01:39 -07:00
Steve (Numerics) Canon
957384129a It turns out that _SmallBuffer<T> simply isn't used at all
... so that's another vestigial static-buffer we can eliminate.
2019-05-29 19:43:39 -04:00
Steve (Numerics) Canon
27ccf1b914 De-GYB FixedArray.swift
It turns out that 16 is the only size that the stdlib actually uses, so the .gyb isn't eliminating any boilerplate anyway.
2019-05-29 19:19:54 -04:00
Joe Groff
2a28948a69 Merge pull request #25030 from jckarter/SR-10600-back-deploy
Introduce a backward-deployment library for SR-10600.
2019-05-29 15:02:02 -07:00
Daniel Rodríguez Troitiño
770bba91bd [android] Fix Bionic modulemap file syntax.
A line was forgotten in the rewrite which break the Android builds.
2019-05-29 11:04:42 -07:00
Slava Pestov
3917268b35 stdlib: Work around associated type inference bugs 2019-05-28 22:08:31 -04:00
Saleem Abdulrasool
79ceeaa880 Merge pull request #25082 from compnerd/bionic-is-not-glibc
Platform: attempt to split out the bionic modulemap
2019-05-28 15:39:36 -07:00
Itai Ferber
6171d68bfa Merge pull request #25065 from ikesyo/fix-dataprotocol-lastrange
Fix `DataProtocol.lastRange(of:)` (and cherry-pick Data.swift changes from swift-5.0-branch)
2019-05-28 09:54:16 -07:00
Sho Ikeda
44f0e93747 Merge pull request #25067 from ikesyo/avoid-fallthrough-where-appropriate
[gardening] Avoid fallthrough where appropriate (for readability/understandability)
2019-05-29 00:27:05 +09:00
Sho Ikeda
2019a97e55 Merge pull request #25066 from ikesyo/use-isempty-over-count
[gardening] Use `Collection.isEmpty` over `Collection.count`
2019-05-29 00:24:48 +09:00
Saleem Abdulrasool
d48220dd62 Platform: attempt to split out the bionic modulemap
This splits out the bionic modulemap from the glibc modulemap.  They are
sufficiently different that the duplication is worth it.  Furthermore,
it will enable properly identifying the libc on android.  Once fully
detangled, this will enable the use of bionic on non-android platforms.
2019-05-27 12:34:27 -07:00
Cassie Jones
e84142539c Fix a potential race condition in StdlibUnittest
StdlibUnittest uses an AtomicBool to track whether a failure has ocurred
in a test. Before this, expectFailure could have a false-positive
failure due to a race condition on the _anyExpectFailed.

The following interleaving would trigger the issue:

A: loads false
A: stores false
B: loads false
A: stores true
B: stores false
A: loads false (after body)

This causes A to see a false-positive failure.
2019-05-26 16:17:39 -07:00
Turushan Aktay
c61691919b Fix documentation typos. 2019-05-26 14:17:45 +02:00
Sho Ikeda
c1bb945124 [gardening] Avoid fallthrough where appropriate (for readability/understandability) 2019-05-26 09:50:02 +09:00
Sho Ikeda
a35c9f0c60 [gardening] Use Collection.isEmpty over Collection.count 2019-05-26 09:35:20 +09:00
swift-ci
b088acb66e Merge pull request #24767 from ikesyo/remove-unnecessary-breaks 2019-05-25 16:15:06 -07:00
Sho Ikeda
55b300f852 Fix DataProtocol.lastRange(of:) (and cherry-pick Data.swift changes from swift-5.0-branch)
`DataProtocol.lastRange(of:)` is correct in swift-5.0-branch, but not in master and swift-5.1-branch.
2019-05-26 07:26:33 +09:00
Federico Zanetello
afcf4b6991 fix documentation typo (#25061) 2019-05-25 12:43:49 -05:00
Joe Groff
9e1907a2ed Introduce a backward-deployment library for SR-10600.
Build a static archive that can be linked into executables and take advantage of the Swift runtime's
hooking mechanism to work around the issue Doug fixed in https://github.com/apple/swift/pull/24759.
The Swift 5.0 version of swift_conformsToProtocol would return a false negative in some cases where
a subclass conforms using an inherited conformance, so work around this by successively retrying
the original implementation up the superclass chain to try to find a match.
2019-05-24 09:28:49 -07:00
Arnold Schwaighofer
b127aac1ce Merge pull request #24781 from aschwaighofer/fix_some_type_dynamic_replacement
Fix dynamic replacement of some type when used with associated types
2019-05-23 16:36:32 -07:00
Shengqi Zhu
45112229b6 [Foundation]Fix newValue/oldValue in swift KVO when keyPath having a optional value
Fix https://bugs.swift.org/browse/SR-6066.
2019-05-23 23:32:42 +08:00
Arnold Schwaighofer
0297476da5 Add missing swiftrt-coff change 2019-05-22 11:23:17 -07:00
David Smith
5fba88c78e Merge pull request #24386 from Catfish-Man/noble-from-a-distant-land
Avoid O(n) character accesses in String.UTF8View._foreignCount
2019-05-21 14:40:27 -07:00
David Smith
803227a46b Avoid O(n) character accesses in String.UTF8View._foreignCount 2019-05-21 13:22:42 -07:00
Daniel Rodríguez Troitiño
69776aac35 Merge pull request #24521 from drodriguez/android-stop-leaking-fds
[android] Stop leaking FDs in parent test process.
2019-05-20 18:11:13 -07:00
Pavol Vaskovic
06685bcb51 Merge pull request #24898 from Gumichocopengin8/fix-warnings
[stdlib] Fix withUnsafeBytes warnings in NWEndpoint
2019-05-19 22:16:43 +02:00
George
3391b746d9 [stdlib] Improve error messages when snake case conversion is used.
`convertFromSnakeCase` and `convertToSnakeCase` are not inverses of each other for keys like "pictureURL" (which roundtrips to "pictureUrl").
This does not fix the underlying issue, but improves the error message if this situation is detected.
2019-05-19 10:00:08 -07:00
Keita Nonaka
7d8c54329c fix withUnsafeBytes warnings 2019-05-19 00:39:01 -04:00
Arnold Schwaighofer
5c3a4d329b Fix dynamic replacement of some type when used with associated types
rdar://50638228
2019-05-18 10:34:52 -07:00
Slava Pestov
e0bba70923 Foundation: Provide a Hashable.hashValue witness for _BridgedStoredNSError conformers
Previously we would synthesize this in Sema, but this no longer
works when conformance checking is triggered by SILGen.
2019-05-18 11:35:05 -04:00
swift-ci
3c25d99652 Merge pull request #24806 from colemancda/posixErrorLinux 2019-05-15 18:28:45 -07:00
swift-ci
aa6827a46d Merge pull request #24796 from ravikandhadai/oslog-optimization 2019-05-15 13:01:37 -07:00
Alsey Coleman Miller
1f15c87f35 Added missing Linux POSIX errors 2019-05-15 14:03:11 -05:00
Stephen Canon
fa778ec368 Deprecate nearbyint and rint on CGFloat (#24784)
These functions have never actually been supported in Swift, because Swift does not model the dynamic floating point environment. They may have worked occasionally in the past, but that was only accidental. Deprecate them with an explanatory message.
2019-05-15 11:04:03 -04:00
swift-ci
d1cc7136dd Merge pull request #23793 from phausler/data_mapped_perf_bug 2019-05-15 07:58:32 -07:00
Brent Royal-Gordon
dce879f508 Revert "[Foundation] Fix availability of NSValue.value(of:)" 2019-05-15 05:17:42 -07:00
Ravi Kandhadai
9be4fef53a [SIL Optimization] Add a mandatory optimization pass for optimizing
the new os log APIs based on string interpolation.
2019-05-14 18:08:59 -07:00