Commit Graph

4650 Commits

Author SHA1 Message Date
Dmitri Hrybenko
1e7e471dd9 CMake: record that PassKit overlay depends on the new Concacts overlay
Swift SVN r30363
2015-07-18 03:27:37 +00:00
Dmitri Hrybenko
48c901c918 Foundation overlay: use the new selectors for NSCoder APIs
rdar://21431062

Swift SVN r30362
2015-07-18 03:08:17 +00:00
Dave Abrahams
24f930ee67 [stdlib] Add ._prext_flatten for sequences-of-sequences
Swift SVN r30361
2015-07-18 02:58:36 +00:00
Dave Abrahams
e3bcd90d70 [stdlibunittest] Warning suppression
Swift SVN r30360
2015-07-18 02:58:35 +00:00
Dave Abrahams
9f59c9d52d [stdlib] More lazy doc comment updates
Swift SVN r30359
2015-07-18 02:58:34 +00:00
Andrew Trick
c4f141a121 Reapply "Add test cases for isUnique sanity checks."
Handle linux.

Swift SVN r30357
2015-07-18 02:36:57 +00:00
Joe Groff
d6f1178568 Foundation overlay: Deprecate String "PercentEscapesUsingEncoding" methods.
These have been superseded by newer APIs in Foundation, and Swift should follow suit. rdar://problem/21397308

Swift SVN r30356
2015-07-18 02:25:51 +00:00
Dmitri Hrybenko
4f6bedfc51 stdlib: mark some _HeapBuffer APIs public/@testable so that they can be used in tests
Should fix the broken buildbots.

Swift SVN r30354
2015-07-18 01:53:02 +00:00
Dmitri Hrybenko
9392d76fd7 Additions to the SceneKit overlay
<rdar://problem/20855539> Add SCNVector3/4 Swift convenience
<rdar://problem/20854576> Add SCNFloat to the SceneKit swift overlay

Patch by Amaury Balliet.

Swift SVN r30353
2015-07-18 01:08:05 +00:00
Dmitri Hrybenko
3ba51ad202 Foundation overlay: fix coding style
Swift SVN r30350
2015-07-18 00:39:46 +00:00
Dmitri Hrybenko
6cef57029f Remove the SDK overlay for Security
It is no longer needed per rdar://19785756

Swift SVN r30349
2015-07-18 00:39:43 +00:00
Joe Groff
6608221a72 stdlib: Remove _UnitTestArray.
rdar://problem/20246497

Swift SVN r30348
2015-07-18 00:14:28 +00:00
Joe Groff
ff1cd5762a Typo in comment
Swift SVN r30347
2015-07-18 00:14:12 +00:00
Dmitri Hrybenko
6ba6de23aa Revert "Eliminate the NSError -> error enum bridging from Contacts."
This reverts commits r29003 and r29005.

The blocking issue, rdar://21032649, is fixed.

rdar://21032711

Swift SVN r30345
2015-07-17 23:59:49 +00:00
Doug Gregor
89ff140503 Move the default implementation of ErrorType._domain into the standard library.
There is no reason for the compiler to be synthesizing a body of
_domain when it can be implemented in a protocol extension. As part of
this, fix a recent regression in the computed domain: it was using
string interpolation, which means that the recent changes not to print
qualified names affected the domain of the generated NSErrors. Oops.

Swift SVN r30343
2015-07-17 23:37:59 +00:00
Andrew Trick
6672ea0dbc Revert "Add test cases for isUnique sanity checks."
This reverts commit r30339.

Temporarilly remove these tests because I forgot to handle linux and
may end up reorganizing the tests.

Swift SVN r30340
2015-07-17 23:37:15 +00:00
Andrew Trick
59909cbd5a Add test cases for isUnique sanity checks.
Swift SVN r30339
2015-07-17 23:22:06 +00:00
Dmitri Hrybenko
82ec7ea9d2 CoreMedia overlay: make CMTime Comparable, and CMTimeRange Equatable
Change approved by Adam Sonnanstine.

Swift SVN r30335
2015-07-17 22:26:58 +00:00
Roman Levenstein
8624834b9e Clean-up of the stdlib file forcing pre-specializations.
- Remove public symbols.
- Only one top-level element called _Prespecialize.
- Simpler code.

Swift SVN r30333
2015-07-17 21:20:05 +00:00
Dmitri Hrybenko
4e1efd5e11 stdlib: move the implemnentation comment for AnyObject out of the doc comment
Swift SVN r30324
2015-07-17 20:25:31 +00:00
Jordan Rose
965285f13d Move GameKit overlay to GameCenter.
In iOS 9 and OS X 10.11 the old GameKit was effectively renamed GameCenter, while
the new GameKit is a sort of umbrella framework like Cocoa. We need to support
backwards deployment, though, so the GameCenter overlay links to GameKit.framework.
(This is essentially the same solution implemented for CoreImage moving out of
QuartzCore in r28449)

rdar://problem/21340738

Swift SVN r30322
2015-07-17 19:54:38 +00:00
Argyrios Kyrtzidis
310d92ecc1 [stdlib] Add RawOptionSetType as unavailable with a 'renamed' fixit to OptionSetType.
rdar://21800523

Swift SVN r30313
2015-07-17 07:16:10 +00:00
Andrew Trick
e024f7fe41 Add sanity checks to the _isUnique_native API.
This is a low-level API that bypasses the usual type checks. To avoid
misuse, we add a dynamic type check that kicks in when stdlib asserts
are enabled.

Swift SVN r30311
2015-07-17 06:52:09 +00:00
Roman Levenstein
19a3821a56 Implementation of the pre-specialization for the most popular stdlib generic types.
This patch implements the pre-specialization for the most popular generic types from the standard library. If there are invocations of generic functions from the standard library in the user-code and the compiler can find the specialized, optimized versions of these functions, then calls of generic functions are simply replaced by the calls of the specialized functions.

This feature is supposed to be used with -Onone to produce much faster (e.g. 5x-10x faster) executables in debug builds without impacting the compile time. In fact, the compile-time is even improved, because IRGen has less work to do. The feature can be considered a light-weight version of the -Odebug, because pre-specialization is limited in scope, but does not have a potentially negative compile-time impact compared to -Odebug. It is planned to enable it by default in the future.

This feature is disabled by default for the time being. It can be enabled by using a hidden flag: -Xllvm -use-prespecialized.

The implementation consists of two logical steps:
- When the standard library is being built, we force a creation of specializations for the most popular generic types from the stdlib, e.g. Arrays of integer and floating point types, Range<Int>, etc. The list of specializations is not fixed and can be easily altered by editing the Prespecialized.swift file, which is responsible for forcing the specialization of generic types (this is simple solution for now, until we have a proper annotation to indicate which specializations of a given generic type or function we want to generate by means of the pre-specialization). These specializations are then optimized and preserved in the stdlib dylib and in the Swift SIL module. The size increase of the stdlib due to creation of pre-specializations is currently about 3%-7%.

- When a user-code is being compiled with -Onone, the compiler would run a generic specializer over the user-code. If there are calls of generic functions from the standard library, the specializer would check if there is an existing specialization matching these invocations. If such a specialization is found, the original call is replaced by the call of this more efficient specialized version.

Swift SVN r30309
2015-07-17 06:52:07 +00:00
Dmitri Hrybenko
85262ffeae stdlib: restore the doc comment on AnyObject
rdar://21496254

Swift SVN r30298
2015-07-17 03:11:09 +00:00
Dmitri Hrybenko
109add8131 Foundation overlay: add NSCoder.decodeObjectOfClasses(_:forKey:)
Due to the fact that AnyClass is not Hashable, and that currently
NSKeyedArchiver/Unarchiver work with NSObject-derived, NSCoding
compliant classes, we are marking the decodeObjectOfClasses API refined
for Swift in our objc header and providing the desired overlay in our
overlay as shown below.

Arrays were also considered (for both API), but the underlying
implementation is entirely set-based, and using Arrays in Swift vs Sets
in objective C felt like too far a deviation.

Patch by Michael LeHew Jr.

Changes to the Dictionary test are caused by bumping the Fonudation API
epoch and taking in a fix in the types used in an NSDictionary
initializer.

rdar://21486551

Swift SVN r30297
2015-07-17 03:07:47 +00:00
Jordan Rose
aac0342e48 [stdlib] More type annotations to reduce compile time.
The big one, though, is the use of 'lazy' in _masterThreadOneTrial.
Removing it takes the function from 62s to 2s on my machine.
That's rdar://problem/20875936.

Swift SVN r30292
2015-07-17 00:22:03 +00:00
Joe Groff
4182c44cfe Runtime: Provide prefab value witness tables for unowned and weak references.
Fixes rdar://problem/21315113.

Swift SVN r30291
2015-07-17 00:09:37 +00:00
Dave Abrahams
6d3119e2a3 strip _prext_ from inside doc comments
Swift SVN r30279
2015-07-16 22:55:28 +00:00
David Farler
241de1a1c3 Add popFirst/popLast implementations for some collections
Add the following non-customizable implementations:

- popFirst/popLast for Collections whose SubSequence == Self.
- Array.popLast
- ContiguousArray.popLast
- Set.popFirst
- Dictionary.popFirst

Swift SVN r30278
2015-07-16 22:52:05 +00:00
Dave Abrahams
205ba195d5 [stdlib] Revamp doc comments for new LazySequence
Swift SVN r30277
2015-07-16 22:41:14 +00:00
Dmitri Hrybenko
71c5bb9371 CoreMedia overlay: change CMTimeMakeWithSeconds into an initializer
Patch by Adam Sonnanstine.

rdar://20940262

Swift SVN r30271
2015-07-16 20:24:47 +00:00
Dmitri Hrybenko
e5e4335fad stdlib: Slice: trap on out-of-bounds indices
rdar://21822657

Swift SVN r30269
2015-07-16 18:22:40 +00:00
Dmitri Hrybenko
82c6b23239 SDK overlay: use AnyObject instead of AnyClass to pass an id-compatible
Class representation

As Joe explained, when Swift passes a metatype like AnyClass for an type
defined in Objective-C, it will pass the Swift metadata pointer instead
of an id-compatible Class.

Swift SVN r30268
2015-07-16 17:34:09 +00:00
Arnold Schwaighofer
c772380f2c stdlib: Rename IsOrderedBefore to EscapingBinaryPredicate
Swift SVN r30267
2015-07-16 16:35:45 +00:00
Joe Groff
ec61fa4c5a IRGen/Runtime: Use only the 'layout' subset of the vwtable to perform value type layout.
Full type metadata isn't necessary to calculate the runtime layout of a dependent struct or enum; we only need the non-function data from the value witness table (size, alignment, extra inhabitant count, and POD/BT/etc. flags). This can be generated more efficiently than the type metadata for many types--if we know a specific instantiation is fixed-layout, we can regenerate the layout information, or if we know the type has the same layout as another well-known type, we can get the layout from a common value witness table. This breaks a deadlock in most (but not all) cases where a value type is recursive using classes or fixed-layout indirected structs like UnsafePointer. rdar://problem/19898165

This time, factor out the ObjC-dependent parts of the tests so they only run with ObjC interop.

Swift SVN r30266
2015-07-16 15:38:17 +00:00
Arnold Schwaighofer
4c2dd3ee97 Remove redundant typealias
Swift SVN r30263
2015-07-16 14:20:36 +00:00
Erik Eckstein
57c5de4491 [llvm-arc-opts] Optimize strong_retain_unowned/strong_release pairs.
Replaces a swift_retainUnowned/swift_release pair with a swift_checkUnowned, if possible.
For details see rdar://problem/21297936




Swift SVN r30262
2015-07-16 13:46:18 +00:00
David Farler
6099e156eb Add RangeReplaceableCollectionType.removeFirst
Add requirements and default implementations for removeFirst() and
removeFirst(n: Int).

rdar://problem/21844880

Swift SVN r30256
2015-07-16 07:47:06 +00:00
Ted Kremenek
a3d88266b2 Revert "IRGen/Runtime: Use only the 'layout' subset of the vwtable to perform value type layout."
This reverts commit r30243.

This appears to be breaking the Linux build.

Swift SVN r30253
2015-07-16 06:28:24 +00:00
David Farler
f1c5e503a9 Doc review: tweak SequenceType.forEach's doc comment
No functional change.

Swift SVN r30250
2015-07-16 04:28:43 +00:00
David Farler
86f1a7088b Review: Rename SequenceType.forEach parameter to 'body'
No functional change.

Swift SVN r30249
2015-07-16 04:07:17 +00:00
Dave Abrahams
9963996fee [stdlib] Move lazy filter prototype into stdlib
(still underscored pending review).

Swift SVN r30248
2015-07-16 03:50:46 +00:00
Joe Groff
2641d566ac IRGen/Runtime: Use only the 'layout' subset of the vwtable to perform value type layout.
Full type metadata isn't necessary to calculate the runtime layout of a dependent struct or enum; we only need the non-function data from the value witness table (size, alignment, extra inhabitant count, and POD/BT/etc. flags). This can be generated more efficiently than the type metadata for many types--if we know a specific instantiation is fixed-layout, we can regenerate the layout information, or if we know the type has the same layout as another well-known type, we can get the layout from a common value witness table. This breaks a deadlock in most (but not all) cases where a value type is recursive using classes or fixed-layout indirected structs like UnsafePointer. rdar://problem/19898165

Swift SVN r30243
2015-07-16 01:28:42 +00:00
David Farler
8f78e7ab16 Make ExtensibleCollectionType diagnostic use "renamed" for better fixit
rdar://problem/21710469

Swift SVN r30242
2015-07-16 00:01:02 +00:00
David Farler
91b89b8956 Add SequenceType.forEach requirement and default implementation
rdar://problem/21663830

Swift SVN r30236
2015-07-15 23:36:23 +00:00
Dmitri Hrybenko
9d27519a69 SDK overlay: fix a bug in the SceneKit overlay and re-enable the test
Patch by Amaury Balliet.

Part of rdar://20738811

Swift SVN r30234
2015-07-15 23:29:09 +00:00
David Farler
b9fe9eef63 Explicitly mark GameKit -> simd overlay dependency
Speculative fix for rdar://problem/21808853.

Swift SVN r30232
2015-07-15 22:57:12 +00:00
Arnold Schwaighofer
27f792f308 Re-@noescape the isOrderedBefore closure argument to sort
The blocking optimization was added.

rdar://21024092

Swift SVN r30227
2015-07-15 21:44:45 +00:00
David Farler
e689ab3369 Mark AppKit -> CoreData dependency in the overlays
AppKit links CoreData and this relationship isn't expressed
in the build mechanics for the overlays, which can cause
link failures when building the overlay.

rdar://problem/21837604

Swift SVN r30223
2015-07-15 18:49:10 +00:00