Dave Abrahams
104da6740b
[stdlib] Make && and || generic
...
...instead of using Existentials, which don't specialize well.
Swift SVN r20837
2014-07-31 18:22:56 +00:00
Dmitri Hrybenko
c7a5b1daca
stdlib/runtime: fix leaks in swift_bridgeNonVerbatimToObjectiveC
...
Swift SVN r20827
2014-07-31 15:49:17 +00:00
Dave Abrahams
ea21309150
[stdlib] _StringCore: ExtensibleCollectionType
...
Swift SVN r20825
2014-07-31 14:57:42 +00:00
Dave Abrahams
1614ed7386
[stdlib] Improve comments
...
Fill in what some default implementations would look like, if we had
that feature. At least it will help implementors.
Swift SVN r20824
2014-07-31 14:57:41 +00:00
Dmitri Hrybenko
8150b9296b
stdlib: fix leaks of Swift.String when passing them from runtime to
...
Swift (in mirrors and demangling)
Swift SVN r20823
2014-07-31 14:48:54 +00:00
Dmitri Hrybenko
0194e2675b
stdlib/UnsafePointer: add more doc comments
...
Swift SVN r20822
2014-07-31 14:28:04 +00:00
Dmitri Hrybenko
30749d9f69
stdlib/Reflection: really fix a leak when reflecting a class (turned out to be
...
in swift_ObjCMirror_count)
rdar://17840810
Swift SVN r20821
2014-07-31 13:11:55 +00:00
Dmitri Hrybenko
9c8d30ea11
stdlib/Reflection: fix over-release that I introduced in r20671 trying to fix a
...
leak. The release was valid only for some code paths.
Added some comments explaining ownership and parameter passing conventions.
Fixes rdar://17855302, restores half of the leak in rdar://17840810 (only for
objects that inherit from NSObject).
Swift SVN r20820
2014-07-31 11:49:43 +00:00
Greg Parker
1167c1722d
Fix XCTest build.
...
Swift SVN r20813
2014-07-31 05:37:24 +00:00
Dave Abrahams
50aac71847
[stdlib] Arrays : RangeReplaceableCollectionType
...
Add the missing APIs and make the conformance complete
Swift SVN r20807
2014-07-31 02:54:27 +00:00
John McCall
97025f15b0
Remove compiled python file.
...
Swift SVN r20804
2014-07-31 02:06:00 +00:00
John McCall
c367362f22
Properly flag opaque existential types as not being
...
bitwise-takable.
Swift SVN r20803
2014-07-31 02:03:56 +00:00
John McCall
36a27a61a4
Replace the typeOf value witness with an
...
initializeBufferWithTakeOfBuffer value witness.
Attempt to use initializeBufferWithTakeOfBuffer in
some appropriate places.
There are some changes enabled by this which are
coming in a follow-up patch.
Swift SVN r20802
2014-07-31 02:03:53 +00:00
Chris Hanson
867429b0f4
Make XCTAssertEqualWithAccuracy work with CGFloat
...
Now that CGFloat is a peer of Float and Double, we need to add appropriate handling
to it for XCTAssertEqualWithAccuracy.
Addresses <rdar://problem/17762421>.
Swift SVN r20800
2014-07-31 01:36:32 +00:00
Dave Abrahams
bd2bd78b23
[stdlib] Add RangeReplaceableCollectionType
...
Swift SVN r20791
2014-07-31 00:38:24 +00:00
Dave Abrahams
80a21c8c09
[stdlib] Fix my last commit (oops!)
...
Swift SVN r20772
2014-07-30 20:42:02 +00:00
Dave Abrahams
287e43ad3c
[stdlib] Clean up the other half of array casts
...
Swift SVN r20771
2014-07-30 20:39:47 +00:00
Dave Abrahams
ab21c59977
[stdlib] Clean up half the array cast machinery
...
Swift SVN r20765
2014-07-30 18:22:31 +00:00
Dmitri Hrybenko
ec4f8d37f7
stdlib: fix a heap overflow that colud happen when appending to a string
...
slice
rdar://17855908
Swift SVN r20762
2014-07-30 18:04:36 +00:00
Dmitri Hrybenko
6296c14623
stdlib/_StringBuffer: documentation comments, coding style
...
Swift SVN r20759
2014-07-30 14:43:30 +00:00
Dmitri Hrybenko
190db64c18
stdlib: document current plan of record for reserveCapacity() semantics
...
rdar://16970908
Swift SVN r20758
2014-07-30 14:42:24 +00:00
Greg Parker
fe8618a3d2
Scrap the custom allocator until we have time to fix it.
...
The allocator's crimes include:
* It uses OS SPI that must not be used by non-OS apps.
* It does not play well with memory debugging tools like Instruments.
* It does not return memory to the OS in response to memory pressure.
* It is less tested than we would like because many configurations
inadvertently turn it off (such as running from Xcode).
* Its per-thread magazine implementation does not actually work.
* Its "try alloc" flag is incompletely implemented and never used.
* Its "zero fill" flag is unimplemented and inconsistently used.
Swift SVN r20757
2014-07-30 14:11:40 +00:00
Dmitri Hrybenko
cbdefd719b
Unbreak iOS builds: there is no NSRectEdge on iOS
...
Swift SVN r20755
2014-07-30 13:08:11 +00:00
Dmitri Hrybenko
fc05064131
Foundation overlay: introduce correctly-typed NS{Min,Max}{X,Y}Edge constants
...
that correspond to macros in the SDK
... and revert the previous attempt at fixing this, r20269.
rdar://16593744
Swift SVN r20752
2014-07-30 11:33:25 +00:00
Dmitri Hrybenko
ac0d9b8175
stdlib/CGFloat: GYB'ify initializers that convert between CGFloat and
...
integer types. Never miss an integer type again.
rdar://17853313
Swift SVN r20751
2014-07-30 11:24:11 +00:00
Dmitri Hrybenko
c17b692e20
stdlib: pull out information about integer types into a reusable file
...
Swift SVN r20750
2014-07-30 10:16:47 +00:00
Dmitri Hrybenko
bfb781492b
Remove a Python bytecode file
...
Swift SVN r20743
2014-07-30 08:27:52 +00:00
John McCall
80dd63b38d
Don't allocate values out-of-line just because they're
...
not bitwise takable.
Finishes rdar://16755731
Swift SVN r20742
2014-07-30 08:24:18 +00:00
John McCall
584795e505
Replace the typeOf value witness with an
...
initializeBufferWithTakeOfBuffer value witness.
Attempt to use initializeBufferWithTakeOfBuffer in
some appropriate places.
There are some changes enabled by this which are
coming in a follow-up patch.
Swift SVN r20741
2014-07-30 08:24:12 +00:00
John McCall
934527a029
Eliminate all uses of the typeof value witness.
...
Swift SVN r20734
2014-07-30 04:40:58 +00:00
Dave Abrahams
6e7f83fe98
Internalize old array casting entry-points
...
The core compiler now uses just two entry points for array casting
Swift SVN r20725
2014-07-29 23:56:51 +00:00
Dave Abrahams
6a80cbbaa2
[stdlib] Capitalize the cases of Bit
...
Fixes <rdar://problem/17821517>
Swift SVN r20718
2014-07-29 23:25:28 +00:00
Dave Abrahams
7c7fb3eea0
Restore "[Release note] deferred array cast checks"
...
I had just gone too far with the laziness; everything was already
working after only one change
Swift SVN r20717
2014-07-29 23:25:27 +00:00
Joe Pamer
1fec0afbd0
Disallow value-to-optional conversions between argument and parameter types when resolving overloads for operators applied to nil literal operands.
...
This is a targeted fix to address rdar://problem/16848110 ("Disallow non-optionals to be compared to nil") and its associated dupes.
Swift SVN r20716
2014-07-29 23:24:36 +00:00
Dave Abrahams
0b562db701
Revert "[Release note] deferred array cast checks"
...
This reverts commit r20700 and r20702
I'll bring these back when I work out the problems.
Swift SVN r20708
2014-07-29 22:52:28 +00:00
Dave Abrahams
18b81228d5
[stdlib] Defer array bridge cast checks
...
Part 2 (of 2) of <rdar://problem/17340393>
Swift SVN r20700
2014-07-29 21:41:11 +00:00
Dave Abrahams
5847a0f7c3
[stdlib] defer Array element down-cast checks
...
Part 1 of <rdar://problem/17340393>
Swift SVN r20699
2014-07-29 21:41:10 +00:00
Dave Abrahams
ebcaab1e52
[stdlib/core] add Array init from _CocoaArrayType
...
Swift SVN r20698
2014-07-29 21:41:09 +00:00
Dave Abrahams
01dd78ae99
[stdlib] Add missing _sanityCheck diagnostic
...
Swift SVN r20691
2014-07-29 21:01:26 +00:00
Dave Abrahams
a8225dabee
[stdlib] ArrayBridge.swift => ArrayCast.swift
...
This file is really about array casting, and not (necessarily) bridging.
Bridging may be involved in some array casts, but is not involved in all
of them.
Swift SVN r20690
2014-07-29 20:58:54 +00:00
Dave Abrahams
0320ef85ab
[stdlib] Consolidate array casting entry points
...
Swift SVN r20689
2014-07-29 20:54:24 +00:00
Dave Abrahams
c91e0f98a0
[stdlib] bugfix: Copy bridged NSMutableArray's
...
When NSArrays are bridged into Array<T>, they weren't being .copy()'d.
As a result, changes to an NSMutableArray (cast to NSArray), could cause
"unrelated" Swift Arrays to mutate. Found by inspection while
bottlenecking unsafeBitCast's in Array implementation, which also
happens in this commit.
Swift SVN r20678
2014-07-29 17:59:41 +00:00
Dmitri Hrybenko
3e32ff188f
stdlib/String: change String.stringByAbbreviatingWithTildeInPath into a
...
property, to match recent Foundation headers
Swift SVN r20674
2014-07-29 16:08:39 +00:00
Dmitri Hrybenko
a0c8140529
Reflection: fix a leak in TupleMirror
...
rdar://17840810
Swift SVN r20671
2014-07-29 15:08:48 +00:00
Dmitri Hrybenko
bdc78be4e5
Reflection: reorder dump() arguments so that one can print to a stream and take
...
advantage of default values
Also, fix dump() to actually print everything into the supplied stream.
Swift SVN r20670
2014-07-29 15:07:25 +00:00
Dmitri Hrybenko
8c277e35e9
StdlibUnittest: add a prototype of a Swift-based driver for trapping tests
...
This technique is about 10x faster than using lit as the driver.
Swift SVN r20668
2014-07-29 10:26:32 +00:00
Dave Abrahams
9a13a7148b
[stdlib] Consolidate bridging protocols
...
Squash _[Conditionally]BridgedToObjectiveC into one protocol. This
change results in simpler bridging code with fewer dynamic protocol
conformance checks, and solves the nasty naming/semantics problem that
resulted from having _ConditionallyBridgedToObjectiveC refining
_BridgedToObjectiveC.
Also, rename things so they're more symmetrical and less confusing.
Swift SVN r20664
2014-07-29 01:30:27 +00:00
Dave Abrahams
5496c4beac
[stdlib] Default == for Strideables
...
...which we can provide now that <rdar://problem/17620349> is fixed.
Thanks, JoeP!
Swift SVN r20645
2014-07-28 21:14:53 +00:00
Dave Abrahams
6d1f574089
[stdlib] Separate file for Array bridging/casting
...
This stuff will require a nice big comment and will go through several
rounds of cleanup; let's get it out of the regular Array flow.
Swift SVN r20642
2014-07-28 20:34:08 +00:00
Joe Pamer
96a5df8281
Remove one more optional-as-boolean.
...
Swift SVN r20640
2014-07-28 19:20:42 +00:00