Commit Graph

88 Commits

Author SHA1 Message Date
Dave Abrahams
a8bbc4c89b [stdlib] String internal API review changes
I had to XFAIL test/ClangModules/cf.swift, which is failing for reasons
I can't understand.  <rdar://problem/16911496>

Swift SVN r18071
2014-05-14 14:18:52 +00:00
Dmitri Hrybenko
eb9c3a406d stdlib/runtime: implement bridgeFromObjectiveC()
Swift SVN r18070
2014-05-14 13:40:46 +00:00
Ted Kremenek
9eea282719 Switch range operators ".." and "...".
- 1..3 now means 1,2
- 1...3 now means 1,2,3

Implements <rdar://problem/16839891>

Swift SVN r18066
2014-05-14 07:36:00 +00:00
Enrico Granata
8478cd9905 Add a mirror for NSSet
Part of the playgrounds effort



Swift SVN r18038
2014-05-13 23:20:32 +00:00
Doug Gregor
d5a9c2ab94 Only supersede initializers with other imported initializers when the types match.
This fixes a case where the Swift-variadic and C-varargs versions of
various initializers were superseding each other
<rdar://problem/16801456>.

It also uncovered some more cases where we weren't getting quite the
right semantics for factory-methods-as-initializers, which are also
fixed here.

Swift SVN r18010
2014-05-13 16:49:39 +00:00
Dmitri Hrybenko
de9a0c8ff0 stdlib/printing: remove ReplPrintable protocol
It is replaced by debugPrint() family of functions, that are called by REPL.

There is a regression in printing types that don't conform to Printable, this
is tracked by rdar://16898708


Swift SVN r18006
2014-05-13 16:22:56 +00:00
Dmitri Hrybenko
2cc8fe40d4 stdlib/printing: replace four printing systems with one new one
The old ones were:

- print/println
- printAny
- printf
- Console

The new printing story is just print/println.  Every object can be printed.
You can customize the way it is printed by adopting Printable protocol.  Full
details in comments inside stdlib/core/OutputStream.swift.

Printing is not completely finished yet.  We still have ReplPrintable, which
should be removed, string interpolation still uses String constructors, and
printing objects that don't conform to Printable will result in printing
mangled names.


Swift SVN r18001
2014-05-13 13:07:59 +00:00
Doug Gregor
795f568898 Start diagnosing the use of '`' rather than '#', with a Fix-It.
<rdar://problem/16891828>.

Swift SVN r17982
2014-05-13 00:03:05 +00:00
Doug Gregor
1efd9fba5b Start accepting '#' in addition to '`' to mark a keyword argument <rdar://problem/16891828>.
Update the standard library, tests, diagnostics, and Fix-Its.

Swift SVN r17981
2014-05-13 00:03:04 +00:00
Doug Gregor
93f7ac2e48 Fix the name of the initializer for initWithObjectsAndKeys.
Swift SVN r17974
2014-05-12 23:21:44 +00:00
Doug Gregor
73528dc0e0 Enable importing factory methods as initializers by default.
Finishes <rdar://problem/16509024>.

Swift SVN r17972
2014-05-12 23:01:20 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Jordan Rose
d410bd0acd [CMake] Re-enable -autolink-force-load to cause the buildbot to fail.
I can't reproduce this locally, so I'll need to run this on the buildbot
and inspect the output.

Swift SVN r17795
2014-05-09 19:11:11 +00:00
Greg Parker
fba2e4bd7c Add overlay covers for DISPATCH_QUEUE_CONCURRENT and DISPATCH_SOURCE_TYPE_*.
Swift SVN r17766
2014-05-09 07:06:10 +00:00
Argyrios Kyrtzidis
786ab593dd Revert "[CMake] Build the SDK overlays with -autolink-force-load."
This reverts commit r17752, because it caused link failures of Interpreter and stdlib tests.

Swift SVN r17758
2014-05-09 04:02:54 +00:00
Jordan Rose
20fb4513e2 [CMake] Fix dependencies for swiftDispatch.
Without proper dependencies among the overlays, we may try to load an
outdated overlay module while building another overlay.

Swift SVN r17753
2014-05-09 01:20:34 +00:00
Jordan Rose
90c5fbe029 [CMake] Build the SDK overlays with -autolink-force-load.
Final part of <rdar://problem/16829587>

Swift SVN r17752
2014-05-09 01:20:33 +00:00
Argyrios Kyrtzidis
4f0776936a [stdlib] Dispatch depends on Darwin.
Swift SVN r17749
2014-05-09 01:04:44 +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
Ted Kremenek
05e9efb093 Don't compile XCTest overlay as being Application Extension safe.
Swift SVN r17682
2014-05-08 04:49:00 +00:00
Ted Kremenek
3d248270ca Add prototype for KVO API overlay ("KVOContext") to NSObject, and provide test case.
This change adds a new variant of "addObserver:forKeyPath:options:context:"
that takes a "KVOContext" instead of an unsafe void*.  The variant
delegates to the original method, but first 'retain's the object
before turning it into an unsafe pointer.  The API is then matched
with a variant of 'removeObserver:forKeyPath:context:' which
delegates to the original method and then 'release's it.

This vision here is that Swift clients of this API will use this
variant, and not the unsafe one.  A refinement (later) is to
not expose the original methods at all, and provide a new method
'observeValueForKeyPath:ofObject:change:kvoContext:' that implements
a thunk that delegates to 'observeValueForKeyPath:ofObject:change:context:'
and does the void* cast (which the code in the test case does).

This needs to go through API review; names are strawman names.

Swift SVN r17325
2014-05-03 20:06:28 +00:00
Joe Groff
5ea0a0734e UIKit overlay: Add our own designated initializers for UIActionSheet and UIAlertView.
The true designated initializers take a variadic argument, which we can't directly support in Swift, so we'll map those definitions to refer to versions that drop the variadic parameters altogether, and reimplement the variadic interface in the overlay.

Swift SVN r16711
2014-04-23 19:52:39 +00:00
Argyrios Kyrtzidis
65971bc7f4 [CMake] ObjectiveC module depends on the Darwin one.
Swift SVN r16675
2014-04-22 23:48:26 +00:00
Dmitri Hrybenko
b94b1bcc65 Un-disable XCTest build that I accidentally disabled
Swift SVN r16202
2014-04-11 06:33:01 +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
Dmitri Hrybenko
98c429ee2b Untabify
Swift SVN r16104
2014-04-09 07:28:59 +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
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
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
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
Jordan Rose
dbf3c64b28 Revert "[CMake] Clear the Clang module cache before building the ObjectiveC overlay."
This broke systems where it isn't appropriate to clear the module cache.
The build script already does this when you do a full build; for other
cases, we should just deal with it. (You can still specify a custom
MODULE_CACHE_PATH to make it easier to delete, rather than relying on the
system one.)

This reverts commit r14364.

<rdar://problem/16232176>

Swift SVN r14872
2014-03-10 18:01:01 +00:00
Joe Groff
da7880b0e4 Drop unnecessary 'swift_compareObjects' and 'swift_hashObject' stubs.
Swift SVN r14769
2014-03-07 03:21:32 +00:00
Dave Abrahams
b0b08887e1 [stdlib] Remove unused BridgeObjectiveC.mm
Swift SVN r14652
2014-03-04 21:19:53 +00:00
Joe Groff
c572cc222c Revert "stdlib: Push '===' for AnyObject into stdlib/core."
This reverts commit r14646. It exposes an optimizer bug.

Swift SVN r14649
2014-03-04 17:39:15 +00:00
Joe Groff
5634ff5e67 stdlib: Push '===' for AnyObject into stdlib/core.
And drop the 'Identifiable' protocol.

Swift SVN r14646
2014-03-04 17:04:50 +00:00
Ted Kremenek
028f9d0561 Remove rest of Makefile build except for 'docs' and 'www'.
For 'docs' and 'www' it is possible these are still being used,
as they work independent of the Makefile build.  Keeping them for now.

Swift SVN r14418
2014-02-26 22:21:25 +00:00
Jordan Rose
90f90c7fdd [CMake] Clear the Clang module cache before building the ObjectiveC overlay.
This will catch almost all module cache errors during compiler / stdlib
development, at the cost of slowing down rebuilds of the overlay modules
a bit.

Swift SVN r14364
2014-02-26 01:12:19 +00:00
Jordan Rose
335ceb2f57 Re-enable the new Swift driver.
This re-applies r13380, reverted in r13406. I don't think this actually
caused any harm (r13400 was the primary culprit), but if it did I'd
like to actually see the buildbots or someone else's machine fail on it.

Swift SVN r13456
2014-02-05 00:09:00 +00:00
Dave Abrahams
01e9139944 Revert "Enable the new Swift driver!"
This reverts r13380, which broke the build

Swift SVN r13406
2014-02-04 06:13:58 +00:00
Jordan Rose
16b5a57838 Enable the new Swift driver!
This substitutes swift_driver in as the new "swift". Tests that currently
test "%swift" will invoke "swift -frontend", much like "clang -cc1".
Most command-line interaction will look the same, except that Swift can
now emit linked libraries (using -emit-library) and executables (using
-emit-executable, or by not passing a mode option at all).

If you are working with @transparent functions, note that they will not be
properly inlined across file boundaries unless you use
-force-single-frontend-invocation, which emulates the old swift binary.
There are Radars for this already: <rdar://problem/15366167&15693042>

The name 'swift_driver' is now a symlink for 'swift'. This will be removed
next week.

The old 'swift' is still available as 'swift_old', though it is not being
tested at all. This will be removed in two weeks.

Clean CMake builds will get this immediately.

Incremental CMake builds will not get the new driver unless you explicitly
enable the SWIFT_NEW_DRIVER option (-DSWIFT_NEW_DRIVER=ON on the command line).
This option will go away in a week.

Makefile builds will get this immediately because I didn't want to work out
how to maintain both modes.

Much credit to Connor for bringing up the entire driver and for doing much
of the work in ensuring that all the tests continue to pass.

Swift SVN r13380
2014-02-03 22:48:39 +00:00
Greg Parker
95c2fc43f8 Clena up some 32/64 mismatches. Remove some dead posix stubs.
Swift SVN r13144
2014-01-30 09:34:26 +00:00
Doug Gregor
eaf3e5c68d Move nil/_Nil into the core library and add UnsafePointer<T> support.
Fixes <rdar://problem/15933510>.


Swift SVN r13094
2014-01-29 06:30:28 +00:00
Greg Parker
d9fbea1eff [stdlib] Commit file deletions that were left out of r12732.
Swift SVN r12734
2014-01-22 08:43:27 +00:00
Greg Parker
71c3beb7af [stdlib] Fix ObjCBool definition selection: 32-bit iOS uses BOOL=char.
Swift SVN r12732
2014-01-22 08:28:04 +00:00