Commit Graph

5469 Commits

Author SHA1 Message Date
Dmitri Gribenko 09f7245dbf stdlib: add SWIFT_RUNTIME_STDLIB_INTERFACE attribute where necessary
... and remove some redundant ones.

This change fixes the RuntimeObjC.swift test.

rdar://problem/26239602
2016-05-12 15:48:25 -07:00
Slava Pestov ce0b51cc9b Update resilience annotations in stdlib for recent changes
The new indexing model and floating point stuff was missing a few
annotations, causing a build failure with -enable-resilience.
2016-05-11 22:51:33 -07:00
Stephen Canon 772d7ec3c5 Merge branch 'SE-0067' of https://github.com/stephentyrone/swift into stephentyrone-SE-0067
Implements almost all of SE-0067. There are a few outstanding features; this implementation does not have:

- formRemainder(dividingBy:)
- formSquareRoot()
- addProduct(_:,_:)

which require additions to the Builtin module. I can probably figure out how to do these, but I haven't had a chance to do so yet. Also missing are the generic initializers and comparisons whose implementation depends on having new Integer protocols.

The last remaining feature of SE-0067 is that while the basic operators +,-,*,/, etc are moved onto the FloatingPoint protocol, they are still required on the concrete types in order to disambiguate overloads. Fixing this seems to require either modifying the overload resolution rules or removing these operators from some other protocols. Or it might just require that someone smarter than me looks at the problem.

Passes the existing tests locally (with the included changes). I'm working on additional tests for the new features.
2016-05-11 22:11:21 -04:00
swift-ci df4d93901f Merge pull request #2490 from kballard/flatten-seealso-joinWithSeparator 2016-05-11 18:10:56 -07:00
Michael Gottesman 8308ad85e2 Merge pull request #2485 from gottesmm/change-backtrace-to-use-dladdr-directly-instead-of-backtrace_symbol
When producing backtraces, do not use backtrace_symbol, invoke dladdr…
2016-05-11 17:28:36 -07:00
Max Moiseev 4027afa536 [stdlib] fixing the signature of RandomAccessCollection.index(_:offsetBy:limitedBy:) and uncommenting the test 2016-05-11 17:27:49 -07:00
Dmitri Gribenko 0556c4b387 Merge pull request #2480 from compnerd/attribute-spelling
stdlib: use the reserved attribute spellings
2016-05-11 16:28:17 -07:00
swift-ci b56c15a08e Merge pull request #2461 from russbishop/fork/master 2016-05-11 16:20:42 -07:00
Kevin Ballard 83c113c11e [Stdlib] Update the SeeAlso docs for flatten()
flatten() was still referencing `joinWithSeparator(_:)` even though
that's now been renamed to `joined(separator:)`.
2016-05-11 16:01:41 -07:00
Michael Gottesman 7523d1a60b When producing backtraces, do not use backtrace_symbol, invoke dladdr directly.
Previously, we were using backtrace_symbol and then parsing/modifying its
output. By just using dladdr directly, we have a cleaner and more robust
solution.

rdar://25064742
2016-05-11 15:40:10 -07:00
Stephen Canon 71e7767346 Make sure @_transparent and @warn_unused_result are on operators where appropriate. 2016-05-11 18:08:23 -04:00
swift-ci 274ff905c5 Merge pull request #2481 from apple/coregraphics-cgfloat-from-cgfloat 2016-05-11 14:16:19 -07:00
swift-ci 273ad53dce Merge pull request #2478 from compnerd/storage-annotation 2016-05-11 13:58:05 -07:00
Russ Bishop 7dc71d0d96 Rename generic arguments 2016-05-11 13:44:37 -07:00
Dmitri Gribenko ff49e17eb2 Remove dead code 2016-05-11 11:47:03 -07:00
Dmitri Gribenko 94f49d443d CGFloat: add CGFloat.init(CGFloat), which makes CGFloat similar to Float and Double
This is an API bugfix, this API was accidentally omitted when we added
CGFloat to the overlay, so no evolution proposal is necessary.
2016-05-11 11:45:58 -07:00
Saleem Abdulrasool 81661fca61 stdlib: use the reserved attribute spellings
This is a purely mechanical change replacing the attributes with the reserved
spelling.  Compilers are to not error when they encounter a reserved spelling
for an attribute which they do not support.
2016-05-11 11:30:24 -07:00
Ted Kremenek 60ba4325bd Further simplify SceneKit overlay by adding private extension to CGFloat. 2016-05-11 11:30:01 -07:00
Saleem Abdulrasool 3743cbc563 stdlib: annotate some more symbols with interfaces
Mark some more of the SwiftShim interfaces with the RUNTIME_INTERFACE
decoration.
2016-05-11 11:20:39 -07:00
Ted Kremenek 942e524285 Revert "SE-0036: Requiring Leading Dot Prefixes for Enum Instance Member Implementations" (#2477) 2016-05-11 11:02:37 -07:00
Stephen Canon a5e87c8792 Fix crasher due to out-of-range initializer on 32b. 2016-05-11 09:21:40 -04:00
Dmitri Gribenko 92289bf3a0 SceneKit overlay: simplify code 2016-05-11 01:05:35 -07:00
Russ Bishop b7329df146 Cleanup comments for flatMap overloads 2016-05-11 00:27:59 -07:00
Russ Bishop 408e8c738b Remove RandomAccess overloads and types 2016-05-11 00:27:59 -07:00
Dmitri Gribenko 405fb1339d Merge pull request #2329 from Nirma/sequence_fix
[stdlib] Simplification of split function
2016-05-10 21:40:17 -07:00
Chris Lattner 4cf5613406 Merge pull request #2460 from dakeshi/stdlib-core-array-structure
[stdlib] Fix print method syntax and add the optional binding
2016-05-10 20:12:24 -07:00
Jordan Rose 14a7334aef Merge pull request #2224: SE-0036: Requiring Leading Dot Prefixes for Enum Instance Member Implementations
from @ahoppen
2016-05-10 19:58:09 -07:00
Dmitri Gribenko 0b8d11bcb1 Merge pull request #2469 from apple/stdlib-collection-unittest-se-0052
StdlibCollectionUnittest: MinimalIterator: allow multiple nil returns
2016-05-10 18:31:17 -07:00
Sangjoon-Moon b49b5c4fb3 Fix print method syntax and revert whitespace
* Remove terminator argument in print method because the default terminator is "\n".
* Revert removed trailing whitespace by the previous commit
2016-05-11 10:08:49 +09:00
Dmitri Gribenko 1b495b4faa Merge pull request #2465 from apple/stdlib-add-unavailable-string-index-methods
stdlib: add unavailable methods on string indices (new indexing model migration)
2016-05-10 14:22:09 -07:00
Dmitri Gribenko 32605a19d9 StdlibCollectionUnittest: MinimalIterator: allow multiple nil returns
SE-0052 requires all iterators to return nil indefinitely after all
elements have been consumed.
2016-05-10 14:16:22 -07:00
David Farler 9dddc6492b SwiftRemoteMirror: Project error existentials
Error existentials have a kind of special heap layout and can also
be compatible as NSError instances, too.
2016-05-10 12:50:31 -07:00
Dmitri Gribenko de8fb07052 stdlib: add unavailable methods on string indices to make migration to Swift 3 easier 2016-05-10 11:34:51 -07:00
Dmitri Gribenko e498a9817b SDK overlay: remove Contacts dependency from UIKit
The SDK headers don't have this dependency.  Looks like it was added by
mistake.

rdar://problem/26190517
2016-05-10 10:36:29 -07:00
Sangjoon-Moon d2c273b7f4 Fix code syntax error. 2016-05-10 20:43:14 +09:00
Russ Bishop 1afa93b646 [stdlib] SR-361: Implement SE008: Add Lazy flatMap for Seq of Optionals
https://bugs.swift.org/browse/SR-361

Adds required LazyFilterRandomAccessCollection and the flatMap extensions.
2016-05-10 02:42:57 -07:00
Sangjoon-Moon 1dce37e0e1 * Fix print(_:separator =) with print(_:separator:terminator)
* Add optional binding for using optional first, last property
2016-05-10 17:38:32 +09:00
Stephen Canon 63759a4a9e Remove comparison operators from concrete types, since they're now provided by FloatingPoint. 2016-05-09 21:16:55 -04:00
amartini51 55be501ad6 Merge pull request #2429 from natecook1000/nc-revise-core
[stdlib] Revise documentation for core types and protocols
2016-05-09 17:13:46 -07:00
Max Moiseev 5345128c74 [stdlib] workaround for CustomPlaygroundQuickLookable in UIView subclasses 2016-05-09 17:07:15 -07:00
Stephen Canon 6802c5e263 Restore public on top-level operators, mark -- and ++ unavailable for CGFloat. 2016-05-09 18:35:52 -04:00
Nate Cook 9f326385d6 [stdlib] Revise documentation for core types and protocols
This adds to and expands upon documentation for some core parts of the
standard library, including Optional, ErrorProtocol, AnyObject, and Bool.
2016-05-09 16:41:20 -05:00
David Farler 2fd0b39751 SwiftRemoteMirror: move dump APIs to print to stdout instead of stderr
Rather than move file descriptors around in the tools, just tell the
underlying ::dump methods to print to stdout instead.
2016-05-09 14:29:33 -07:00
Slava Pestov 75bd780aca Reflection: Add support for closure contexts to readMetadataFromInstance()
Also add end-to-end tests for this finally, and fix a bug in
the SwiftReflectionTest library where we would give up on an
module completely if it did not have a field metadata section.
This is of course wrong if the module defines closures but
not nominal types.
2016-05-09 13:41:56 -07:00
Slava Pestov 4fccd2f6fc Reflection: Closure context layout
This adds various MetadataReader methods to support closure layout:
- Reading generic arguments from metadata
- Reading parent metadata
- Reading capture descriptor from heap metadata

To a large extent, this is not currently taken advantage of, because
SILGen always wraps address-only captures in SIL box types.

Tests are in the next patch.
2016-05-09 13:40:58 -07:00
Slava Pestov 0dffbcb791 Reflection: Add TypeLowering::hasFixedSize() 2016-05-09 13:40:57 -07:00
Slava Pestov 5cc4ce1760 Reflection: Looking up CaptureDescriptors by remote address
Remote metadata for closure contexts points to a capture descriptor.
We have a local copy of all capture descriptors. Translate the
address by recording the local and remote start address of
reflection metadata.
2016-05-09 13:40:57 -07:00
Stephen Canon dd1f116cc3 Reinstate Strideable, switch static lets to @inline(__always). 2016-05-09 16:19:40 -04:00
Joe Groff 4ce8645501 Wanton microoptimization for -[_SwiftNativeNSError classForCoder]
We have a static cache var for [NSError class], so save an objc_msgSend here
2016-05-09 11:18:34 -07:00
Stephen Canon 3609b690c0 Restore _to/_fromBitPattern for compatability, but mark deprecated. 2016-05-09 12:44:35 -04:00