Commit Graph

11 Commits

Author SHA1 Message Date
Ben Cohen
e9d4687e31 De-underscore @frozen, apply it to structs (#24185)
* De-underscore @frozen for enums

* Add @frozen for structs, deprecate @_fixed_layout for them

* Switch usage from _fixed_layout to frozen
2019-05-30 17:55:37 -07:00
Karoy Lorentey
3c74c0f1cb [stdlib] Change the signature of Dictionary’s bulk initializer (#23758)
The initializer was originally introduced without proper availability; in https://github.com/apple/swift/pull/23643, we fixed this by applying the `@_alwaysEmitIntoClient` attribute. However, this had the unfortunate side-effect that the symbol disappeared from `libswiftCore.dylib`, which somehow confuses some simulator builds.

Try to figure out what’s happening by replacing the third closure argument with an integer return value. This changes the mangled name of the bulk initializer, which should make it more obvious how/why these builds fail.

rdar://problem/49479386
2019-04-03 10:51:36 -07:00
Karoy Lorentey
7b654b372f [stdlib] Fix availability of Dictionary’s bulk-loading initializer (#23643)
Making it @_alwaysEmitIntoClient makes it available in all OS versions.
2019-03-29 12:54:56 -07:00
Karoy Lorentey
9d61bad1e5 [stdlib] Keep the first duplicate key instead of the last 2018-12-18 09:49:58 -08:00
Karoy Lorentey
f862ad3741 [stdlib] Doc updates 2018-12-18 09:49:58 -08:00
Karoy Lorentey
f0e04f73f4 [stdlib] Process elements from back to front 2018-12-18 09:49:58 -08:00
Karoy Lorentey
039891c24b [stdlib] Dictionary: Add support for non-unique keys in bulk loading init 2018-12-18 09:49:58 -08:00
Karoy Lorentey
f1f5e0f2bf [stdlib] Dictionary: Add unsafe bulk-loading initializer
Interface inspired by this Array pitch:
https://forums.swift.org/t/array-initializer-with-access-to-uninitialized-buffer/13689
2018-12-18 09:49:58 -08:00
Karoy Lorentey
84d8cedaae [stdlib] _SetBuilder, _DictionaryBuilder: Assume target has enough capacity
The compiled code included unnecessary references to resize().
2018-10-05 12:33:25 +01:00
Karoy Lorentey
c3bc84e680 [stdlib] Set, Dictionary: __consuming/__owned audit
Add __consuming and __owned to Set and Dictionary members where applicable.

Ignore compiler intrinsics for casting for now — their ARC behavior is covered by unit tests that need to be updated.
2018-09-24 13:46:40 +01:00
Karoy Lorentey
e9186000d0 [stdlib][NFC] Break Set/Dictionary implementation into smaller files
This has long been overdue; splitting the Dictionary.swift/Set.swift monoliths makes for a far less confusing editing experience.
2018-09-23 01:38:37 +01:00