Commit Graph

442 Commits

Author SHA1 Message Date
Slava Pestov
ac6de62b66 Build the Dispatch overlay on Linux
This is an optional feature that is off by default, and is enabled by
passing -- -build-swift-dispatch-overlay=1 to utils/build-script.

The libdispatch build I was testing with was old and is missing some
symbols, so perhaps some of the stuff can move out of #if protection
later.

There isn't much here yet, and no tests either.
2015-11-05 14:18:19 -08:00
Jordan Rose
6e1bf0d10d Rename @exported to @_exported for now.
At some point I want to propose a revised model for exports, but for now
just mark that support for '@exported' is still experimental and subject
to change. (Thanks, Max.)
2015-11-05 11:59:00 -08:00
Enrico Granata
cd26857b0a Take 2 - make NSObject conform to CustomDebugStringConvertible
Comes with a test case, and should now work since Jordan fixed the deserialization test case!



Swift SVN r32948
2015-10-28 21:49:25 +00:00
Enrico Granata
1f04d0955d Revert my previous commit as it breaks the buildbots
Swift SVN r32912
2015-10-27 17:24:57 +00:00
Enrico Granata
daea9036e5 Make NSObject conform to CustomDebugStringConvertible
NSObject vends a debugDescription member, but it was not marked accordingly in the overlay



Swift SVN r32904
2015-10-27 00:51:13 +00:00
Dmitri Hrybenko
8df3dd331e Remove standard library hooks for AppKit apps in the integrated REPL
The REPL code can be simplified now.

Swift SVN r32882
2015-10-25 08:27:42 +00:00
Dmitri Hrybenko
2e51d23875 Un-ifdef object literals
Swift SVN r32880
2015-10-25 07:50:53 +00:00
Dave Abrahams
b3ca7eed40 gyb parsing fixes
Fixes <rdar://problem/18900352> gyb miscompiles nested loops

Swift SVN r32863
2015-10-24 04:47:57 +00:00
David Farler
fb2381124b Fix CoreMedia CMTimeRange overlay != operator
This was ... returning the same thing as the == operator.

Also, integrate the CoreMedia overlay tests from
rdar://problem/20926198, which caught this problem, and port it
to StdlibUnittest.

Swift SVN r32484
2015-10-07 01:27:36 +00:00
Dmitri Hrybenko
6536edd68c stdlib: fix coding style
Swift SVN r32425
2015-10-03 21:13:15 +00:00
Dave Abrahams
7985035342 Squash a warning
Swift SVN r32306
2015-09-29 21:28:50 +00:00
Dmitri Hrybenko
03d3e4d2eb SDK overlay: LAErrorDomain not actually available on 8.0-8.2, adjust availability
rdar://22755624

Swift SVN r32259
2015-09-26 07:37:29 +00:00
Dmitri Hrybenko
4375a463a7 stdlib: rename Int**.value and Float**.value to _value per naming convention
rdar://21357661

Swift SVN r32096
2015-09-20 00:01:13 +00:00
Dmitri Hrybenko
0a22034d65 GameplayKit overlay: add explicit tvOS availability
rdar://22707844

Patch by Dave Schaefgen.

Swift SVN r31970
2015-09-15 20:41:18 +00:00
Jordan Rose
845513d359 [ClangImporter] Always treat dispatch_block_t as @convention(block).
Some GCD APIs rely on the pointer identity of blocks, so avoid bridging
when possible. The easiest way to do this was to use our existing rules
for special-casing typedefs.

The summary text for dispatch_block_t comes from the actual GCD headers.

rdar://problem/22432170

Swift SVN r31634
2015-09-02 18:31:51 +00:00
Dmitri Hrybenko
6402fda0c5 stdlib: remove a bunch of dynamic initializers from the library and overlays
Swift SVN r31403
2015-08-22 04:51:39 +00:00
Dmitri Hrybenko
36620d8229 stdlib: add an overlay for sem_open(), which is variadic in C
Patch by Mish Awadah.

Swift SVN r31397
2015-08-21 22:25:32 +00:00
Dmitri Hrybenko
c93bf3bbf0 stdlib: remove 58 global initializers from the Darwin overlay
This change removes the global initializers, but the constants are
still not inlineable.  Filed rdar://22384493 for that.

Swift SVN r31390
2015-08-21 21:05:38 +00:00
Dmitri Hrybenko
f7c0c57214 stdlib: remove emacs commands left over from this file being a gyb file
Swift SVN r31386
2015-08-21 18:44:26 +00:00
Jordan Rose
5a82ddfd08 [ClangImporter] If a name contains "unsigned", import NSUInteger as UInt.
This takes care of things like NSNumber's 'init(unsignedInteger:)' and
'unsignedIntegerValue'.

rdar://problem/19134055

Swift SVN r31354
2015-08-19 22:10:48 +00:00
Jordan Rose
53b1cf2b09 [CMake] Fix dependencies for CloudKit.
...which unfortunately meant splitting tvOS out from iOS.

Swift SVN r31343
2015-08-19 20:57:02 +00:00
David Farler
9e4d52c9cb Reinstate watchOS and other SDK overlays to build against the public SDKs.
Un-revert the below commits with the following addition:
add declarations for posix_spawn related APIs to SwiftPrivateDarwinExtras.
posix_spawn-related APIs aren't available in the public SDKs, so force past
the availability by creating our own stubs in the internal DarwinExtras
library.

r31244, r31245

CMake: build all platforms except watchOS using the public SDK

Covers rdar://problem/21145996.
A step towards rdar://problem/21099318.

Switch SDK overlays to use the public SDK

I had to cut the dependency on CrashReporterClient.h and reimplement
some of that code inline in the Swift runtime.  This shoud be OK (even
though not very clean), since the layout of CrashReporter sections is
ABI.

rdar://21099318

Swift SVN r31252
2015-08-14 22:09:49 +00:00
Dmitri Hrybenko
c75fc00cec Revert "CMake: build all platforms except watchOS using the public SDK"
This reverts commit r31244.  It broke the buildbot.

Swift SVN r31247
2015-08-14 18:56:15 +00:00
Dmitri Hrybenko
dd38372fb7 CMake: build all platforms except watchOS using the public SDK
Covers rdar://problem/21145996.
A step towards rdar://problem/21099318.

Swift SVN r31244
2015-08-14 17:26:04 +00:00
Chris Willmore
51f08e0285 Add FileReference object literals and _FileReferenceLiteralConvertible protocol.
<rdar://problem/21781451> Add file literal to Swift

Swift SVN r31232
2015-08-13 22:38:55 +00:00
Chris Willmore
e4ff8fdc05 Make image literals non-optional by routing delegation of non-failable
literal initializer to underlying failable initializer through
implicitly-failable initializer (proper solution is covered in
22276505).

<rdar://problem/20788137> Image literals should not be optional

Swift SVN r31229
2015-08-13 22:11:47 +00:00
Dave Abrahams
146d2daa9d [stdlib] Add missing nullability to reflected NSString API
getBytes still lacks the ability to take an optional buffer, but Ali
agrees that we can leave that off for this release in light of the fact
that we have lengthOfBytesUsingEncoding.

Swift SVN r31223
2015-08-13 20:11:40 +00:00
Dmitri Hrybenko
a067fb004c stdlib: re-add the part of the comment that was dropped during a refactoring
Swift SVN r31194
2015-08-12 23:41:58 +00:00
Dave Abrahams
06bb06452b [stdlib] String.init(data: NSData, encoding: UInt)
Fixes <rdar://19872780>

Swift SVN r31191
2015-08-12 21:44:13 +00:00
Dave Abrahams
a8d56c3f54 [stdlib] Shuffle methods to keep comments in sync
Swift SVN r31190
2015-08-12 21:44:09 +00:00
Jordan Rose
1f0d262425 SDK overlay: weak-link to frameworks introduced since our API sunset.
Apps don't weak-link our overlays today, so if the overlays strong-link
to frameworks apps won't launch on older OSs. This was causing failures
on the buildbot, but is actually a serious issue for our developers.

Swift SVN r31180
2015-08-12 18:30:13 +00:00
Michael Gottesman
c6f96ea036 Sorry did not mean to commit this.
Swift SVN r31168
2015-08-12 05:31:51 +00:00
Michael Gottesman
8759b79d79 [arc] When checking if a BB is an ARC Inert Trap BB, first check if the end is unreachable before you do anything further.
This inefficient call took up 8-9% of the compile time of Global ARC Opts when
compiling a release no-assert stdlib with a release compiler with assertions.

NFC.

<rdar://problem/22244924>

Swift SVN r31167
2015-08-12 05:31:19 +00:00
Jordan Rose
ff7b6b74fe Foundation overlay: Add a generic NSCoder.decodeObjectOfClass(_:forKey:).
Like decodeTopLevelObjectOfClass(_:forKey:), this API works very nicely
as a generic method in Swift, and this one is actually the one we expect
to be commonly used. One thing to note here is that these methods are
stricter than their ObjC counterparts: they will do a forced checked cast
even when the unarchiver does not use "secure" coding.

This depends on the previous commit; without it, we do not actually
enforce type safety for these methods.

The API notes change is to make the non-generic version of this method
unavailable so that it does not participate in overload resolution.
Without this we prefer the non-generic method unless there's a contextual
type for the result. I've filed rdar://problem/22243198 to track taking
this out once Foundation has updated their headers.

rdar://problem/17060110 (again)

Swift SVN r31154
2015-08-12 01:36:08 +00:00
Dave Abrahams
880f28b3fd [stdlib] Add missing 10.10 NSString APIs.
containsString and localizedCaseInsensitiveContainsString were
introduced in 10.10, release-noted, but never
documented (<rdar://22236574>), so we missed them.

Fixes <rdar://18776075> String.containsString doesn't work in Swift

Swift SVN r31152
2015-08-12 00:37:43 +00:00
Chris Lattner
f2f16dea4c remove a patch accidentally committed with r31130
Swift SVN r31138
2015-08-11 18:28:15 +00:00
Chris Lattner
a899872d91 Reapply r31105, with some fixes to invalid unconstrained generics. These fixes correct
the regressions that r31105 introduced in the validation tests, as well as fixing a number
of other validation tests as well.

Introduce a new UnresolvedType to the type system, and have CSDiags start to use it
as a way to get more type information out of incorrect subexpressions.  UnresolvedType
generally just propagates around the type system like a type variable:
 - it magically conforms to all protocols
 - it CSGens as an unconstrained type variable.
 - it ASTPrints as _, just like a type variable.

The major difference is that UnresolvedType can be used outside the context of a
ConstraintSystem, which is useful for CSGen since it sets up several of them to 
diagnose subexpressions w.r.t. their types.

For now, our use of this is extremely limited: when a closureexpr has no contextual
type available and its parameters are invalid, we wipe them out with UnresolvedType
(instead of the previous nulltype dance) to get ambiguities later on.

We also introduce a new FreeTypeVariableBinding::UnresolvedType approach for
constraint solving (and use this only in one place in CSDiags so far, to resolve
the callee of a CallExpr) which solves a system and rewrites any leftover type 
variables as UnresolvedTypes.  This allows us to get more precise information out,
for example, diagnosing:

 func r22162441(lines: [String]) {
   lines.map { line in line.fooBar() }
 }

with: value of type 'String' has no member 'fooBar'
instead of: type of expression is ambiguous without more context

This improves a number of other diagnostics as well, but is just the infrastructural
stepping stone for greater things.





Swift SVN r31130
2015-08-11 06:06:05 +00:00
David Farler
d5e9bde7e7 Don't use private functions in the CG overlay
Use an internal underscore function instead.

Swift SVN r31094
2015-08-08 01:45:10 +00:00
David Farler
8b10d158d7 Fixit Typo: CGRect.integralRect -> integerRect
Swift SVN r31084
2015-08-07 20:52:37 +00:00
Dmitri Hrybenko
050a2cdea8 Foundation overlay: adopt @warn_unused_result
Reviewed by Michael J LeHew Jr.

Swift SVN r31064
2015-08-06 23:50:53 +00:00
Dmitri Hrybenko
e587ef0086 SDK overlay: adopt @warn_unused_result
Swift SVN r31051
2015-08-06 15:54:52 +00:00
Mish Awadah
10bdef0936 Revert "CMake: build all platforms except watchOS using the public SDK"
This reverts commit cd3f1ba7d1ee2397817e1a165209fdeab8a1c004.

Reverting this b/c it is breaking buildbots with the following:
CMake Error at CMakeLists.txt:522 (message):
  CrashReporterClient library is required, but it was not found

Swift SVN r31047
2015-08-06 06:12:23 +00:00
Dmitri Hrybenko
271acdfcab CMake: build all platforms except watchOS using the public SDK
Covers rdar://problem/21145996.
A step towards rdar://problem/21099318.

Swift SVN r31041
2015-08-06 04:28:05 +00:00
Ben Langmuir
0fa6d7b65f Revert "Move GameKit overlay to GameCenter."
The headers went back to GameKit in a new SDK.

This reverts commit r30322.

Swift SVN r31015
2015-08-04 22:27:47 +00:00
David Farler
313a4c93c6 Review: Index protocol extensions
- Add Strict/Defaulted Index types to StdlibUnittest
- Test whether a random access index calls its more efficient
  customization by tracking successor calls.
- Fix the RandomAccessIndex.advancedBy(n, limit:) API by de-underscoring
  the limit parameter
- Inline some internal transparent default implementations to their only
  call site
- Attach _RandomAccessAmbiguity type to RandomAccessIndex

rdar://problem/22085119

Swift SVN r30979
2015-08-04 03:13:14 +00:00
David Farler
8febbc1095 Suggest NSURL path methods instead of NSString
rdar://problem/22095657

Swift SVN r30978
2015-08-04 02:59:41 +00:00
David Farler
f8e418df74 Add renamed fixits for CG overlay API change rdar://problem/19788137
Swift SVN r30972
2015-08-04 01:16:11 +00:00
Jordan Rose
953424072e Guard "object literals" feature with SWIFT_ENABLE_OBJECT_LITERALS.
This is not a feature we're releasing at the moment, so provide a way
to turn it off.

rdar://problem/21935551

Swift SVN r30966
2015-08-04 00:16:52 +00:00
David Farler
cd947e397b Make CoreGraphics overlay naming consistent with the Standard Library
- Don't repeat type names in methods and properties
- Use 'InPlace' suffix for mutating variants of methods that return
  a CG type.

rdar://problem/19788137

Swift SVN r30960
2015-08-03 20:09:32 +00:00
David Farler
311baf73cf Index protocol extensions
- Remove free Swift functions for advance and distance and replace
  them with protocol extension methods:
  - advancedBy(n)
  - advancedBy(n, limit:)
  - distanceTo(end)
- Modernize the Index tests
  - Use StdlibUnittest
  - Test for custom implementation dispatch

Perf impact: No significant changes reported in the
Swift Performance Measurement Tool.

rdar://problem/22085119

Swift SVN r30958
2015-08-03 20:06:44 +00:00