Commit Graph

7847 Commits

Author SHA1 Message Date
swift-ci
144dc55dca Merge pull request #9297 from apple/integrate-utf16 2017-05-04 15:49:37 -07:00
Ted Kremenek
cb7ad7d785 Merge pull request #9162 from phausler/safe_nsnumber
[Foundation] Implementation of SE-0170 for safer NSNumber bridging
2017-05-04 13:30:31 -07:00
Dave Abrahams
bea71aa80e [stdlib] Legacy UTF16 decoding in terms of new components 2017-05-04 11:03:46 -07:00
Doug Gregor
199c9ecb32 Merge pull request #9230 from itaiferber/referencing-encoder-fix
Referencing encoders should use parent codingPath
2017-05-04 07:08:10 -07:00
Michael Ilseman
47d0247476 [stdlib] Speed up Character construction from CharacterView.subscript (#9252)
This adds a fast path for single-code-unit Character
construction. Rather than use the general purpose String based
initializer (which then repeats grapheme breaking to ensure a trap,
amongst other inefficiencies), just make the Character from the single
unicode scalar value directly.

This also speeds up simple iteration of BMP strings when the optimizer
is unable to eliminate the subscript. Around 2x for ASCII, and around
20% for BMP UTF16.
2017-05-04 06:59:30 -07:00
Jordan Rose
c8d3506e55 Revert "[Mangling] Uniformly use "So" for imported decls." (#9233)
This reverts commit 25985cb764. For now,
we're trying to avoid spurious non-structural changes to the mangling,
so that the /old/ mangling doesn't appear to change. That doesn't mean
no changes at all, but we can save this one for later.
2017-05-03 16:13:29 -07:00
Doug Gregor
f5c9ee346f Merge pull request #9158 from natecook1000/nc-devert-dictionary
[stdlib] Dictionary/Set enhancements (redux)
2017-05-03 14:07:27 -07:00
Itai Ferber
3a6dbebba0 Fix container assertion in referencing encoders 2017-05-03 13:12:54 -07:00
swift-ci
aad0bafa05 Merge pull request #9228 from eeckstein/old-objc-type-mangling 2017-05-03 11:48:24 -07:00
swift-ci
edd13eca60 Merge pull request #9188 from apple/new-unicode-decoders 2017-05-03 11:38:25 -07:00
Itai Ferber
9e12b95862 Merge pull request #9231 from itaiferber/collection-codable-conformance
Add Dictionary and Set Codable conformance
2017-05-03 11:22:30 -07:00
Erik Eckstein
c4002a9398 Use the old mangling for generic ObjC runtime names, which are generated at runtime.
To be backward compatible to existing archives created by the NSKeyedArchiver for generic classes
2017-05-03 10:52:54 -07:00
Dave Abrahams
d8f1caf4a6 Inline all the new low-level bits 2017-05-03 09:53:30 -07:00
Itai Ferber
813d756573 Referencing encoders should use parent codingPath 2017-05-03 09:49:10 -07:00
Erik Eckstein
155db0a4bd Let Character literals, which fit into 64 bits, be folded into a single integer constant.
This is done by ensuring that the corresponding Character constructor is inlined. llvm will do the constant folding.
Also add a test which checks this.

It makes character literals much faster (3x improvement for the CharacterLiteralsSmall benchmark)
And it removes _a lot_ of redundant code (~80% for the CharacterLiteralsSmall benchmark)
2017-05-03 09:10:21 -07:00
Bob Wilson
b7d7885311 Merge pull request #9216 from gparker42/GrP-PR-F3AA1CCD-53C0-451A-A248-C03BD4C40026
[runtime] Fix alignment of HeapObject header on watchOS.
2017-05-03 07:27:24 -07:00
Ben Cohen
d8be7ae29e Use CF for Hashing (#9203) 2017-05-03 05:42:40 -07:00
Arnold Schwaighofer
20c5606767 Merge pull request #9218 from gparker42/GrP-PR-D577DF2B-2EE1-4A46-B586-1EC51BFCC3C9
[runtime] Fix assignment of Any with mismatched types.
2017-05-03 05:07:53 -07:00
Greg Parker
2ad2f26024 [runtime] Fix assignment of Any with mismatched types.
The COW existential implementation sets the existential box's
new value but fails to set the box's new type. Hijinks ensue
when the new value is later used as if it were of the old type.

rdar://31955457
2017-05-03 00:19:21 -07:00
Slava Pestov
e8f4930cb5 Merge pull request #9192 from slavapestov/anyobject-removal-vol-4
AnyObject removal volume 4
2017-05-02 22:03:44 -07:00
Joe Groff
7913e9821b Merge pull request #9214 from jckarter/keypaths-32-bit
Support key paths on 32-bit platforms.
2017-05-02 20:36:07 -07:00
swift-ci
38b9d828b8 Merge pull request #9212 from apple/revert-9187-nc-codable 2017-05-02 19:54:57 -07:00
Slava Pestov
b5721e8d8e AST: Remove AnyObject protocol 2017-05-02 19:45:00 -07:00
Dave Abrahams
c3391023a4 [stdlib] Inline integer parsing 2017-05-02 18:44:23 -07:00
Greg Parker
d8b341bc74 [runtime] Fix alignment of HeapObject header on watchOS.
HeapObject contains an InlineRefCounts. The Swift shim definition of
InlineRefCounts used uint64_t, which has the correct size but the incorrect
alignment on armv7k. This caused the Swift stdlib and the Swift runtime
to disagree about object layouts.

rdar://31664545
2017-05-02 18:36:16 -07:00
Dave Abrahams
fe38ab1579 [stdlib] Inline var first default implementation 2017-05-02 18:36:04 -07:00
swift-ci
9354a93b18 Merge pull request #9208 from gottesmm/more_small_gardening 2017-05-02 18:31:47 -07:00
Joe Groff
525001f7a7 Support key paths on 32-bit platforms.
I had optimistically written the code here optimistically hoping #7837 would land in time for me to merge, but that didn't happen, so adjust some things to match the current 12-byte object header size on 32-bit, and introduce some ABI constants for the expected 32- and 64-bit object header sizes we can assert against so that we have some robustness when it eventually changes again. Implements rdar://problem/31768303.
2017-05-02 18:19:07 -07:00
Dave Abrahams
4e878a28b6 [stdlib] Inline _encodeSomeUTF8 2017-05-02 18:10:57 -07:00
Tony Parker
ff65a2b2a1 Revert "[stdlib] Reformatting and gybbification for Codable &co" 2017-05-02 17:06:51 -07:00
Itai Ferber
1eb73b3b62 Add Dictionary and Set {En,De}codable conformance 2017-05-02 17:03:48 -07:00
Dave Abrahams
b1ebc5cd48 [stdlib] Inline legacy UTF8.decode 2017-05-02 16:54:28 -07:00
Dave Abrahams
a9c8d415df [stdlib] Inline parseScalar 2017-05-02 16:54:28 -07:00
Dave Abrahams
e8cb3cabd8 [stdlib] Inline transcode() 2017-05-02 16:54:28 -07:00
Dave Abrahams
2226cbacc0 [stdlib] Inline all of IndexingIterator 2017-05-02 16:54:27 -07:00
Dave Abrahams
40b66e5935 [stdlib] Implement legacy UTF8 APIs in terms of new components 2017-05-02 16:54:27 -07:00
Dave Abrahams
f155d499c0 [stdlib] Drop redundant constraint 2017-05-02 16:54:27 -07:00
Michael Gottesman
112f344264 [gardening] Fix header #defines. NFC. 2017-05-02 13:57:48 -07:00
Michael Gottesman
ccef0215ff [gardening] Fix style inconsistencies.
Some places in this header were following the LLVM convention of:

namespace ... {

struct Foo {

};

}

and one-two places had extra indentation. I standardized the code on the LLVM
convention.
2017-05-02 13:56:05 -07:00
Michael Gottesman
43c5acbb19 [gardening] Fix doxygen headers in ImageInspection files. 2017-05-02 13:53:11 -07:00
Jordan Rose
de969c66c6 [ClangImporter] Don't infer 'Comparable' for swift_wrapper. (#9120)
The underlying type's ordering may not be appropriate for the wrapped
type (think an ordered list whose underlying type is NSString).
Frameworks can always add a Comparable conformance explicitly.

We squeak out of this being a source-breaking change by virtue of
never having released a working version of it. Rintaro fixed the
ambiguity problems back in f11b74176b, but that was after the last
rebranch for Swift 3.1.

rdar://problem/30166538
2017-05-02 11:41:03 -07:00
Nate Cook
3e46ab60a0 Merge pull request #9187 from natecook1000/nc-codable
[stdlib] Reformatting and gybbification for Codable &co
2017-05-02 12:12:25 -05:00
Slava Pestov
f3761c1c2e Reflection: Update for subclass existentials and primitive AnyObject 2017-05-02 02:23:08 -07:00
Slava Pestov
a77f2f2045 Reflection: Share a Demangler instead of creating new ones all the time 2017-05-02 01:19:36 -07:00
Slava Pestov
ab4d37a422 Reflection: Record superclass as its own field instead of an associated type of AnyObject
The "superclass as associated type" modeling was put in to
maintain backward compatibility.

We just bumped the version number because of new mangling so
we may as well fix this sillyness too.
2017-05-02 01:18:49 -07:00
Slava Pestov
ea4fe32295 Reflection: Give up instead of producing an empty field list if a field type does not demangle
Better to fail instead of producing an invalid layout.
2017-05-02 01:18:24 -07:00
Nate Cook
f7abeb0a66 [stdlib] GYB Codable and remove duplicated code 2017-05-02 02:31:13 -05:00
Nate Cook
443dbd727a [stdlib] Rename Codable.swift to .gyb 2017-05-01 23:05:10 -05:00
Nate Cook
cde3b920c1 [gardening] Indentation and comment formatting 2017-05-01 23:05:10 -05:00
swift-ci
3b333ff323 Merge pull request #9176 from apple/new-unicode-decoders 2017-05-01 19:27:08 -07:00