Commit Graph

21502 Commits

Author SHA1 Message Date
Dmitri Hrybenko
b94b1bcc65 Un-disable XCTest build that I accidentally disabled
Swift SVN r16202
2014-04-11 06:33:01 +00:00
John McCall
78506ba43e Introduce infrastructure for emitting value witness
tables for non-constant-sized types, and use it for
the existential witness tables.  NFC.

Swift SVN r16199
2014-04-11 05:22:05 +00:00
Joe Groff
f57de31a04 Reflection: Quell some build warnings.
Swift SVN r16172
2014-04-10 22:35:35 +00:00
Dmitri Hrybenko
110f85bc16 Move @exported to use new attribute infrastructure
Swift SVN r16158
2014-04-10 13:35:35 +00:00
Dave Zarzycki
d5452d84c4 SDK Overlay: Add Darwin overlay
Swift SVN r16140
2014-04-10 00:04:03 +00:00
John McCall
85a6cc1309 Make it really easy to generate value witness tables
from C++ types and aggregates thereof.

Swift SVN r16139
2014-04-10 00:01:34 +00:00
Dave Abrahams
f4b04760c8 [stdlib] Add a lazy "Map" Collection
The name may have the wrong implication to a C++'er, but the point is
that this Collection is a Lazy version of the map() function.  Maybe we
should be giving our Collections capitalized lazy versions of their
member algorithms, e.g.

  a.Map {something}

Swift SVN r16110
2014-04-09 09:43:22 +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
Dmitri Hrybenko
98c429ee2b Untabify
Swift SVN r16104
2014-04-09 07:28:59 +00:00
Dave Abrahams
de3df28a62 [stdlib] Reorganize [Native]Array/Slice code
Just moving things between files, and creating a few new source files, in
the standard library, so it's easier to find a given component.

Swift SVN r16094
2014-04-09 02:32:15 +00:00
Dave Abrahams
2adf0679a3 [stdlib] CountAndCapacity => ArrayBody
CountAndCapacity is about to become even more Array-specific, so rename
it and give it its own source file.

Swift SVN r16091
2014-04-09 01:25:03 +00:00
Chris Hanson
8ff35e9c23 Check for a proper XCTest.framework in the platform
Check whether the XCTest.framework in the platform has headers before deciding whether to look there or in the SDK for it.

Swift SVN r16084
2014-04-08 23:55:34 +00:00
Chris Hanson
0e2e76ad03 Start building XCTest overlay for all platforms again.
Swift SVN r16083
2014-04-08 23:55:33 +00:00
Dave Abrahams
27daefa878 [stdlib] Delete obsolete Array.swift
It held the old implementation and is no longer needed.

Swift SVN r16062
2014-04-08 18:41:06 +00:00
Dave Zarzycki
3e4f388b1f Runtime: allow realloc
Nothing should call this. We'll eventually log a warning. For now, this
silences a build warning.

Swift SVN r16061
2014-04-08 17:54:01 +00:00
Dave Zarzycki
2e76e91466 Runtime: corner case heap policy tweak
Only the compiler calls this API and the compiler never needs
placeholder heap allocations.

Swift SVN r16060
2014-04-08 17:54:00 +00:00
Greg Parker
0275393c6d [stdlib] Add a CoreGraphics overlay with additions to CGPoint/CGSize/CGRect.
Swift SVN r16029
2014-04-07 22:54:14 +00:00
Doug Gregor
c2f0f26ed5 Make Int, Double, and String bridge to Objective-C.
Make these three types conform to the BridgedToObjectiveC
protocol, which is needed for array bridging. This is one part of
<rdar://problem/16533359>.

Because this must happen in the Foundation module, hack
swift_conformsToProtocol to look in the Foundation module for
conformances when it can't find them in the module corresponding to
the type. This is an egregious hack to an egregious hack, but it gets
us closer.


Swift SVN r15997
2014-04-06 04:29:55 +00:00
Joe Groff
3455688cd1 Reflection: Resize our stub Array type.
The new Array is one word, not three. Fixes <rdar://problem/16533371>.

Swift SVN r15993
2014-04-06 01:36:16 +00:00
Dave Abrahams
548f3c0e81 [stdlib] Add and test single-element modifiers
Swift SVN r15978
2014-04-05 05:39:17 +00:00
Joe Groff
18f6e950a6 Reflection: Look through existential containers.
When we reflect an existential container, reflect the contained value as its dynamic type. Implements <rdar://problem/16427022>.

Swift SVN r15952
2014-04-04 20:16:47 +00:00
Doug Gregor
ba67a09362 Allow one to disable building the XCTest overlay via the CMake option SWIFT_BUILD_XCTEST.
Swift SVN r15922
2014-04-04 04:07:03 +00:00
Chris Hanson
42f36febd6 Build the XCTest overlay only for OS X for now.
Once the iOS pieces are in place we'll re-enable building for all platforms.

Swift SVN r15918
2014-04-04 02:50:25 +00:00
Chris Hanson
190c5c8477 Implement an XCTest overlay with basic assertions
Adds an overlay for Xcode's XCTest testing framework.

It implements most of the familiar test assertion macros as equivalent
Swift functions. The assertion macros that aren't currently implemented
are only those that deal specifically with floating-point equality and
Objective-C exceptions. Additionally, the implemented assertions don't
currently handle Objective-C exceptions thrown out of some code called
during an assertion as test failures.

Swift SVN r15917
2014-04-04 01:55:08 +00:00
Jordan Rose
65f82d5cc6 Update existing block shims for UncheckedOptional.
These are both past mistakes from me. One is a case of me missing the
OBJCPTR macro (which adds the UncheckedOptional bit); the other is a case
of including it when the block is actually written in Swift (and thus uses
a non-optional string).

<rdar://problem/16519094&16513659>

Swift SVN r15915
2014-04-04 01:33:32 +00:00
Greg Parker
dc237675b8 [build] Fix SpriteKit linkage.
Swift SVN r15892
2014-04-03 20:31:39 +00:00
Greg Parker
82b8247a21 [build] SpriteKit depends on AppKit or UIKit.
Swift SVN r15889
2014-04-03 18:14:24 +00:00
Greg Parker
6d6d6896d2 Add SpriteKit overlay with a typealias for SKColor.
Swift SVN r15849
2014-04-02 23:46:56 +00:00
Adrian Prantl
af7198811c silence warnings.
Swift SVN r15839
2014-04-02 22:54:34 +00:00
Dave Zarzycki
43680748d5 Runtime: more dead code deletion
Swift SVN r15834
2014-04-02 21:39:51 +00:00
Dave Zarzycki
30e6d1de98 Runtime: remove dead _ObjCSuperClassHack
Swift SVN r15832
2014-04-02 21:30:31 +00:00
Dave Zarzycki
4c97c67a82 Runtime: remove stray debugging hook
Swift SVN r15819
2014-04-02 18:46:02 +00:00
Dave Zarzycki
96d1f4760e Runtime heap: mixed fixes that make debugging easier
Swift SVN r15818
2014-04-02 18:46:00 +00:00
Dave Zarzycki
e1a60eae86 Runtime: Use 'auto' more. NFC.
Swift SVN r15817
2014-04-02 18:45:59 +00:00
John McCall
1071ac6d05 Update standard library and test suite for importing
ObjC pointer types as UncheckedOptional.

Some of these changes are totally necessary; others may
simply reflect language/implementation work that hasn't
been done yet.

If anything seems particularly objectionable, bugs welcome.

Swift SVN r15783
2014-04-02 09:37:14 +00:00
Dave Abrahams
dd96f5f082 [stdlib] Give ArrayBufferType its own file
Swift SVN r15770
2014-04-02 02:47:39 +00:00
Dave Abrahams
079821c8cc [stdlib] Start generating actual (new) Array types
Swift SVN r15769
2014-04-02 02:47:38 +00:00
Dave Abrahams
004998e63e [stdlib] Move SliceBuffer into its own file
Swift SVN r15766
2014-04-02 02:47:34 +00:00
John McCall
f1180f5e6d in order to work correctly for non-@objc protocols.
Language features like erasing concrete metatype
values are also left for the future.  Still, baby steps.

The singleton ordinary metatype for existential types
is still potentially useful; we allow it to be written
as P.Protocol.

I've been somewhat cavalier in making code accept
AnyMetatypeType instead of a more specific type, and
it's likely that a number of these places can and
should be more restrictive.
When T is an existential type, parse T.Type as an
ExistentialMetatypeType instead of a MetatypeType.

An existential metatype is the formal type
 \exists t:P . (t.Type)
whereas the ordinary metatype is the formal type
 (\exists t:P . t).Type
which is singleton.  Our inability to express that
difference was leading to an ever-increasing cascade
of hacks where information is shadily passed behind
the scenes in order to make various operations with
static members of protocols work correctly.

This patch takes the first step towards fixing that
by splitting out existential metatypes and giving
them a pointer representation.  Eventually, we will
need them to be able to carry protocol witness tables

Swift SVN r15716
2014-04-01 00:38:28 +00:00
Dave Zarzycki
d8e39d106a Runtime: finish SwiftObject
<rdar://problem/12640667> Implement SwiftObject root class

Swift SVN r15706
2014-03-31 23:10:39 +00:00
Dave Zarzycki
0e8de87f05 Runtime: more SwiftObject API completeness
Swift SVN r15696
2014-03-31 22:50:19 +00:00
Dave Zarzycki
09f2e9ed57 WIP Runtime: Zone cleanup to use C++ more. NFC.
All of the malloc zone APIs are clumsy object-oriented design in C, but that
does not mean we should be too. This should clarify the design more too.

Swift SVN r15690
2014-03-31 20:06:16 +00:00
Dave Abrahams
800cba5125 [stdlib] Bring most of ArrayType into the stdlib
The ArrayType protocol is developed for NewArray is a good basis for
what we want, but the ability to create arrays without value semantics
is adding complexity but questionable value.  It isn't clear that we can
usefully expose a type called SharedArray<T>, even internally, if it
ceases to be truly shared when one copy grows, and therefore has its
buffer reallocated. Therefore, leave the NewArray test with a
ArrayType2, a refinement of ArrayType, that adds the ability to report
on its value semantics.

If we really want the optimizations that can be had in a large-scale
mutation by first unique'ing the array and making mutations in-place
thereafter, we can fall back to operating on NativeArrayBuffer<T>
directly.

Swift SVN r15673
2014-03-31 08:42:55 +00:00
John McCall
9490da8a1f Inform the runtime that metatype values have extra inhabitants.
Swift SVN r15665
2014-03-31 05:49:18 +00:00
Michael Gottesman
c98c4d54b1 Move Benchmark.swift out of the stdlib now that we can deserialize from the stdlib.
rdar://15797364.

Swift SVN r15636
2014-03-29 22:19:34 +00:00
Dave Abrahams
9ef1ba13c0 [stdlib] Rename file ArrayBridge => ArrayCore
Swift SVN r15618
2014-03-29 10:43:45 +00:00
Dave Zarzycki
095633f4ba Runtime: Enable Instruments object lifecycle support
One needs to either set SWIFT_ZONE_DEBUG before launch or call SPI.

Swift SVN r15586
2014-03-28 20:46:40 +00:00
Dave Zarzycki
ce0c5899d8 Runtime: crude enumeration to generate statistics
This is foundational work for 'leaks', etc.

Swift SVN r15490
2014-03-26 06:13:03 +00:00
Joe Groff
f2ed6dd49b Reflection: Add additional dispositions and an 'AttributedString' QuickLookObject case.
<rdar://problem/16412965> and <rdar://problem/16413366>.

Swift SVN r15438
2014-03-25 02:55:20 +00:00
Dave Abrahams
29c004d516 [stdlib] NewArray slicing, finally
More tests are needed, but the basics are there

Swift SVN r15413
2014-03-24 15:52:07 +00:00