Commit Graph

3132 Commits

Author SHA1 Message Date
Dave Abrahams
5c3ebfcfb6 [stdlib] test file rename missed in r17722
Swift SVN r17734
2014-05-08 23:33:49 +00:00
Dmitri Hrybenko
72606a5228 stdlib/Runtime: allow swift_bridgeToObjectiveC to bridge objc
existentials

Should fix rdar://16837253

Swift SVN r17720
2014-05-08 22:58:10 +00:00
Greg Parker
f1d020e11a <rdar://16848707> Add Dispatch overlay with covers for some libdispatch macros.
Swift SVN r17693
2014-05-08 09:47:00 +00:00
Greg Parker
d619d82388 [test] Add new file for crash testing.
Swift SVN r17305
2014-05-03 02:37:26 +00:00
Ted Kremenek
050fd53af7 Rename UncheckedOptional to ImplicitlyUnwrappedOptional.
Swift SVN r17232
2014-05-02 06:13:57 +00:00
Greg Parker
b337d35e43 [test] Add KVO test. XFAIL it pending the ObjC runtime additions.
Swift SVN r17030
2014-04-29 07:46:38 +00:00
Greg Parker
183c3a3b10 Revert r16776 (Distributed Objects unavailability).
This created multiple definitions of the unavailable classes, which broke stuff.


Swift SVN r16997
2014-04-28 22:27:55 +00:00
Dave Zarzycki
e604952ca9 Stdlib: Overflow all float to int conversions
<rdar://problem/16630580> Investigate: floating point "overflow" semantics?

Swift SVN r16805
2014-04-25 05:58:20 +00:00
Dave Zarzycki
ce2c44f495 Stdlib: test for r16764
Swift SVN r16804
2014-04-25 05:37:56 +00:00
Greg Parker
f8ad26fabe <rdar://16689104> Mark classes for Distributed Objects as unavailable.
Swift SVN r16776
2014-04-24 23:16:21 +00:00
Joe Groff
c3eda1adc4 Revert "Relax reinterpretCast assert to allow a cast to a smaller type."
This reverts commit r16725 per DaveA's request.

Swift SVN r16775
2014-04-24 23:14:33 +00:00
Joe Groff
71ce6b2313 Relax reinterpretCast assert to allow a cast to a smaller type.
It's de facto reliable that inhabited optionals are prefixed with their payload.

Swift SVN r16725
2014-04-23 23:40:22 +00:00
Greg Parker
9c0c8ac4bb [overlay] Add covers for UIKit orientation macros.
Swift SVN r16490
2014-04-18 02:45:11 +00:00
Joe Groff
822aa300e8 Remove BlockShims.mm.
Swift SVN r16485
2014-04-18 01:07:12 +00:00
Dave Abrahams
3de27d2179 [stdlib] Array: add bridgeCache/fix refCounting
Array's getObjects:range: needs to fill the supplied buffer without
incrementing the reference count.  For that reason, and to fulfill
lifetime expectations for Array elements that are computed
dynamically (e.g. from value types that are BridgedToObjectiveC), we
maintain a cache of converted objects associated with each Array.

Swift SVN r16105
2014-04-09 07:59:43 +00:00
Dave Abrahams
e115ce852a Delete mistakenly-committed test
Swift SVN r16101
2014-04-09 05:14:40 +00:00
Dave Abrahams
8be637213d Fix the matrix shootout test
new T[n] doesn't actually work.

Swift SVN r16095
2014-04-09 03:17:03 +00:00
Greg Parker
188611deb2 [test] Add test for CGPoint/CGSize/CGVector/CGRect overlays.
Swift SVN r16078
2014-04-08 22:47:04 +00:00
Dave Abrahams
6882603b68 [stdlib] Work around <rdar://problem/16530674>...
by gyb'ing up some non-generic functions.  Also test both the singly-
and multiply-referenced code paths for array replacement.

Swift SVN r15974
2014-04-05 02:58:28 +00:00
Dave Abrahams
cb59d340f8 [stdlib] Get NewArray test building and passing
Swift SVN r15946
2014-04-04 17:10:12 +00:00
Greg Parker
6d6d6896d2 Add SpriteKit overlay with a typealias for SKColor.
Swift SVN r15849
2014-04-02 23:46:56 +00:00
Dave Zarzycki
30e6d1de98 Runtime: remove dead _ObjCSuperClassHack
Swift SVN r15832
2014-04-02 21:30:31 +00:00
Greg Parker
ad3a65642b [stdlib] Implement NSObject's == and hashValue() using -isEqual: and -hash.
Swift SVN r15826
2014-04-02 20:35:24 +00:00
Dave Abrahams
cd0bf9ad27 [stdlib] Add and test the new Array core
Swift SVN r15616
2014-03-29 10:43:44 +00:00
Joe Groff
57b6afc745 stdlib: Implement implicit conversions to C*Pointer types.
Make CConstPointer<T> convertible from UnsafePointer<T>, inout T, and Array<T>, and nil; and make CMutablePointer<T> convertible from UnsafePointer<T>, inout T, inout Array<T>, and nil.

Swift SVN r15600
2014-03-29 02:50:33 +00:00
Dave Abrahams
ffa31a1e67 [stdlib] Actually test Index, revealing a bug
Swift SVN r15389
2014-03-23 08:45:45 +00:00
Greg Parker
f1ca6c0964 [test] Fix stdlib/Reflection.swift on iOS.
Swift SVN r15198
2014-03-18 19:42:44 +00:00
Greg Parker
bd9a451657 [test] Add a timeout because the Reflection test runs for hours under ASan.
Swift SVN r15159
2014-03-17 21:39:28 +00:00
Dave Zarzycki
082f8400b6 Stdlib: Ensure that the "hack" class is linkable
Swift SVN r15022
2014-03-14 00:52:37 +00:00
Dave Abrahams
155e862317 [stdlib] Range: allow range to be offset by DistanceType
Swift SVN r14690
2014-03-05 20:12:06 +00:00
Joe Groff
f6d4485a3c stdlib/runtime: Create an _ObjCBridgeable protocol and 'bridgeAny' runtime function.
For container bridging, implement a '_bridge<T>' function that converts a Swift value to AnyObject using a runtime check for its _ObjCBridgeable conformance, crashing if one doesn't exist.

Swift SVN r14645
2014-03-04 16:50:11 +00:00
Greg Parker
d63772a7e7 [test] Move arch-specific string appending test to NewStringAppending.swift.
NewString.swift may now be asan-safe too, but I didn't try it.


Swift SVN r14385
2014-02-26 07:28:15 +00:00
Greg Parker
6f0ada02e8 [stdlib] Add conversion of nil to COpaquePointer. Test some nil uses.
Swift SVN r14195
2014-02-21 01:21:46 +00:00
Dave Abrahams
1bdf9d915d [stdlib] Make unique reference checking work
Think the scenarios through more carefully, create more reliable tests.
Fixes <rdar://problem/16105759> Too many retains for COW optimization

Swift SVN r14140
2014-02-20 11:14:09 +00:00
Joe Groff
73e564428f stdlib/runtime: Stub out a mechanism for introspecting value structure.
Define a "Mirror" protocol with methods for querying the number of children a structured value has, getting the name and mirror for each of those children, and a string and "IDE representation" of the value, as needed by playgrounds and by our planned generic printing facility.

In the runtime, define a "reflect" function that can provide a Mirror for any object, either using a "Reflectable" protocol conformance if available, or falling back to a magic implementation in the runtime that grovels the type metadata. Stub out a bare minimum default implementation.

Swift SVN r14139
2014-02-20 08:26:27 +00:00
Dave Abrahams
67734b1835 [stdlib] CollectionOfOne<T>
A simple collection of one element

Swift SVN r13976
2014-02-17 04:56:11 +00:00
Dave Abrahams
ea242f2238 [stdlib] Add Bit type
Will serve as an IndexType for CollectionOfOne<T>

Open Question: should this become a full-fledged Int1 type, generated by
FixedPoint.gyb?

Swift SVN r13974
2014-02-17 04:23:51 +00:00
Joe Groff
3fded63cac stdlib: Proof-of-concept 'print' implementation for an arbitrary Array.
Mock up a naive Printable protocol, and do some dirty tricks in the runtime to implement a 'printAny' function that uses swift_conformsToProtocol to look up a conformance to Printable if the type has one, or falls back to a dumb opaque printing if it doesn't. Use this to make Array<T> Printable in some way or another for all T.

Swift SVN r13902
2014-02-14 05:15:33 +00:00
John McCall
0224e93a2b Only look through UncheckedOptional<T> on explicit accesses.
Add .Some and .None members.

Swift SVN r12951
2014-01-25 03:07:30 +00:00
Jordan Rose
02e2018197 Fix many extra trailing underscores in block shim symbols.
...which would of course prevent them from being used. Sadly, this includes
the one I just added, since I didn't actually test it against the original
project until now.

Add a regression test that all block shims have valid manglings without
any unmangled suffixes.

Swift SVN r12672
2014-01-21 23:45:06 +00:00
Dave Abrahams
fb70778e35 [stdlib] Remove Obsolete CodePoints type
CodePoints was built upon StringByteData, a UTF-8 String
representation.  Its replacement is UTF16Scalars.

Swift SVN r12111
2014-01-10 01:24:25 +00:00
Dave Abrahams
bf3ca81ee7 [stdlib] File renames associated with protocol name changes
Swift SVN r12063
2014-01-08 20:06:29 +00:00
Dave Zarzycki
6e7bb68279 15763917 stdlib/POSIX should probably be removed
Foundation vends wrappers for most of this stuff anyway. We should
duplicate or "innovate" here.

Swift SVN r12002
2014-01-07 19:10:42 +00:00
Dave Abrahams
afbbbd1287 [stdlib] Add a facility for calling "C" functions that take va_list arguments
This code has only been tested on x86_64, but is designed to work on
the other platforms supported by Apple.

Swift SVN r11561
2013-12-22 02:37:33 +00:00
Dave Abrahams
549b2f1368 [stdlib] Turn the String append speed test into a reallocation test
Swift SVN r11056
2013-12-10 00:18:26 +00:00
Dave Abrahams
00e4a84b74 [stdlib] Begin exposing the NSString API directly on String
Because we're using a "brute-force" combination of conversion to
NSString and forwarding, this code will continue to work when String
is replaced by NewString.  It may not be fast yet, but at least it
will flesh out the experience for Cocoa programmers

Swift SVN r11034
2013-12-09 18:44:58 +00:00
Dmitri Hrybenko
f08ee12841 stdlib/FloatingPoint: add APIs to handle special floating point values
See IEEEFloatingPointNumber protocol for a full list of new APIs and
documentation.


Swift SVN r10826
2013-12-05 01:36:15 +00:00
Anna Zaks
b687c3ce9c Add runtime integer truncation checking to the conversion constructors
Add new builtins(by generalizing, renaming, and extending the builtins used for compile time integer literal checking). These new builtins truncate integers and check for overflow/truncation errors at runtime. Use these for FixedPoint conversion constructors.

Fix a routine in stdlib's String implementation and a test that relied on bitwise behavior of the constructors (and triggered overflows).

TODO:
- Teach CCP about these to get static checking.
- Add special builtins for same size signed <-> unsigned conversions.

Swift SVN r10432
2013-11-13 21:54:34 +00:00
Dave Abrahams
38b9e6808f [stdlib] CharacterEncoding.swift => Unicode.swift
Also enshrine the tests in the test suite

Swift SVN r10057
2013-11-08 22:17:50 +00:00
Dave Abrahams
645ce0b664 [stdlib] Add support for bound protocols
Protocols with associated types can't currently be used as existential
types.  Combined with the inability to create type constraints on
generic functions nested in generic types based on the outer type and
the inability to create closures of generic type and the inability to
create protocol constraints that require generic functions and the
inability to create protocols with init() requirements... and this is
what we get.

Swift SVN r10034
2013-11-08 06:29:29 +00:00