Commit Graph

12522 Commits

Author SHA1 Message Date
Maxim Moiseev
cbf83ac04f [NFC][stdlib] Add FIXME markers to simplify audit 2018-11-14 11:58:42 -08:00
Doug Gregor
3f4b742b9a Merge pull request #20571 from DougGregor/metadata-builtin-int7
[Runtime] Add metadata for Builtin.Int7
2018-11-14 11:32:41 -08:00
Ben Cohen
df2307e035 [stdlib][DNM] Collapse sequence and collection wrappers (#20221)
* Concretize dropFirst/Last/sufix/prefix from Sequence

Remove split customization point

Eliminate SubSequence from Sequence protocol

Collapse LazyCollection

Collapse LazyMapCollection

Eliminate _SequenceWrapper

Collapse LazyFilterCollection

Collapse LazyDrop/PrefixWhileCollection

Fix tests, ABI stability update

Collapse FlattenSequence

* Add entries to source/ABI compatible expected results.

* Update tests to avoid pre-10.14 objc runtime bug

* Expunge _preprocessingPass
2018-11-14 10:05:58 -08:00
Doug Gregor
d92a5e8356 [Runtime] Add metadata for Builtin.Int7
Fixes rdar://problem/45880755.
2018-11-14 09:35:15 -08:00
Johannes Weiss
11b6bb3417 fix documentaion for the Unicode.ParseResult
The previous documentation was not accurate. It said that the length of
the error returned would be the length of the valid prefix. In case of
no valid prefix however the code will still return 1, contrary to the
documentation.
I fixed the documentation by adding the guarantee that the error length
will always be positive and removing the information about the valid
prefix as we might want to change the precise algorithm in the future.
2018-11-14 12:13:42 +00:00
Doug Gregor
c367c8e9cb [Runtime] Adjust "conforming type" based on a given conformance descriptor.
When we are looking for the specific type for a protocol conformance (e.g.,
because we may have a subclass of the type that declared conformances), don't
go back through swift_conformsToProtocol() multiple times, which
requires more lookups in the global conformance table. Instead, use
the (known) protocol conformance descriptor.
2018-11-13 20:45:03 -08:00
Joe Groff
32749f331a Merge pull request #20561 from jckarter/multi-payload-xi
Give multi-payload enums extra inhabitants.
2018-11-13 20:41:19 -08:00
Joe Groff
ca402f19b1 Give multi-payload enums extra inhabitants.
Previously, they would forward their unused spare bits to be used by other multi-payload enums, but
did not implement anything for single-payload extra inhabitants.
2018-11-13 18:08:01 -08:00
Slava Pestov
eb147d9ec6 Merge pull request #20531 from slavapestov/inline-always-is-not-inlinable
@inline(__always) should not imply @inlinable
2018-11-13 20:39:35 -05:00
Slava Pestov
f6c2caf64b stdlib: Add @inlinable to @inline(__always) declarations
These should be audited since some might not actually need to be
@inlinable, but for now:

- Anything public and @inline(__always) is now also @inlinable
- Anything @usableFromInline and @inline(__always) is now @inlinable
2018-11-13 15:15:07 -05:00
Karoy Lorentey
735b6ea142 Merge pull request #20519 from lorentey/collection-layout-fixedness
[stdib] Audit @_fixed_layout on collection storage classes
2018-11-13 10:37:02 +00:00
Doug Gregor
7b8bbcd473 [Keypaths] Start using mangled type names for non-dependent types.
When a type in keypath metadata is non-dependent, use a mangled type name
rather than a symbolic reference to an accessor function.

Part of rdar://problem/38038799.
2018-11-12 21:15:20 -08:00
Doug Gregor
b192cedf8d [Keypaths] Use mangled names to reference type and witness table accessors.
Switch key path metadata over to mangled names for each of the places it
refers to either a type metadata accessor or a witness table accessor. For
now, the mangled name is a symbolic reference to the existing accessors.

Part of rdar://problem/38038799.
2018-11-12 21:15:20 -08:00
swift-ci
9334458c61 Merge pull request #20472 from DougGregor/abi-mangled-assoc-conformances-in-witness-tables 2018-11-12 21:09:34 -08:00
Harlan Haskins
e4db036d7f Merge pull request #20203 from harlanhaskins/operator-oh-would-you-help-me-place-this-call
[Frontend] Remove -enable-operator-designated-types
2018-11-12 15:35:50 -08:00
swift-ci
c2d6c9ac45 Merge pull request #20514 from compnerd/stdlib-tools 2018-11-12 13:58:46 -08:00
Karoy Lorentey
ca09281b34 [stdlib] Let’s try leaving Set/Dictionary storage non-fixed as an experiment
The current ivars are all defined in the parent class, so (provided my mental model of how this works is correct) this may make some actual sense.
2018-11-12 21:01:23 +00:00
Karoy Lorentey
671de071c6 [stdlib] Audit @_fixed_layout usage in collection storage classes
- Remove __SwiftNativeNSEnumerator from the ABI. (It’s only used in internal classes and in the Objective-C runtime.)
- Remove inlinability of init() and deinit for all the __SwiftNativeNSFoo superclasses except Array’s and Data’s.
2018-11-12 20:53:10 +00:00
Karoy Lorentey
41e9dabecd Merge pull request #20511 from lorentey/ununwrappable
[stdlib] Make _Unwrappable internal and rename func unwrap() to _unwrap()
2018-11-12 19:53:27 +00:00
Saleem Abdulrasool
cb394f6302 build: allow building tools and stdlib separately
This restores the ability to build the standard library and the tools in two
separate build invocations.  This is required to cross-compile the standard
library on various targets without building complete toolchains.
2018-11-12 11:45:23 -08:00
Saleem Abdulrasool
d51c92f181 Merge pull request #20398 from compnerd/winix
stdlib: conditionalise unistd.h
2018-11-12 11:41:53 -08:00
Arnold Schwaighofer
853388c930 Merge pull request #20478 from aschwaighofer/disable_dynamic_replacement_chaining
Add support to modify chaining behavior of dynamic replacements
2018-11-12 10:37:58 -08:00
Doug Gregor
81610fdc02 [ABI] Use faux mangled names for associated conformances in witness tables
The current representation of an associated conformance in a witness
tables (e.g., Iterator: IteratorProtocol within a witness table for
Sequence) is a function that the client calls.

Replace this with something more like what we do for associated types:
an associated conformance is either a pointer to the witness table (once
it is known) or a pointer to a mangled name that describes that 
conformance. On first access, demangle the mangled name and replace the
entry with the resulting witness table. This will give us a more compact
representation of associated conformances, as well as always caching
them.

For now, the mangled name is a sham: it’s a mangled relative reference to
the existing witness table accessors, not a true mangled name. In time,
we’ll extend the support here to handle proper mangled names.

Part of rdar://problem/38038799.
2018-11-12 09:42:51 -08:00
Karoy Lorentey
08c813769a [stdlib] Make _Unwrappable internal and rename func unwrap() to _unwrap()
_Unwrappable isn’t used in inlinable context.
2018-11-12 16:57:59 +00:00
Dale Buckley
15e8fd2b0f Split Range Codable extensions down to Encodable and Decodable extensions 2018-11-12 14:58:11 +00:00
Michael Ilseman
9315b3a190 Merge pull request #20438 from milseman/uniterator
[String] Custom Iterators for String Views
2018-11-11 16:14:13 -08:00
Pavel Yaskevich
7bd2688949 [Overlay] Fix XCTest overlay to avoid passing autoclosures through 2018-11-10 11:59:29 -08:00
John McCall
44e0f44040 Merge pull request #20493 from rjmccall/keypath-compiler-abi
Change the compiler ABI of keypaths.
2018-11-10 14:18:44 -05:00
Max Moiseev
9d0c97e05d Merge pull request #20470 from moiseev/bridge-inlinable
[stdlib] Audit inlinability in BridgeObjectiveC [WIP]
2018-11-10 10:37:52 -08:00
John McCall
3e5165d1ab Change the compiler ABI of keypaths.
Previously, the stdlib provided:

- getters for AnyKeyPath and PartialKeyPath, which have remained;

- a getter for KeyPath, which still exists alongside a new read
  coroutine; and

- a pair of owned mutable addressors that provided modify-like behavior
  for WritableKeyPath and ReferenceWritableKeyPath, which have been
  replaced with modify coroutines and augmented with dedicated setters.

SILGen then uses the most efficient accessor available for the access
it's been asked to do: for example, if it's been asked to produce a
borrowed r-value, it uses the read accessor.

Providing a broad spectrum of accessor functions here seems acceptable
because the code-size hit is fixed-size: we don't need to generate
extra code per storage declaration to support more alternatives for
key paths.

Note that this is just the compiler ABI; the implementation is still
basically what it was.  That means the implementation of the setters
and the read accessor is pretty far from optimal.  But we can improve
the implementation later; we can't improve the ABI.

The coroutine accessors have to be implemented in C++ and used via
hand-rolled declarations in SILGen because it's not currently possible
to declare independent coroutine accessors in Swift.
2018-11-10 02:08:04 -05:00
John McCall
75e1df6ef8 [NFC] Minor conveniences for working with metadata. 2018-11-10 02:08:04 -05:00
John McCall
09cfb81571 Fix a bug with key paths that could lead to exclusivity crashes. 2018-11-10 02:08:04 -05:00
Maxim Moiseev
ef1050f3fd [stdlib] Audit inlinability in BridgeObjectiveC
<rdar://problem/45949961>
2018-11-09 21:26:07 -08:00
Richard Wei
aeadc14f32 Merge branch 'master' into additive-arithmetic 2018-11-09 17:27:22 -08:00
Michael Ilseman
b19f8ccda6 Merge pull request #20480 from milseman/fixed_nixed
[stdlib] Expunge FixedArray from ABI
2018-11-09 16:15:29 -08:00
swift-ci
40f45f7c67 Merge pull request #20477 from eeckstein/stringswitch-abi 2018-11-09 15:35:14 -08:00
Harlan Haskins
44f1806779 Turn on -enable-operator-designated-types for the standard library
Because this feature mostly exists for the standard library, turn it on
specifically. This avoids having to serialize it in the flags necessary
for parseable interfaces.
2018-11-09 15:26:21 -08:00
Michael Ilseman
24a95992f9 Merge branch 'master' into uniterator 2018-11-09 15:08:25 -08:00
swift-ci
8e4503abed Merge pull request #20479 from milseman/dce 2018-11-09 14:42:46 -08:00
Richard Wei
c0268518df Merge branch 'master' into additive-arithmetic 2018-11-09 14:28:36 -08:00
Erik Eckstein
1a02650c25 stdlib: remove all FIXME(sil-serialize-all) attributes in StringSwitch.swift
Those attributes were generated automatically, but are not needed.
All the annotated declarations are only used stdlib internally

rdar://problem/45927899
2018-11-09 14:27:29 -08:00
Karoy Lorentey
faa535ffb2 Merge pull request #20463 from lorentey/remove-random-fill
[stdib] Remove RandomNumberGenerator._fill(bytes:)
2018-11-09 21:51:35 +00:00
Michael Ilseman
08d83d0678 [stdlib] Expunge FixedArray from ABI 2018-11-09 13:47:22 -08:00
Michael Ilseman
4ddfd30787 [stdlib] Remove dead code 2018-11-09 13:39:59 -08:00
Arnold Schwaighofer
fb7b223ba2 Add support to modify chaining behavior of dynamic replacements
Default to not chain dynamic replacements: Only one replacement and the
original implementation are active.
2018-11-09 13:17:09 -08:00
Harlan Haskins
703c5715cf Merge pull request #20320 from Azoy/random-readability
[QoI][stdlib] Improve some random call sites
2018-11-09 11:31:43 -08:00
Richard Wei
4e2147e6f8 Merge branch 'master' into additive-arithmetic 2018-11-09 10:17:58 -08:00
Michael Ilseman
103861b31f Merge branch 'master' into uniterator 2018-11-09 10:17:05 -08:00
swift-ci
aa3e16dc8f Merge pull request #20462 from aschwaighofer/dyn_repl_entry_point_must_hold_lock 2018-11-09 09:57:01 -08:00
Karoy Lorentey
51be8c7650 [stdib] Remove RandomNumberGenerator._fill(bytes:)
This hidden customization point isn’t used in the stdlib anymore.
2018-11-09 17:37:25 +00:00