Commit Graph

2952 Commits

Author SHA1 Message Date
Dmitri Gribenko
cfab2d17c4 New indexing model: fix compilation issues in String 2016-03-09 14:31:31 -08:00
Dmitri Gribenko
eb54d17180 New indexing model: fix compilation errors in Reflection.swift 2016-03-09 14:17:46 -08:00
Dmitri Gribenko
1c4e343b73 New indexing model: supply default implementations for Strideable for integers 2016-03-09 14:16:21 -08:00
Dmitri Gribenko
895553ca61 New indexing model: propagate AnyCollection requirements to its use sites 2016-03-09 14:12:08 -08:00
Arnold Schwaighofer
8df5ed5c53 Merge pull request #1599 from aschwaighofer/tune_withUnsafeMutableBufferPointer_for_inlining
Force inlining of Array.withUnsafeMutableBufferPointer
2016-03-09 13:36:48 -08:00
Dmitri Gribenko
2b342cdc19 Merge pull request #1568 from rintaro/simplify-transcode
[stdlib] Simplify transcode implementation
2016-03-09 13:05:05 -08:00
Arnold Schwaighofer
3738178a43 Force inlining of Array.withUnsafeMutableBufferPointer
We do this to enable removal of the closure (allocation).

The size of the libSwiftCore.dylib grows by 300 bytes. A program (such as
benchmark/single-source/unit-tests/StackPromo.swift) that uses one invocation of
withUnsafeMutableBufferPointer shrinks by roughly 500 bytes.
2016-03-09 13:01:05 -08:00
Dmitri Gribenko
80b1337a0c Merge pull request #1588 from shawnce/swift-3-indexing-model-flatten
WIP - made some progress fixing Flatten
2016-03-09 11:37:12 -08:00
Ted Kremenek
838d5864ba Merge pull request #1498 from ianpartridge/print-using-fwrite
[stdlib] Use fwrite(3) in _Stdout.write()
2016-03-08 21:52:42 -08:00
Shawn Erickson
db7f2a87dd improved String and StringUTF16, reapplied mistakenly stashed changes to Filter 2016-03-08 21:09:35 -08:00
Arnold Schwaighofer
3676671b7f Merge pull request #1587 from aschwaighofer/stack_promote_with_unsafe_mutable_buffer_pointer
Mark Array.withUnsafeMutableBuffer as not escaping the array storage.
2016-03-08 19:39:28 -08:00
Arnold Schwaighofer
b5f018a4b1 Mark Array.withUnsafeMutableBuffer as not escaping the array storage.
This is safe because the closure is not allowed to capture the array according
to the documentation of 'withUnsafeMutableBuffer' and the current implementation
makes sure that any such capture would observe an empty array by swapping self
with an empty array.

Users will get "almost guaranteed" stack promotion for small arrays by writing
something like:

  func testStackAllocation(p: Proto) {
    var a = [p, p, p]
    a.withUnsafeMutableBufferPointer {
      let array = $0
      work(array)
    }
  }

It is "almost guaranteed" because we need to statically be able to tell the size
required for the array (no unspecialized generics) and the total buffer size
must not exceed 1K.
2016-03-08 19:37:47 -08:00
Jordan Rose
2a5a8903e4 Revert "[stdlib] Add @noescape to output parameter of UnicodeCodecType.encode" 2016-03-08 17:29:56 -08:00
Shawn Erickson
1d7b77593e WIP - made some progress fixing Flatten 2016-03-08 16:34:26 -08:00
Max Moiseev
4da439d406 copy(withZone:) => copy(with:) in ShadowProtocols 2016-03-08 15:50:59 -08:00
Shawn Erickson
7a84232a06 improve and clean up StringXxxx (note a couple compile errors remain in dependent files) 2016-03-08 15:04:45 -08:00
Max Moiseev
1fae0d1325 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-08 12:48:48 -08:00
Shawn Erickson
80670a2b24 corrected & improved Filter and Reverse 2016-03-08 11:18:32 -08:00
Dmitri Gribenko
41f3cf8b55 New indexing model: comment out a conflicting '..<' operator that produces HalfOpenInterval 2016-03-08 01:38:56 -08:00
Dmitri Gribenko
cf297592cb New indexing model: more .successor() => next() 2016-03-08 01:33:39 -08:00
Dmitri Gribenko
0483e6f3c0 Merge pull request #1570 from shawnce/swift-3-indexing-model-reverse
Fixed Reverse compile issues & fleshed out aspects of Filter and Reverse
2016-03-08 01:27:39 -08:00
Rintaro Ishizaki
4f1a4ecd62 [stdlib] Add @noescape to output parameter of UnicodeCodecType.encode
Conformance:
 - UTF8.encode
 - UTF16.encode
 - UTF32.encode

Related functions:
 - transcode
 - String._encode
 - _StringCore.encode
2016-03-08 17:34:15 +09:00
Dmitri Gribenko
1854d49dc7 New indexing model: AnySequence and AnyCollection API sketch 2016-03-08 00:14:25 -08:00
Shawn Erickson
969f1457c2 Fixed Reverse compile issues & fleshed out aspects of Filter and Reverse 2016-03-07 20:26:20 -08:00
Max Moiseev
7fe6916bf6 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-07 12:10:47 -08:00
Shawn Erickson
371c0f6e68 fixed things flagged in code review 2016-03-07 11:07:22 -08:00
Shawn Erickson
68ff64357c Changed _failEarlyRangeCheck(rangeStart: ... boundsEnd:) --> _failEarlyRangeCheck(range:, bounds:) 2016-03-07 09:57:48 -08:00
Shawn Erickson
2a69d24688 fleshed out BidirectionalCollection previous(Index) and friends 2016-03-07 09:38:41 -08:00
Rintaro Ishizaki
1b54593362 [stdlib] Simplify transcode implementation 2016-03-08 02:04:32 +09:00
Shawn Erickson
175c3cd136 dealt with issues and suggestions outlined in PR1559 2016-03-06 22:13:18 -08:00
Shawn Erickson
100dc3b317 fixup - return what is expected
note no compiler warning that I saw?
2016-03-06 18:01:06 -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
449869ccae stdlib: Remove dead code in String and UnicodeScalar 2016-03-06 02:46:21 -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
Ted Kremenek
90ce8daf0b Merge pull request #1552 from hughbe/stdlib-newlines
[gardening] Remove double new lines from stdlib files
2016-03-05 14:40:04 -08:00
Hugh Bellamy
c1b25bb32f [gardening] Remove double new lines from stdlib files 2016-03-05 15:44:54 +00:00
Patrick Pijnappel
636423c4ec [stdlib] Minor refactor for clarity in UTF8.decode() 2016-03-05 11:01:54 +11:00
Patrick Pijnappel
c109bb2a19 [stdlib] Copy warning to docs of all UnicodeCodecTypes 2016-03-05 09:49:44 +11:00
Patrick Pijnappel
500dc9d7bc [stdlib] Fix bitshift operand mask in UTF8.decode() 2016-03-05 09:48:03 +11:00
Dmitri Gribenko
43a5d4cf55 stdlib: rename Array.appendContents(of:) to Array.append(contentsOf:) 2016-03-04 14:39:14 -08:00
Shawn Erickson
fe42606062 [stdlib] - WIP moved aspects of ForwardIndex and BidirectionalIndex into their Collection equivalents 2016-03-04 07:40:59 -08:00
Patrick Pijnappel
17124c886f [stdlib] Clarify variable name in UTF8
_atEnd was confusing because it did not mean 'at the end of the sequence', because of buffering.
2016-03-04 10:31:36 +11:00
Patrick Pijnappel
f5d7bd266c [stdlib] Improve comments in UTF8 2016-03-04 10:27:56 +11:00
Patrick Pijnappel
25b5028a6c [stdlib] Improve UTF8._decodeOne() doc comment
Based on the API Design Guidelines.
2016-03-04 09:53:38 +11:00
Max Moiseev
cf4bafe9e3 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-03 13:22:03 -08:00
Patrick Pijnappel
49741cfdd9 [stdlib] Rewrite UTF8 decoding 2016-03-03 23:30:00 +11:00
Ian Partridge
1fcf15b150 [stdlib] Ignore errors from fwrite() 2016-03-02 17:29:18 +00:00
Max Moiseev
38726d08d7 Merge branch 'swift-3-api-guidelines' into swift-3-indexing-model 2016-03-01 15:49:59 -08:00
Dmitri Gribenko
27c4074bb1 stdlib: docs: fix a reference to a type that does not exist 2016-03-01 14:59:23 -08:00