Commit Graph

194 Commits

Author SHA1 Message Date
Karoy Lorentey
ee17e975ca [stdlib] Make protocol _NSArrayCore internal
These shadow protocols don’t add any real type safety, and exposing them in the ABI seems unnecessary.
2018-11-15 09:54:25 +00:00
Jordan Rose
e7dd1c17b2 Merge pull request #20384 from jrose-apple/witless
Require @usableFromInline on associated type witnesses
2018-11-08 16:36:48 -08:00
Jordan Rose
65fe556c1a [stdlib] Mark associated type witnesses as @usableFromInline
Inlinable code is permitted to rely on these associated types, so we
need to make sure their declarations are printed in the parseable
interface.

Part of rdar://problem/43824052
2018-11-06 17:00:46 -08:00
Lance Parker
90fd4ba4d7 All the @inlinables in ContigArray are good 2018-11-06 14:38:09 -08:00
Karoy Lorentey
ad8276f14c [stdlib] Array: Remove some deferred bridging details from ABI
- __SwiftNativeNSArrayWithContiguousStorage.withUnsafeBufferOfObjects
- __ContiguousArrayStorageBase._getNonVerbatimBridgingBuffer()
- __ContiguousArrayStorageBase._getNonVerbatimBridgedCount()
- Most __SwiftDeferredNSArray members
2018-10-26 23:53:34 +01:00
Karoy Lorentey
a8f29a3ce5 [stdlib] Simplify _HeapBuffer; limit its scope and rename to _BridgingBuffer
- HeapBuffer was at the wrong abstraction level, for no good reason. We have ManagedBuffer for the general case; we don’t need a slightly less general variant of it.
- Current usages of HeapBuffer are hyper specific: they all are flat buffers of AnyObjects, facilitating bridging. It makes sense to dedicate _HeapBuffer for this single usecase.
- Introduce a dedicate ManagedBuffer subclass for bridging buffers. This will make it slightly easier to recognize these in heap dumps.
- Inlinability audit.
2018-10-26 23:53:06 +01:00
Mike Ash
f4db1dd7a4 Merge pull request #19614 from mikeash/no-internal-export
[Stdlib] Change SWIFT_RUNTIME_STDLIB_INTERNAL to not export the symbol.
2018-10-05 09:26:03 -04:00
Ben Cohen
9ce2143335 Additional ownership annotations 2018-10-03 19:10:22 -07:00
Mike Ash
e18e03171f [Stdlib] Change SWIFT_RUNTIME_STDLIB_INTERNAL to not export the symbol.
The functions in LibcShims are used externally, some directly and some through @inlineable functions. These are changed to SWIFT_RUNTIME_STDLIB_SPI to better match their actual usage. Their names are also changed to add "_swift" to the front to match our naming conventions.

Three functions from SwiftObject.mm are changed to SPI and get a _swift prefix.

A few other support functions are also changed to SPI. They already had a prefix and look like they were meant to be SPI anyway. It was just hard to notice any mixup when they were #defined to the same thing.

rdar://problem/35863717
2018-10-03 09:55:33 -04:00
Mike Ash
317451c8ee [Runtime][Stdlib][Overlays] Add comments to all the renamed classes explaining the rename and noting that the old name cannot be used due to conflicts.
rdar://problem/35768222
2018-09-20 12:07:30 -04:00
Mike Ash
798edb9d0e [Runtime][Stdlib][Overlays] Rename various Objective-C classes and methods that would conflict when loading old Swift libraries into a process alongside ABI-stable libraries.
rdar://problem/35768222
2018-09-13 16:55:10 -04:00
Erik Eckstein
6ba45473df Remove the pinning addressors
It was used for Array + related types.
With exclusivity checking the pinned addressors are not useful anymore.

rdar://problem/35401528
2018-08-23 12:47:56 -07:00
Slava Pestov
89e48ff2e8 stdlib: change a var to a let to squash a warning 2018-05-12 01:48:29 -07:00
Erik Eckstein
b519d1d873 stdlib: Speed up UTF8View -> Array conversion by using _copyContents 2018-05-08 13:52:05 -07:00
Slava Pestov
2e5aef9c8d stdlib: Remove redundant @usableFromInline attributes 2018-04-06 00:02:30 -07:00
Slava Pestov
e1f50b2d36 SE-0193: Rename @_inlineable to @inlinable, @_versioned to @usableFromInline 2018-03-30 21:55:30 -07:00
Lance Parker
fef19d44ee Fix a data race with _swiftEmptyArrayStorage's count 2018-02-21 15:43:27 -08:00
Ben Cohen
9ee856f386 [stdlib][WIP] Eliminate (Closed)CountableRange using conditional conformance (#13342)
* Make Range conditionally a Collection

* Convert ClosedRange to conditionally a collection

* De-gyb Range/ClosedRange, refactoring some methods.

* Remove use of Countable{Closed}Range from stdlib

* Remove Countable use from Foundation

* Fix test errors and warnings resulting from Range/CountableRange collapse

* fix prespecialize test for new mangling

* Update CoreAudio use of CountableRange

* Update SwiftSyntax use of CountableRange

* Restore ClosedRange.Index: Hashable conformance

* Move fixed typechecker slowness test for array-of-ranges from slow to fast, yay

* Apply Doug's patch to loosen test to just check for error
2018-02-01 20:59:28 -08:00
Slava Pestov
834a121b10 AST: @objc_non_lazy_realization should be underscored and UserInaccessible 2018-01-21 01:31:44 -08:00
Greg Parker
da14cd79a6 [runtime] Clean up symbol exports in libc functions. (#13202) 2017-12-01 17:49:11 -08:00
Max Moiseev
a24998a5b1 [stdlib] Add missing @_fixed_layout attributes to fix resilience build 2017-10-02 15:19:06 -07:00
Max Moiseev
ef6b5c4795 Add missing @_inlineable attributes and deinits 2017-09-29 11:26:56 -07:00
Max Moiseev
53b8419279 [stdlib] Make all the stdlib APIs @_inlineable
This change in theory should allow us to remove a special stdlib-only
sil-serialize-all compilation mode.

<rdar://problem/34138683>
2017-09-29 11:26:56 -07:00
Ben Cohen
ea2f64cad2 [stdlib] Add Sequence.Element, change ExpressibleByArrayLiteral.Element to ArrayLiteralElement (#8990)
* Give Sequence a top-level Element, constrain Iterator to match

* Remove many instances of Iterator.

* Fixed various hard-coded tests

* XFAIL a few tests that need further investigation

* Change assoc type for arrayLiteralConvertible

* Mop up remaining "better expressed as a where clause" warnings

* Fix UnicodeDecoders prototype test

* Fix UIntBuffer

* Fix hard-coded Element identifier in CSDiag

* Fix up more tests

* Account for flatMap changes
2017-05-14 06:33:25 -07:00
Ben Cohen
1163ea7c7a [stdlib] swapAt method (#9119)
* Add swapAt method

* Migrate sorting to swapAt

* Migrate further stdlib usage
2017-04-29 11:55:00 -07:00
Doug Gregor
cc225eb9fa [Stdlib] Silence all warnings about deprecated @objc inference.
This eliminates 26 Objective-C entry points that we never intended to expose, but that came “for free” with the @objc inference rules.
2017-03-31 21:53:55 -07:00
Roman Levenstein
29ad714bb7 Annotate stdlib functions to get a good performance even in resilient mode, when -sil-serialize-all is disabled
This commit mostly improves the performance of arrays and ranges.
It does not cover Strings, Dictionaries and Sets yet.
2017-03-16 19:46:11 -07:00
Ben Cohen
578a52627a Merge branch 'master' into se-147 2017-01-07 13:19:15 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Ben Cohen
fefc2e40df Migrate _copyContents to be called from UnsafeMutableBufferPointer with checks for overrun. 2017-01-05 11:59:49 -08:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Ben Cohen
3f534c254d Merge pull request #5485 from airspeedswift/expectEnd-labels-fixme
[stdlib] Add arg labels to _expectEnd (ABI FIXME #15)
2016-10-26 18:03:51 -07:00
Ben Cohen
81473386df added arg labels to _expectEnd 2016-10-26 12:58:44 -07:00
Joe Shajrawi
103ac620d6 always inline Array's getters and setters 2016-10-25 16:16:00 -07:00
Slava Pestov
28764374a6 stdlib: Remove workaround for rdar://15520519, resolving ABI FIXME#141 2016-10-24 02:16:21 -07:00
ben-cohen
d34f3ee96d Remove dummy Void args working around fixed typechecker bug – ABI FIXME #26 2016-10-11 17:56:42 -07:00
Slava Pestov
fab574c3a7 stdlib: Add some @_versioned declarations to fix resilient build
A recent change made accessibility checking stricter. This had some
fallout on the half-baked @_versioned attribute, where we could no
longer define @_versioned members on a non-@_versioned type.

This was wrong anyway (and will be diagnosed when we add proper
diagnostics for @_versioned), because type metadata for the
internal type did not get the right linkage, but it used to work
as long as you didn't try to get the type metadata at runtime.

This patch adds @_versioned attributes to the right types now that
this broken behavior is gone.

As a result, _Variant{Set,Dictionary}Storage became resilient
(non-@_versioned internal types are not resilient), which broke
too many tests that assumed you can exhaustively switch over all
the cases. Since eager-bridging is going to eliminate this enum
anyway (or so I've heard), make it @_fixed_layout for now.
2016-09-30 18:28:11 -07:00
airspeedswift
ed5231b47c Numbered all FIXME(ABI) entries for tracking purposes. (#4868) 2016-09-19 16:41:41 -07:00
practicalswift
fa7fbdb8b0 [gardening] Remove redundant nil-initialization of optional variable
From the Swift documentation:

"If you define an optional variable without providing a default value,
 the variable is automatically set to nil for you."
2016-09-18 07:40:07 +02:00
Erik Eckstein
266a5f90bd stdlib: Use builtin tail-allocated arrays instead of ManagedBuffer to allocate contiguous array buffers.
This reduces the amount of SIL generated for array operations significantly.
The generated code should be mostly the same (modulo different inlining decisions).
2016-09-16 11:02:19 -07:00
Dmitri Gribenko
fbb3cf35a5 Revert "New SIL instructions to support tail-allocated arrays in SIL." 2016-09-15 00:25:25 -07:00
Erik Eckstein
1201d96cb2 stdlib: Use builtin tail-allocated arrays instead of ManagedBuffer to allocate contiguous array buffers.
This reduces the amount of SIL generated for array operations significantly.
The generated code should be mostly the same (modulo different inlining decisions).
2016-09-14 14:54:18 -07:00
Nate Cook
8b39706c3f [stdlib] Documentation revisions
- Various edits
- Standardized complexity formatting
2016-08-12 12:24:36 -05:00
Dmitri Gribenko
11b7e9a742 stdlib: mark APIs on internal types as internal 2016-08-07 15:37:16 -07:00
Dmitri Gribenko
3c741bab7c stdlib: mark _ArrayBuffer, _ContiguousArrayBuffer, and _SliceBuffer internal 2016-08-07 15:13:59 -07:00
Dmitri Gribenko
2708afecc7 stdlib: internalize the _uninitializedCount initializer of array buffer 2016-08-07 15:11:54 -07:00
Dmitri Gribenko
901a0fb663 stdlib: mark some Array buffers implementation details as internal 2016-08-07 15:11:54 -07:00
Dmitri Gribenko
9705ccb9f2 stdlib: add underscores to an initializer on ArrayBufferProtocol 2016-08-07 14:20:37 -07:00
Andrew Trick
3bdf6c43a6 Fix unnecessary mutability of buffer elements. 2016-08-06 21:16:49 -07:00
Michael Ilseman
b7c9eddd11 [noescape by default] drop @noescape from stdlib 2016-08-04 16:09:01 -07:00