Commit Graph

21502 Commits

Author SHA1 Message Date
Dave Zarzycki
6b04e56cce Heap: better hash function names and better hashing
Swift SVN r18124
2014-05-15 20:40:21 +00:00
Fariborz Jahanian
6635feb32b Provide sdk vararg overlays for CIFilter and
CISampler per rdar://16726822
(also removed a comment in Foundation.swift).


Swift SVN r18123
2014-05-15 20:13:55 +00:00
Doug Gregor
01f3f7777e Make _convertNSArrayToArray work for non-verbatim bridged types.
The runtime diagnostics here are awful, but the monkey dances
<rdar://problem/16899681>.



Swift SVN r18121
2014-05-15 19:25:58 +00:00
Doug Gregor
87904b8228 Make ImplicitlyUnwrappedOptional conform to _ConditionallyBridgedToObjectiveC.
This is a better solution to <rdar://problem/16899681> because the
runtime magic is limited to implementing the witnesses of this
conformance.

The type checker fixes are because we can end up using unchecked
optionals in more places, via bridging, than we could before.


Swift SVN r18120
2014-05-15 19:00:52 +00:00
Joe Pamer
a74c44a6e4 Fix two crashing bugs related to checked downcasts - rdar://problem/16093456 and rdar://problem/16892211.
Swift SVN r18118
2014-05-15 18:36:44 +00:00
Dmitri Hrybenko
acb7465f4b stdlib: underscore-prefix NSContiguousString and NSOpaqueString
Swift SVN r18114
2014-05-15 18:02:30 +00:00
Dave Abrahams
634d85f613 [stdlib] Strengthen a sanity check
Swift SVN r18112
2014-05-15 17:51:13 +00:00
Dmitri Hrybenko
586387da7f stdlib: remove unused declarations (the runtime functions are gone already)
Swift SVN r18111
2014-05-15 17:39:03 +00:00
Dave Abrahams
fed492b650 [stdlib] Don't assert on empty NSArrays
Empty NSArrays are usually represented by emptyNSSwiftArray, whose
element type is irrelevant.  So when doing a getObjects:range: on that,
presumably the range's length is zero and we shouldn't do any sanity
checking w.r.t. the element type.

Fixes <rdar://problem/16914909> Assertion failed attempting to append
arrays when subclassing Cocoa class

Swift SVN r18110
2014-05-15 17:25:48 +00:00
Dmitri Hrybenko
d50a8b476d stdlib/Foundation overlay: add Printable conformance to Selector
rdar://16897592


Swift SVN r18109
2014-05-15 17:25:43 +00:00
Dmitri Hrybenko
8ee468e974 stdlib/Foundation overlay: add Printable conformance to ObjCBool
rdar://16897579


Swift SVN r18108
2014-05-15 17:02:40 +00:00
Dmitri Hrybenko
2a956966ac stdlib/runtime: teach DynamicCastToExistential1 to handle source values that
are existentials

rdar://16925792


Swift SVN r18107
2014-05-15 16:32:13 +00:00
Doug Gregor
bf8fbfc32e Teach isBridgedToObjectiveC and bridgeToObjectiveC to unwrap implicitly unwrapped optionals.
This allows us to, for example, convert an array of unchecked
optionals of some bridged type T to NSArray. It's a runtime failure if
the unchecked optional contains nil.

This is most of <rdar://problem/16899681>, but I want to improve the
testing and look into the various FIXMEs.


Swift SVN r18106
2014-05-15 16:16:35 +00:00
Dmitri Hrybenko
2ec65be0a6 stdlib/runtime: use a C++ header
Swift SVN r18105
2014-05-15 14:14:28 +00:00
Dmitri Hrybenko
011584a0b6 stdlib/pritning: untie string interpolation from string initializers
String interpolation invokes convertFromStringInterpolationSegment() function
now.  There is no need to add extensions to String to allow custom types to
participate in string interpolation.  Just implementing Printable will do the
right thing.


Swift SVN r18104
2014-05-15 09:56:02 +00:00
Dave Abrahams
8e1a85490b [stdlib] More infrastructure for Array bridging
Totally untested; tests are next.

Swift SVN r18096
2014-05-15 04:32:13 +00:00
Dave Zarzycki
9dd82e3373 Heap: slowDealloc() design feedback from John
Swift SVN r18083
2014-05-14 23:04:33 +00:00
Ted Kremenek
bcb4f5d6d0 Add documentation comments for '..' and '...'.
Swift SVN r18078
2014-05-14 20:04:35 +00:00
Dmitri Hrybenko
f183e493bf stdlib/bridging: bridgeFromObjectiveC() can fail to bridge the Objective-C
object to the desired type.  Model this with an optional return type.


Swift SVN r18077
2014-05-14 19:49:22 +00:00
Dave Abrahams
aceb11edb1 [stdlib] bridgeFromObjectiveC for String
Seemed pretty obvious so I just did it.

Swift SVN r18073
2014-05-14 16:44:49 +00:00
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
Argyrios Kyrtzidis
33e5c2df71 [stdlib] Replace the dashes in the comment with parens, as suggested by DaveA.
Swift SVN r18060
2014-05-14 04:34:27 +00:00
Argyrios Kyrtzidis
b70c125c88 [stdlib] Remove non-ascii dash character from a comment.
Swift SVN r18058
2014-05-14 03:06:58 +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
Joe Groff
edb2c0c411 Runtime: Handle dynamic casts to AnyObject.
We can't do existential casts generally yet, but we can at least handle class-to-AnyObject casts, which come up in array bridging. Fixes <rdar://problem/16898943>.

Swift SVN r18033
2014-05-13 22:31:23 +00:00
Dave Zarzycki
03d8c146e5 Heap: walk the threads when running leaks and ignore the per-thread caches
Swift SVN r18030
2014-05-13 22:09:56 +00:00
Dave Zarzycki
49a5348df2 Heap: DaveP says that this is not needed
Swift SVN r18029
2014-05-13 22:09:49 +00:00
Dave Abrahams
0222047dda [stdlib] A couple of Array changes...
...that managed to sneak out of my last commit.

Swift SVN r18028
2014-05-13 22:03:57 +00:00
Dave Abrahams
34edde40ca [stdlib] Array bridging/bridge-cast entry points
Still needs lots of testing, but at least we have the code in and
building, finally.

Swift SVN r18027
2014-05-13 21:33:40 +00:00
Dave Zarzycki
a8d814cfca Heap: Make leaks and friends more accurate
Swift SVN r18014
2014-05-13 18:15:19 +00:00
Dave Zarzycki
699ccd21a7 Heap: dead code deletion
Swift SVN r18013
2014-05-13 18:15:16 +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
Dave Zarzycki
cf4fbe33f5 Heap: Checkpoint leaks/heap/vm_map support
Huge allocation leaks are detected correctly.
Tiny allocation leaks are problematic, both false positive and false negative.

For example:

leaks Report Version:  2.0
Process 73345: 4980 nodes malloced for 1677 KB
Process 73345: 1 leak for 1048576 total leaked bytes.
Leak: 0x10aed0000  size=1048576  zone: SwiftZone_0x10adc35d8

Swift SVN r18007
2014-05-13 16:28:44 +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
ed68ba833f stdlib/printing: add Streamable conformance to CString, and DebugPrintable
conformances to String and CString


Swift SVN r18003
2014-05-13 13:54:43 +00:00
Dmitri Hrybenko
4f921ad60b Unbreak iOS build
Swift SVN r18002
2014-05-13 13:27:39 +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
Dave Zarzycki
806d2decd2 Runtime: Fix an oversight with the previous gmalloc fix
Swift SVN r17951
2014-05-12 19:30:17 +00:00
Dave Zarzycki
504701bda5 Runtime heap: defer to gmalloc when gmalloc is loaded
<rdar://problem/13318927> jDisable allocation cache when using gmalloc

Swift SVN r17950
2014-05-12 19:24:03 +00:00
Dave Zarzycki
f618a98ec4 Runtime: Remove swift_getClassMetadata()
Greg's arclite hack is much better. See also: <rdar://problem/16735599>

Swift SVN r17945
2014-05-12 18:24:24 +00:00
Ted Kremenek
49d4fca14d Rename UTF16Scalars to UnicodeScalarView.
Implements <rdar://problem/16821900>.

Swift SVN r17899
2014-05-11 23:51:07 +00:00
Dmitri Hrybenko
2dc5ed55e0 runtime: add hacks for stdlib: runtime calls to perform casts to existential
types that are protocols


Swift SVN r17866
2014-05-11 01:26:04 +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