Commit Graph

24 Commits

Author SHA1 Message Date
Valeriy Van
e34ee7b61c Fixes example snippet in MemoryLayout.swift 2020-05-01 22:52:34 +02:00
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
Ben Cohen
dd2f3b4386 [stdlib] More inalienable auditing (#18925)
* Removing FIXME from methods also marked always/never

* Unavailable/deprecated things don't need inlining

* Trivial implementations

* Enum namespaces

* Unsafe performance of opaque/raw pointer

* Dump doesn't need to be fast

* Error paths shouldn't require inlining

* Consistency with surrounding code

* Lazy performance needs specialization
2018-08-23 18:52:21 -07:00
Nate Cook
efb0415a61 [stdlib] More documentation revisions (#18263)
- Fix error in `last(where:)` example
- Improve MemoryLayout, UnsafePointer, and integer operator discussions
- Clean up ranges and random APIs
- Revisions to overflow operators and the SignedNumeric requirements
- Standardize on 'nonoptional' in remaining uses
2018-08-08 00:25:09 -05:00
Joe Groff
c4806b5889 KeyPaths: Centralize alignment manipulations in helpers. 2018-07-27 13:15:49 -07:00
Ben Cohen
a6952decab [stdlib] Remove inlineable annotation from transparent functions (#17800)
* Remove inlineable annotation from transparent functions
2018-07-07 08:47:02 -07:00
Nate Cook
7a4e0a32f6 [stdlib] Revise documentation
This includes various revisions to the APIs landing in Swift 4.2, including:
- Random and other randomness APIs
- Hashable changes
- MemoryLayout.offset(of:)
2018-05-18 11:31:54 -05:00
Slava Pestov
5385db2519 stdlib: Even more old spellings of @inlinable / @usableFromInline have snuck in 2018-05-12 01:48:24 -07:00
Doug Gregor
7cb8c18838 SE-0210: improve documentation comments per @natecook1000's comments. 2018-05-10 09:18:28 -07:00
swift-ci
0eb5131669 Merge pull request #15519 from jckarter/key-path-offset 2018-05-09 18:00:21 -07:00
Slava Pestov
e1f50b2d36 SE-0193: Rename @_inlineable to @inlinable, @_versioned to @usableFromInline 2018-03-30 21:55:30 -07:00
Joe Groff
a6a792c740 Add a MemoryLayout<T>.offset(of:) method for getting the offset of inline storage.
If a key path refers to inline storage of the root type, this produces the offset in bytes between a pointer to the root and a pointer to the projected storage. Otherwise, returns nil.
2018-03-26 12:22:41 -07:00
Jordan Rose
9034ba617b Ban @_fixed_layout on enums in favor of @_frozen
In theory there could be a "fixed-layout" enum that's not exhaustive
but promises not to add any more cases with payloads, but we don't
need that distinction today.

(Note that @objc enums are still "fixed-layout" in the actual sense of
"having a compile-time known layout". There's just no special way to
spell that.)
2018-03-20 14:49:10 -07:00
Max Moiseev
5650f80937 [stdlib] Annotate types with @_fixed_layout
This will allows us to build the standard library in resilient mode by
default, hopefully, without performance regression.

<rdar://problem/36362648>
2018-01-09 14:46:30 -08: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
Nate Cook
b7af9bfe83 [stdlib] Remove SeeAlso tags 2017-06-13 11:23:51 -05:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Nate Cook
a14daa0c44 [stdlib] Address feedback from @gottesmm 2016-12-15 13:52:33 -06:00
Nate Cook
7494e2045e [stdlib] Revise unsafe pointers documentation
This revises and expands upon documentation for the standard library's
unsafe pointer types. This includes typed and raw pointers and buffers,
the MemoryLayout type, and some other top-level functions.
2016-12-14 14:58:24 -06: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
Erik Eckstein
7c374066e6 Remove the strideof_nonzero builtin.
Because now the stride of all types is at least one, anyway.
2016-09-14 13:24:19 -07:00
Xiaodi Wu
f9435b9ce8 [stdlib] Restore MemoryLayout.*(ofValue:) 2016-08-08 10:46:37 -05:00
Nate Cook
559092bbf2 [stdlib] Revise stdlib documentation comments
- Expand pre-example explanations
- Update documentation for SE-0118
- Removing remaining 'iff' usage
- Revise Array discussion
- Fix formIndex(_:offsetBy) parameter formatting
- Improve index/formIndex(_:offsetBy:(limitedBy:)?) discussion
- Update Quick Look discussions
- Fixes grammar inconsistencies
- Adds parameter / return documentation
- Adds and expands on examples
- Revises AnyObject discussion for new `id` bridging rules
- Revise readLine, print, and assertion functions
- Add missing docs to String index-moving methods
2016-08-05 16:07:46 -05:00
Rintaro Ishizaki
091506315b [SE-0101] Implement: Reconfiguring sizeof and related functions into MemoryLayout struct
As of now:

* old APIs are just marked as `deprecated` not `unavaiable`. To make it
  easier to co-operate with other toolchain repos.
* Value variant of API is implemented as public @private
  `_ofInstance(_:)`.
2016-07-30 03:09:28 +09:00