Commit Graph

1397 Commits

Author SHA1 Message Date
Dmitri Hrybenko
b158753ae4 stdlib: coding style: add parentheses to one-argument closures for
consistency with the rest of the library

Swift SVN r25036
2015-02-06 05:38:15 +00:00
Dmitri Hrybenko
46302bd305 stdlib: mark more closures with @noescape
Swift SVN r25035
2015-02-06 05:26:03 +00:00
Dave Abrahams
b4c4b30f27 [stdlib] Don't leak CF dependency from core stdlib
Carefully track the functions that inject these dependencies, so all
functions that use them can be protected with

  @inline(never) @semantics("stdlib_binary_only")

To do this, we introduce a naming convention: the _stdlib_binary_ prefix
distinguishes functions dependent on external frameworks.  All callers
of such functions must adopt either the naming convention, or the
attributes above.

This change should unbreak the build.

Swift SVN r25020
2015-02-06 00:48:16 +00:00
Maxwell Swadling
4535d51593 [stdlib] Added initializeFrom to array functions
Added to all functions that don't use _expectEnd.

Swift SVN r25017
2015-02-05 21:31:19 +00:00
Dave Abrahams
94965036d5 [stdlib] Move ObjC Mirrors out of Foundation
These mirrors are the default mirrors that get used for all objective-C
object, including some that aren't defined in Foundation:

  import Dispatch
  println(dispatch_get_global_queue(0,0))

This example isn't fixed yet, because we need to pull all the string
bridging goop out of Foundation and into the core standard library.

Swift SVN r25012
2015-02-05 19:18:33 +00:00
Dave Abrahams
97ec182ba7 [stdlib] Move String bridging into Core stdlib
This change allows us to drop an egregious table-of-function-pointers
hack in favor of a much cleaner hack using SwiftShims.  It also allows
us to move the ObjC mirrors out of Foundation in an upcoming commit.

Swift SVN r25011
2015-02-05 19:18:32 +00:00
Dave Abrahams
a89c2e11ae [stdlib] Create shims for CFString access in core
...and use these shims in place of our previous inelegant dispatch
through 'C' code.

Swift SVN r25010
2015-02-05 19:18:31 +00:00
Dave Abrahams
96c6c8d519 [stdlib] Fix doc comment formatting
Swift SVN r25009
2015-02-05 19:18:30 +00:00
Dave Abrahams
f7000ce3cb [stdlib] Add unsafeUnwrap(x)
Also the internal version, _unsafeUnwrap, for more-efficiently
unwrapping non-empty optionals.

Swift SVN r25008
2015-02-05 19:18:30 +00:00
Maxwell Swadling
7ba5e6a575 [stdlib] added @noescape to Array functions
rdar://problem/19389247

Swift SVN r24970
2015-02-04 19:49:06 +00:00
Maxwell Swadling
8e95156b0b [stdlib] added @noescape to withUnsafeBufferPointer functions
rdar://problem/19389247

Swift SVN r24969
2015-02-04 19:49:05 +00:00
Maxwell Swadling
6cbf069a2b [stdlib] added @noescape to StaticString methods
rdar://problem/19389247

Swift SVN r24968
2015-02-04 19:49:04 +00:00
Maxwell Swadling
8a24395a48 [stdlib] added @noescape to StaticString methods
rdar://problem/19389247

Swift SVN r24967
2015-02-04 19:48:57 +00:00
Dmitri Hrybenko
e4b1cbeb64 stdlib: remove .null() static factories on unsafe pointers
These APIs are redundant with nil literals and the default initializer.

rdar://19159145

Swift SVN r24957
2015-02-04 11:17:55 +00:00
Dmitri Hrybenko
65cee50274 stdlib: stop using COpaquePointer.null()
Swift SVN r24955
2015-02-04 11:17:54 +00:00
Dmitri Hrybenko
ebdb7616b2 stdlib: add conformances to CVarArgType to unsafe pointer types
Patch by Jordan.

rdar://19541479

Swift SVN r24947
2015-02-04 06:41:31 +00:00
Dmitri Hrybenko
f7a9b18d62 stdlib: fix comment for ExtensibleCollectionType.extend()
rdar://19679159

Swift SVN r24941
2015-02-04 05:13:28 +00:00
Dave Abrahams
644c5650c3 [stdlib] Re-enable disabled tests and fix the bugs
...that crept in because they weren't being run

Swift SVN r24933
2015-02-04 01:53:13 +00:00
Dave Abrahams
0c17537602 Revert "[stdlib] use initializeTo instead of loops"
This reverts r24743, because it broke some of the tests that Chris
disabled.

Swift SVN r24932
2015-02-04 01:53:11 +00:00
Dave Abrahams
0d383f28a9 [stdlib] CGFloat : CVarArgType
Along the way, had to generalize the mechanism for detecting that a type
is handled as a Double by C's varargs.

Swift SVN r24859
2015-01-30 23:23:57 +00:00
Joe Pamer
4ec18171f7 Remove the extra level of closure nesting from r24752.
Swift SVN r24818
2015-01-29 18:48:41 +00:00
Dave Abrahams
6506068262 [stdlib] Update a comment
We have Builtin.BridgeObject now, so eliminate the "someday..." phrasing

Swift SVN r24806
2015-01-28 21:55:04 +00:00
Dmitri Hrybenko
f4e35f90eb stdlib: remove Unsafe[Mutable]Pointer.null()
This API is redundant with nil literals and the default initializer.

rdar://19159145

Swift SVN r24796
2015-01-28 08:42:28 +00:00
Dmitri Hrybenko
311957061a Stop using Unsafe[Mutable]Pointer.null()
This API will be removed per rdar://19159145 (it is redundant with nil
literals and the default initializer).

Swift SVN r24795
2015-01-28 08:42:26 +00:00
Dmitri Hrybenko
2d4892881e stdlib: fix a typo in doc comments
rdar://19280027

Swift SVN r24793
2015-01-28 06:36:59 +00:00
Dmitri Hrybenko
ff771d0984 stdlib: use fixed-width Builtin.IntXX types for Swift.Int and UInt
Using the unknown-sized Builtin.Word types complicates producing
compile-time overflow diagnostics.  If we don't know the target Word
size, we don't know if there is an overflow.  But SIL optimizer does not
know the size of Word, this is the point of having the Word type in the
first place.

Also, this opens up more possibilities for optimizations.

rdar://17604532

Swift SVN r24788
2015-01-28 05:22:42 +00:00
Maxwell Swadling
2dc8175f86 Removed work around now that rdar://problem/19591983 is fixed
Swift SVN r24762
2015-01-27 22:45:04 +00:00
Joe Pamer
d3910dade6 Reduce standard library build times by 10s by adding a couple of type annotations to 'join'.
Swift SVN r24752
2015-01-27 20:56:02 +00:00
Maxwell Swadling
4ef99c0de5 [stdlib] Added fixmes for missing _expectEnds
Swift SVN r24745
2015-01-27 02:12:26 +00:00
Maxwell Swadling
b2a672e748 [stdlib] Changed loop to initializeFrom
To improve array performance with POD types.

Swift SVN r24744
2015-01-27 02:12:26 +00:00
Maxwell Swadling
1587f11064 [stdlib] use initializeTo instead of loops
This improves performance of arrays and buffers.

Swift SVN r24743
2015-01-27 02:12:24 +00:00
Maxwell Swadling
c87ddeb2ee [stdlib] added initializeTo default implementation
This allows for sequences backed by contiguous buffers to be
initialized quickly

Swift SVN r24742
2015-01-27 02:12:24 +00:00
Maxwell Swadling
863d79c81b [stdlib] formatting change
Swift SVN r24741
2015-01-27 02:12:23 +00:00
Maxwell Swadling
a86572c9a9 [stdlib] Updated APIs to use C.Generator.Element
Swift SVN r24740
2015-01-27 02:12:19 +00:00
Dmitri Hrybenko
c60b975dae stdlib/FixedPoint: use 'let' where possible
Swift SVN r24729
2015-01-26 08:56:47 +00:00
Dmitri Hrybenko
877a34e388 stdlib: remove (almost) the assumption that Swift.Int is implemented
in terms of Builtin.Word

Swift SVN r24721
2015-01-25 13:11:37 +00:00
David Farler
7339a8056b Set: remove workaround for 18803556 when iterating over Sequences
Swift SVN r24719
2015-01-25 09:00:42 +00:00
Joe Pamer
a18bedf079 Factor the constraint-favoring machinery out of the constraint generation process, and re-work it into a series of passes over an expression sub-tree.
Aside from tidying things up, doing this results in some significant benefits:
- Allows for global constraint ordering optimizations over a given expression, not just on a peephole basis.
- Eliminates a set of order-dependent bugs in the solver that have been dogging us for a while. (rdar://problem/19459079)
- Brings another set of tyvar-to-tyvar solving problems out of the realm of the exponential. (rdar://problem/19005271)
- Opens up the possibility of optimizing constraints during later solving phases - not just while generating them.

Swift SVN r24693
2015-01-23 23:10:50 +00:00
Dmitri Hrybenko
cb2870c230 Update Unicode data files to 7.0.0
rdar://17561742

Swift SVN r24692
2015-01-23 22:17:45 +00:00
Maxwell Swadling
35d835e454 [stdlib] used builtins in moveAssignFrom instead of loop
Swift SVN r24690
2015-01-23 19:37:02 +00:00
Dmitri Hrybenko
7209392bb4 stdlib/Unicode: fix encoding U+20000 and higher to UTF-16
UTF16.{leadSurrogate,trailSurrogate} were converting intermediate
results to UInt16 too soon, causing a trap on U+20000 and higher.

rdar://19156359

Swift SVN r24678
2015-01-23 04:47:02 +00:00
Dmitri Hrybenko
bbf79427ac stdlib: remove bitwise operations on Bool
Bitwise operations on Bool are redundant with other logic operations
that stdlib already provides.  The only reason to have them was to avoid
branching in the short-circuiting && and ||.

rdar://19340952

Surprisingly, replacing & and | in the standard library with && and ||
brought performance improvements and no significant performance
regressions:

RecursiveOwnedParameter 1.14
SelectionSort 1.19

Swift SVN r24674
2015-01-23 03:09:55 +00:00
Dave Abrahams
02e70d15d1 [stdlib] Failable String inits from UTF8/16 views
String.UTF8View and String.UTF16View may be slices that don't both start
and end on Unicode scalar boundaries, in which case conversion to a
String must fail.

Swift SVN r24669
2015-01-23 02:46:42 +00:00
Maxwell Swadling
e5083b7af4 [stdlib] peeled first element off loop in join
Swift SVN r24661
2015-01-23 00:07:25 +00:00
Maxwell Swadling
b33b91156e [stdlib] added comment about builtins in UnsafePointer
Swift SVN r24660
2015-01-22 23:44:51 +00:00
Maxwell Swadling
bac1f15dd6 [stdlib] added fastpath to join for empty separators
Swift SVN r24658
2015-01-22 22:59:01 +00:00
Maxwell Swadling
d9c1888b5b [stdlib] use builtin array operations instead of loops
Swift SVN r24655
2015-01-22 21:51:30 +00:00
Dmitri Hrybenko
2830f05536 stdlib: re-attach the documentation comment
Swift SVN r24650
2015-01-22 19:46:39 +00:00
Graham Batty
9752dc68ef Don't use UnknownObject on non-Objective-C.
Swift SVN r24641
2015-01-22 18:20:21 +00:00
Dave Abrahams
1187855f60 [stdlib] Fix internal/public conflict
String.UTF16Index had an init defined as internal, then redefined in the
Foundation overlay as public.  This, unfortunately, did not make the
init appear to be public when Foundation was imported.

Swift SVN r24639
2015-01-22 17:34:19 +00:00