Commit Graph

442 Commits

Author SHA1 Message Date
Dmitri Hrybenko
51e236c609 stdlib: rename Array's generic parameter from T to Element
Same for ArraySlice and ContiguousArray.

Part of rdar://21429126

Swift SVN r29618
2015-06-24 20:41:49 +00:00
Doug Gregor
17884f173a Stop declaring function parameters without names, e.g., "func f(Int)".
Swift SVN r29607
2015-06-24 16:01:31 +00:00
Dmitri Hrybenko
30698410b1 SDK overlay: simplify implementations of unavailable functions
Swift SVN r29501
2015-06-19 01:04:06 +00:00
Dmitri Hrybenko
d46cb9db6e Foundation overlay: remove initWithObjectsAndKeys:_,...
<rdar://problem/21384187> NSDictionary's convenience init(objects:
[AnyObject], forKeys keys: [AnyObject]) is unsound

This method is unsound / unsafe for Swift.  There is not a way to
correctly express the alternating variadic type constant:
AnyObject, NSCopying,...

The overlay already defines a tuple based method that serves the same
role.

Patch by Michael J LeHew Jr.

Swift SVN r29497
2015-06-18 23:24:19 +00:00
John McCall
62fd20393c Make _swift_allocNilObjCError public so that it can actually
be found by the runtime.

Fixes rdar://21184674, at least as long as your application
links against the Foundation overlay.

Swift SVN r29460
2015-06-17 22:17:49 +00:00
Jordan Rose
5bbc879dc8 Fix simd overlay after previous revert.
I guess I missed this configuration, sorry.

Swift SVN r29445
2015-06-17 05:19:54 +00:00
Jordan Rose
99768eb346 Revert "Switch overlays from using @exported to -import-underlying-module."
This reverts r29441 because it breaks the Linux build. I'll talk to Dmitri
about this tomorrow.

See rdar://problem/21254367

Swift SVN r29444
2015-06-17 05:02:21 +00:00
Jordan Rose
c8bfc87c4e Switch overlays from using @exported to -import-underlying-module.
Some day we'll close the hole for @exported in the previous commit.

Swift SVN r29441
2015-06-17 04:48:06 +00:00
Jordan Rose
955e130536 Diagnose self-imports of the module being compiled.
The case where this comes up is when people name their app and framework
targets the same thing, or when they've renamed their test target module
in an attempt to avoid issues with  NSClassFromString and differing
runtime names. We currently do various wrong things when this happens,
so just emit an error instead.

I left a hole for our overlays, which use '@exported import <the-current-module>'
to get at their Clang modules. The previous commit means this can be
replaced by -import-underlying-module, but that doesn't help our tests,
which use -enable-source-import for their overlays. Which we should stop doing.

rdar://problem/21254367

Swift SVN r29440
2015-06-17 04:48:01 +00:00
Jordan Rose
ff7c3f0c6a Make overlay dependencies explicit.
-import-underlying-module deliberately avoids autolinking against that module,
since normally it's used when building the Swift half of a single binary.
For the overlays, however, that's not what we want, so add the underlying
framework explicitly.

Swift SVN r29439
2015-06-17 04:47:58 +00:00
Jordan Rose
d3291512db Make the 'simd' module build like the rest of the overlays.
At one point we were considering it to be a replacement rather than an
overlay, but that's not where we are today. We can revisit that later.

Necessary for next commit.

Swift SVN r29438
2015-06-17 04:47:55 +00:00
Dmitri Hrybenko
87ec098e2b watchSimulator ABI: Change ObjCBool from Int8 to Bool
Depends on a clang change to target info, and an objc4 change to the
Objective-C headers, which accomplish the actual ABI change for Swift.Bool.
This commit updates ObjCBool and adds a test.

rdar://problem/21294221

Patch by Ben Langmuir.

Swift SVN r29423
2015-06-17 01:36:22 +00:00
Chris Lattner
3be5bfa88a revert accidental commit in r29419
Swift SVN r29420
2015-06-17 01:01:45 +00:00
Chris Lattner
6b3167ab36 enhance fixItRemove() to be a bit more careful about what whitespace it leaves around:
if the thing it is removing has leading and trailing whitespace already, this nukes
an extra space to avoid leaving double spaces or incorrectly indented results.  This
fixes <rdar://problem/21045509> Fixit deletes 'let' from non-binding 'if case let' statements, but leaves an extra space



Swift SVN r29419
2015-06-17 00:55:59 +00:00
Dmitri Hrybenko
adda8a980d Foundation overlay: add throwing and generic variants for NSCoder APIs
rdar://21166220

Swift SVN r29415
2015-06-17 00:27:22 +00:00
Doug Gregor
57ee3c68a1 watchOS: Disable autolinking against CoreText in PassKit/UIKit/WatchKit overlays.
Addresses a bitcode linking problem when linking with the SDK overlays,
which are built against the internal SDK, against a program built
against the public SDK, which does not have
CoreText. rdar://problem/21246363

Swift SVN r29395
2015-06-15 23:43:37 +00:00
Joe Groff
d7b9ae72aa Sema: Require '.init' when constructing from a dynamic metatype.
This makes it clearer that expressions like "foo.myType.init()" are creating new objects, instead of invoking a weird-looking method. The last part of rdar://problem/21375845.

Swift SVN r29375
2015-06-14 19:50:06 +00:00
Joe Groff
556c849530 Undo local hack
Swift SVN r29309
2015-06-04 21:31:33 +00:00
Joe Groff
1ab995b477 Runtime: Don't try to reuse integer value witnesses for under-aligned tuples.
Fixes rdar://problem/20891471.

Swift SVN r29308
2015-06-04 21:24:45 +00:00
Dmitri Hrybenko
76e9ab86b0 stdlib: expand an abbreviation in an internal function
Swift SVN r29270
2015-06-03 03:48:58 +00:00
Dmitri Hrybenko
687a70428d Fix a warning in the SDK overlay
This change was committed and reverted multiple times over the past
month, but now it is safe since we have bumped the minimum required
SDKs.

Swift SVN r29269
2015-06-03 03:17:30 +00:00
Dmitri Hrybenko
cd968aa164 HomeKit overlay: adjust for new SDK
Swift SVN r29251
2015-06-02 20:59:01 +00:00
Greg Parker
fe303f13e1 [stdlib] Fix vararg processing on armv7k.
rdar://21142268


Swift SVN r29243
2015-06-02 18:21:04 +00:00
Joe Groff
c104acfc18 Enable NSError bridging code blocked by rdar://problem/21027215.
Swift SVN r29210
2015-06-01 22:04:22 +00:00
Dmitri Hrybenko
20e0a04367 Foundation overlay: make registerUndoWithTarget work with Swift classes
Patch by Michael LeHew Jr.

rdar://21177512

Swift SVN r29200
2015-06-01 18:02:16 +00:00
Dmitri Hrybenko
29ec6ab6b5 Re-enable the XCTest overlay for OSX
And add the first smoketest for the XCTest overlay to prevent
regressions in future.

Swift SVN r29197
2015-06-01 01:09:31 +00:00
Dmitri Hrybenko
98cc02dd4f UIKit overlay: fix a warning
Swift SVN r29163
2015-05-30 03:20:51 +00:00
Dmitri Hrybenko
e878cdc153 Don't build the XCTest overlay for watchOS
XCTest for watchOS is not present in the public SDK.

Swift SVN r29156
2015-05-29 23:47:35 +00:00
Ted Kremenek
2b77b21e63 Revert "Revert "Use signed char for 32-bit Watch Simulator""
Swift SVN r29153
2015-05-29 19:19:42 +00:00
Ted Kremenek
8afb67bcf1 Revert "Use signed char for 32-bit Watch Simulator"
Speculatively reverting because the Jenkins iOS bots are broken.

Swift SVN r29142
2015-05-29 14:11:14 +00:00
David Farler
812ac37a7f Use signed char for 32-bit Watch Simulator
For integral types, the WatchKit remote procedure call mechanisms only
consider signed numbers (rdar://problem/21153645) and the boolean
type. We were incorrectly assuming that all bools are i1, even on
platforms where bool maps to signed char, such as armv7k, arm64, and
iOS x86_64.

Mark Objective-C type encoded strings that bool -> signed char
when Clang says so.

Fixes: rdar://problem/21129609
See Also: rdar://problem/21131808

Swift SVN r29141
2015-05-29 08:17:25 +00:00
Dmitri Hrybenko
0735aa581e stdlib: don't build AssetsLibrary for tvOS
The public SDK does not contain it.

Swift SVN r29113
2015-05-28 21:06:25 +00:00
Jordan Rose
2831e8481c Update AppKit overlay to match AppKit headers.
NSGradient.init(colorsAndLocations:) is now failable.

Swift SVN r29092
2015-05-28 00:54:04 +00:00
Dave Abrahams
1175d3602c [stdlib] Underscore the legacy Reflectable protocol
We don't want anyone using this and hope to remove it before GM, so
let's at least make its imminent death more obvious.

Swift SVN r29075
2015-05-27 20:59:24 +00:00
David Farler
fb6cef4585 Build fix: GameKit depends on SpriteKit and GameplayKit
rdar://problem/21117165

Swift SVN r29059
2015-05-27 05:02:27 +00:00
Dmitri Hrybenko
4f464763cd stdlib: note that the CFXyzCreateCopy bugs were fixed
Since Swift deploys back to OS X 10.9 and iOS 7.0, we should continue to
use the API that works everywhere.

Swift SVN r29057
2015-05-27 04:20:51 +00:00
Devin Coughlin
d6b3a2d75e WatchKit Overlay: Add availability and temporarily disable availability checking
The <Redacted>13A261 iOS SDK adds an availability attribute marking the imported
WatchKitErrorCode enum as available only on iOS 8.2 and newer. The WatchKit overlay
has a protocol extension for WatchKitErrorCode, so mark the extension as only available
on 8.2 and newer. On <Redacted>13A261 this silences a diagnostic complaining that
WatchKitErrorCode is only available on 8.2 and newer.

However, on <Redacted>13A254 this new annotation itself causes an error because on that
SDK WatchKitErrorCode claims to be available on all iOS versions and yet the conformance
would only hold on 8.2 and newer. To make this second diagnostic go away, this
commit temporarily disables availability checking for the WatchKit overlay.
rdar://problem/21099550 tracks re-enabling availability checking when we update the bots,
etc. to <Redacted>13A261.

rdar://problem/21098396

Swift SVN r29026
2015-05-26 05:47:56 +00:00
Dmitri Hrybenko
63c1b4d9e8 UIKit overlay: on watchOS, don't use unavailable types
Imitates the important effects of rdar://20989733

Swift SVN r29022
2015-05-26 04:24:18 +00:00
Dmitri Hrybenko
1058f68bc6 Foundation overlay: add overlays for new NSString APIs
rdar://20856757

Swift SVN r29019
2015-05-26 03:29:01 +00:00
Doug Gregor
7cc0e4b72c PassKit no longer needs to link against Contacts
Swift SVN r29005
2015-05-25 05:15:05 +00:00
Doug Gregor
186fe53f74 Eliminate the NSError -> error enum bridging from Contacts.
CNErrorDomain is lacking proper availability annotations, and
explicitly linking with -weak_framework is not working reliably. For
now, just remove the overlay to solve rdar://problem/21030937. We'll
bring it back when rdar://problem/21032649 makes it into all of the
builds we care about.

Swift SVN r29003
2015-05-25 04:47:15 +00:00
Ted Kremenek
a2c4ea971f Revert "Foundation overlay: add overlays for new NSString APIs"
Revert until our Jenkins devices support the underlying NSString API.  Keeping
this blocks iOS testing.

Swift SVN r28987
2015-05-24 16:55:25 +00:00
Dmitri Hrybenko
d45413efb8 Foundation overlay: add overlays for new NSString APIs
Swift SVN r28984
2015-05-24 10:39:21 +00:00
Doug Gregor
d1c25ddeb9 Add missing dependency: XCTest depends on AppKit or UIKit.
Swift SVN r28947
2015-05-23 03:40:35 +00:00
Ted Kremenek
f750954a53 Make scalar arguments to SIMD vector initializers anonymous.
Patch by Steve Canon.

Swift SVN r28932
2015-05-22 20:39:28 +00:00
Joe Groff
72d82d1808 Darwin/Glibc overlays: Conditionalize SIG_* tokens.
Darwin libc and glibc use different typedefs for the signal handler type, and SIG_HOLD has different values. Conditionalize the definitions in their respective overlays.

Swift SVN r28921
2015-05-22 17:02:00 +00:00
Joe Groff
db13a714ba Darwin overlay: Add SIG_* constants.
Swift SVN r28919
2015-05-22 15:04:50 +00:00
Joe Groff
32fb006386 Clang Importer: Enable OptionSetType import.
Update the tests to match.

Swift SVN r28906
2015-05-22 05:47:37 +00:00
Dmitri Hrybenko
2e67af546b Add the file I forgot to commit in r28833
Swift SVN r28837
2015-05-20 18:31:26 +00:00
Dmitri Hrybenko
3cc2161e6f SDK overlay: add generic API overlays for NSUndoManager
Patch by Michael J LeHew Jr.

Swift SVN r28833
2015-05-20 18:02:00 +00:00