Andrew Trick
9886e4ef54
Use UnsafeRawPointer in StringCore.
...
This is another necessary step in introducing changes
for SE-0107: UnsafeRawPointer.
UnsafeRawPointer is great for bytewise pointer operations.
OpaquePointer goes away.
The _RawByte type goes away.
StringBuffer always binds memory to the correct CodeUnit
when allocating memory.
Before accessing the string, a dynamic element width check
allows us to assume the bound memory type.
Generic entry points like atomicCompareExchange no longer handle
both kinds of pointers. Normally that's good because you
should not be using generics in that case, just upcast
to raw pointer. However, with pointers-to-pointers
you can't do that.
2016-07-27 09:07:35 -07:00
Xin Tong
9709b0e510
Merge pull request #3662 from trentxintong/unicodescalar
...
SE-0128 - Change unicodescalar initializer to failable
2016-07-26 16:44:14 -07:00
Xin Tong
bbf86865d6
Change unicodescalar to failable
...
We were using a precondition which crashes the program when invalid input is
provided. We want to provide a way to gracefully check and handle invalid input
or shutdown the program if necessary.
SR-1930
2016-07-21 15:27:13 -07:00
Doug Gregor
0bf7c005b3
[SE-0091 Follow-up] Move global operators for non-generic concrete types into the type.
...
In various cases where we had global operators for non-generic
concrete types (such as String + String), move those operators into
the type. This should not affect the sources, but makes the exposition
of the library cleaner.
Plus, it's a good test for the compiler, which uncovered a few issues
where the compiler was coupled with the library.
2016-07-21 12:54:27 -07:00
Nate Cook
c9278a1b50
[stdlib] Remove _StringCore from UTF8View.Index
2016-07-12 09:29:40 -05:00
Dmitri Gribenko
ce94bd9cca
Merge pull request #3268 from natecook1000/nc-scalarindex-nocore
...
[stdlib] Remove _StringCore from UnicodeScalarIndex
2016-07-07 17:41:36 -07:00
Nate Cook
2d75c12c2d
[stdlib] Remove _StringCore reference from UnicodeScalarIndex
...
This removes the `_core` property from UnicodeScalarView.Index
and moves any remaining index-moving logic from the index to
the view in UnicodeScalarView and CharacterView.
2016-07-02 23:16:22 -05:00
practicalswift
5d1af107a3
[gardening] Use "{let,var} c: C" instead of "{let,var} c : C"
...
Inspired by @gribozavr:s fix in 1ad666742e
2016-07-01 23:51:32 +02:00
practicalswift
af9786efc2
[gardening] Remove duplicate words.
2016-06-04 23:16:27 +02:00
Rintaro Ishizaki
668b9dbc64
[stdlib] Apply tail style "where" clause to stdlib/public/core
2016-06-02 12:00:55 +09:00
Patrick Pijnappel
daec2dae00
Resolve conflicts with master
2016-05-24 19:21:04 +02:00
Nate Cook
44b2d56a7f
[stdlib] Revise documentation for string-related types
...
This documentation revision covers a large number of types & protocols:
String, its views and their indices, the Unicode codec types and protocol,
as well as Character, UnicodeScalar, and StaticString, among others.
This also includes a few small changes across the standard library for
consistency.
2016-05-22 03:04:22 -05:00
Dmitri Gribenko
d591f9cf7a
stdlib: remove most uses of @warn_unused_result, which does nothing now
...
I kept the one on sorted(), because that one requires a less trivial
change.
2016-05-19 18:39:39 -07:00
Patrick Pijnappel
4419614be4
Move post-nil guarantee to separate line for Iterators' next()
2016-05-08 21:36:39 +02:00
Patrick Pijnappel
ab9e74cba3
Resolve conflicts with upstream
2016-05-05 08:55:34 +02:00
Dave Abrahams
9bee5d182f
[stdlib] location/formLocation => index/formIndex
2016-04-26 17:46:16 -07:00
Max Moiseev
e733a9b194
[stdlib][swift-3-indexing-model] removing successor/predecessor from String.UnicodeScalarView.Index
2016-04-25 11:55:10 -07:00
Dave Abrahams
47a870cc50
[stdlib] Use location/formLocation for all index movement
2016-04-21 17:13:41 -07:00
Dmitri Gribenko
10697f939f
Merge commit '510f29abf77e202780c11d5f6c7449313c819030' into swift-3-indexing-model
2016-04-14 13:45:27 -07:00
Nate Cook
3522af5bd5
[New indexing model] Switch old index methods to internal
2016-04-08 14:04:34 -05:00
Nate Cook
6b77c6a979
[New indexing model] Update documentation comments with new APIs
...
Most of these were successor() -> successor(of:).
2016-04-08 01:01:58 -05:00
Manav Gabhawala
7928140f79
[SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary
2016-04-06 20:21:58 -04:00
Dmitri Gribenko
6985b958fd
Merge remote-tracking branch 'origin/master' into swift-3-indexing-model
2016-04-04 11:42:17 -07:00
Dmitri Gribenko
5a12349e9c
Merge remote-tracking branch 'origin/master' into swift-3-indexing-model
2016-04-01 14:12:13 -07:00
Slava Pestov
7b91cbd551
stdlib: Add @_versioned attributes needed for resilient build
2016-04-01 13:07:18 -07:00
Erik Eckstein
c0964a492d
Re-instate "stdlib: Add some inlining attributes to help the optimizer getting the right inlining decisions."
...
This re-instates commit 8b0e36779e
2016-03-29 16:33:47 -07:00
Erik Eckstein
be8faad792
Revert my recent inliner commits.
...
There are some failures in the tests.
2016-03-28 11:11:25 -07:00
Erik Eckstein
8b0e36779e
stdlib: Add some inlining attributes to help the optimizer getting the right inlining decisions.
...
This is more or less a workaround for some optimizations (mainly ARC opt) to avoid performance degradation with the upcoming inliner changes
In some situations it makes a big difference for ARC opt if a function is inlined or not, althought this shouldn't be the case.
2016-03-27 10:59:29 -07:00
Dave Abrahams
8d9e62b274
[stdlib] indexing model: rename next/previous
...
I'm not too satisfied with the names for the updating: versions, but
this is a start.
2016-03-22 17:13:54 -07:00
Dave Abrahams
f493b54e44
[stdlib] indexing model: Interval/Range merge
...
This is step 1; we still need to introduce ClosedRange.
2016-03-16 15:59:10 -07:00
Patrick Pijnappel
07a8c39fcb
[stdlib] Use double space as sentence separator in IteratorType.next() docs.
2016-03-16 22:36:26 +11:00
Patrick Pijnappel
020841d4ba
[stdlib] Add post-nil guarantee for IteratorProtocol.next() to always return nil
2016-03-16 22:06:07 +11:00
Dmitri Gribenko
3bb845a16a
New indexing model: implement temporary forwarders in UnicodeScalarView
2016-03-11 18:06:12 -08:00
Dmitri Gribenko
cfab2d17c4
New indexing model: fix compilation issues in String
2016-03-09 14:31:31 -08:00
Dmitri Gribenko
41f3cf8b55
New indexing model: comment out a conflicting '..<' operator that produces HalfOpenInterval
2016-03-08 01:38:56 -08:00
Shawn Erickson
2a69d24688
fleshed out BidirectionalCollection previous(Index) and friends
2016-03-07 09:38:41 -08:00
Shawn Erickson
0db3a29987
fleshing out Collection.next(Index)
...
-removed fatal stub Collection.next(Index)
-added default Collection.next(Index) where Index is Strideable
-added custom next(Index) on some collections
-added fatal stub next(Index) on some collections
2016-03-06 17:37:40 -08:00
Dmitri Gribenko
fc636b94f5
fixup
2016-03-06 02:12:59 -08:00
Dmitri Gribenko
ad1428e1d6
New collection indexing model: removed old index protocols
...
... and started to fix compiler errors.
2016-03-06 01:53:34 -08:00
Jordan Rose
b319e3da32
stdlib: Adjust to insert(contentsOf:at:) and append(contentsOf:)
...
instead of insertContents(of:at:) and appendContents(of:),
originally insertContentsOf(_:at:) and appendContentsOf(_:)
per internal discussion.
2016-02-25 12:50:39 -08:00
Jordan Rose
f922084180
stdlib: Rename miscellaneous enum cases and static vars.
2016-02-24 17:46:14 -08:00
Dmitri Gribenko
f3389273ba
stdlib: String indices: samePositionIn(_:) => samePosition(in:)
2016-02-24 16:29:27 -08:00
Dmitri Gribenko
f0633ce5a9
stdlib: Sequence.iterator() => .makeIterator()
2016-02-23 13:52:30 -08:00
Max Moiseev
4b9eab6288
appendContentsOf => appendContents(of:)
2016-02-22 18:02:04 -08:00
Dmitri Gribenko
63481be8bd
stdlib: lowercase cases of the PlaygroundQuickLook enum
2016-02-20 00:55:35 -08:00
Max Moiseev
78ba5d5f3f
[stdlib] Requires in comments changed to Precondition
2016-02-19 18:57:26 -08:00
Max Moiseev
40b1a0b7e0
[stdlib] all sorts of require renamed back to precondition
2016-02-19 18:21:29 -08:00
Dmitri Gribenko
dd75aed67a
Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines
2016-02-17 14:40:05 -08:00
Dmitri Gribenko
2d27beccfc
Merge pull request #1286 from natecook1000/natecook-doc-consistency
...
[stdlib] Documentation consistency fixes
2016-02-12 08:59:21 -08:00
Nate Cook
51251dc133
Convert imperative function summaries to present.
...
i.e., "Return ..." -> "Returns ..."
2016-02-12 04:20:39 -06:00