Commit Graph

7427 Commits

Author SHA1 Message Date
Ben Rimmington
fc8cc33777 [stdlib] Update documentation of integer types (#74973)
* [stdlib] Remove docs from default implementations

Customized docs were not removed:

  public static var isSigned: Bool
  public static var max: Self
  public static var min: Self
  public var description: String
  public var magnitude: Self
  public init<T: BinaryInteger>(_ source: T)
  public func distance(to other: Self) -> Int
  public func advanced(by n: Int) -> Self

* [stdlib] Remove unused docs for "unsafe" methods

* [stdlib] Remove inherited "ReportingOverflow" docs

* [stdlib] Remove inherited docs for operators

Customized docs were not removed.
(`+`, `-`, `*`, `+=`, `-=`, `*=`)

Non-inherited docs were not removed.
(`&+`, `&-`, `&+=`, `&-=`, `&*=`)

* [stdlib] Reattach doc comments to their APIs

Use `rstrip()` to remove the trailing newline.
<https://docs.python.org/3/library/stdtypes.html#str.rstrip>

* [stdlib] Remove inherited docs from integer types

* [stdlib] Remove FIXME(ABI) comments

* [stdlib] Remove unused docs for operators

* [stdlib] Update example code for `-=` and `*=`

* [stdlib] Update internal gyb comments

* [stdlib] Move docs to BinaryInteger overrides

* [stdlib] Remove unused gyb code

* [stdlib] Fix `&-` and `&*` examples
2024-07-24 17:31:15 -05:00
Allan Shortlidge
6fb6a56b20 SILGen: Introduce macCatalyst support for if #available.
Upstream the necessary changes to compile `if #available` queries correctly
when a `macabi` target triple or a `-target-variant` is specified.
2024-07-23 17:00:10 -07:00
Mishal Shah
48d5aca28d Revert "Use associated objects to attach contiguous array buffers to lazy one…"
This reverts commit 7c011813f2.
2024-07-21 23:34:57 -07:00
Michael Ilseman
a0bf388bd5 UTF8-validation: speed up findInvalidRange (#75381)
Changes findInvalidRange from being O(n) to O(1).
2024-07-20 07:49:49 -06:00
Jaeho Yoo
ec78f498ec [stdlib] Correct documentation formatting in CompilerProtocols 2024-07-20 22:01:28 +09:00
David Smith
7c011813f2 Use associated objects to attach contiguous array buffers to lazy ones (#75148)
rdar://132124808
2024-07-19 23:21:41 -07:00
Minseong Kim
d5bcdca2b6 fix indentation from 1 space to 2 spaces 2024-07-19 16:41:58 +09:00
Carl Peto
de449c9611 revert atomics for now 2024-07-16 22:39:31 +01:00
Carl Peto
3689427834 [AVR] standard library support for AVR
- when compiling embedded cross compile target standard libraries, include AVR
- add 16-bit pointer as a conditional compilation condition and get the void pointer size right for gyb sources
- attempt to fix clang importer not importing __swift_intptr_t correctly on 16 bit platforms
- changed the unit test target to avr-none-none-elf to match the cmake build

[AVR] got the standard library compiling in a somewhat restricted form:

General
- updated the Embedded Runtime
- tweaked CTypes.swift to fix clang import on 16 bit platforms

Strings
- as discussed in https://forums.swift.org/t/stringguts-stringobject-internals-how-to-layout-on-16-bit-platforms/73130, I went for just using the same basic layout in 16 bit as 32 bit but with 16 bit pointers/ints... the conversation is ongoing, I think something more efficient is possible but at least this compiles and will probably work (inefficiently)

Unicode
- the huge arrays of unicode stuff in UnicodeStubs would not compile, so I skipped it for AVR for now.

Synchronization
- disabled building the Synchronization library on AVR for now. It's arguable if it adds value on this platform anyway.
2024-07-16 12:28:27 +01:00
Nate Cook
846a861660 Improve RangeSet initialization performance (#75089)
When initializing a range set with a group of overlapping, identical,
or empty ranges, the initializer can exhibit poor performance due
to removing the unneeded ranges during processing. This change uses
a partitioning scheme instead, only removing the unnecessary ranges
at the end of initialization.
2024-07-12 15:01:38 -05:00
Allan Shortlidge
14200e412c SILGen/stdlib: Remove _diagnoseUnavailableCodeReached_aeic().
It should no longer be necessary to provide an `@_alwaysEmitIntoClient` version
of `_diagnoseUnavailableCodeReached()`. This workaround was originally added to
provide compatibility with projects that were misconfigured to compile against
a newer stdlib but link against an older one.

Resolves rdar://119892482.
2024-07-11 14:53:03 -07:00
Allan Shortlidge
99dbbe4a12 AST: Promote BuiltinStoreRaw feature to baseline. 2024-07-09 14:28:29 -07:00
Allan Shortlidge
9717961202 AST: Promote BuiltinAllocVector feature to baseline. 2024-07-09 14:28:29 -07:00
Allan Shortlidge
ab99cac77d AST: Promote BuiltinUnprotectedStackAlloc feature to baseline. 2024-07-09 14:28:28 -07:00
Allan Shortlidge
7e4425c97e Merge pull request #75090 from tshortli/no-more-ncg-condfails
AST: Remove `NoncopyableGenerics` feature suppression
2024-07-08 23:03:40 -07:00
Allan Shortlidge
b1bf693f3f stdlib: Remove #if $NoncopyableGenerics guards.
The stdlib is always built with NoncopyableGenerics enabled, so `#if
$NoncopyableGenerics` guards in non-inlinable code are superfluous.
Additionally, the stdlib's interface no longer needs to support compilers
without the feature, so the guards in inlinable code can also be removed.
2024-07-08 17:44:24 -07:00
Allan Shortlidge
20d97556ae stdlib: Remove #if $TypedThrows guards.
https://github.com/swiftlang/swift/pull/72612 can be reverted because it is no
longer necessary for the interface of the stdlib to be compatible with
compilers without `$TypedThrows` support.
2024-07-08 16:52:52 -07:00
Nate Cook
6d4f4a45cf Improve RangeSet union performance (#74963) 2024-07-08 09:00:37 -05:00
Alexander Cyon
c21b1e68fd [stdlib] Fix typos 2024-07-06 13:09:57 +02:00
David Smith
3589044213 A new way to bridge constant NSStrings (#74881) 2024-07-03 20:38:33 -07:00
Alejandro Alonso
906d6e43c0 Merge pull request #74739 from Azoy/commandline-argc-ignore
[stdlib] Ignore argc when setting up CommandLine.arguments
2024-07-02 13:41:28 -07:00
Alejandro Alonso
1e2192e018 Update CommandLine.swift 2024-06-27 10:41:59 -07:00
Ben Rimmington
7d3b2ef7d1 [stdlib] Update documentation of {U}Int128 types 2024-06-27 14:19:13 +01:00
Guillaume Lessard
8897ba3bf5 Merge pull request #74710 from glessard/rdar128709914-again
[stdlib] remove more deprecations added by SE-0426
2024-06-26 16:08:11 -07:00
Alejandro Alonso
3285f56dad Ignore argc 2024-06-26 10:54:57 -07:00
Guillaume Lessard
a707b6849c [stdlib] remove more deprecations added by SE-0426 2024-06-25 14:43:19 -07:00
Kuba (Brecka) Mracek
fb0a1b96ae Merge pull request #73870 from kubamracek/embedded-libraries-cmake
[embedded] Add a embedded-libraries CMake target to simplify the test dependencies
2024-06-24 08:39:50 -07:00
Kuba Mracek
6eeef12849 [embedded] Add a embedded-libraries CMake target to simplify the test dependencies 2024-06-23 13:08:01 -07:00
Kuba (Brecka) Mracek
7d8a62a9a0 Merge pull request #74642 from kubamracek/embedded-fix-warnings
[embedded] Fix 3 compilation warnings in embedded stdlib
2024-06-22 06:54:13 -07:00
Kuba Mracek
1d9cebeb22 [embedded] Fix 3 compilation warnings in embedded stdlib 2024-06-21 21:28:33 -07:00
Alejandro Alonso
dd8a21e69f Merge pull request #74523 from Azoy/int128-attributes
[stdlib] Apply @_transparent consistently for (U)Int128
2024-06-20 18:28:34 -07:00
Karoy Lorentey
470a04cca3 Merge pull request #73807 from lorentey/stdlib-noncopyable-additions
[stdlib] API additions for basic noncopyable primitives
2024-06-20 13:32:23 -07:00
Alejandro Alonso
87a8edb368 Microoptimize _low and _high and remove else branch
Update UInt128.swift
2024-06-18 16:08:41 -07:00
Alejandro Alonso
f8f7d0c6d3 Make _low and _high public 2024-06-18 15:03:30 -07:00
Alejandro Alonso
839c49bec3 Microoptimize _lowWord and fix else branch 2024-06-18 15:03:13 -07:00
Alejandro Alonso
68952e8281 It is remainder, not remainer 2024-06-18 13:46:57 -07:00
Alejandro Alonso
95ce270a77 Get rid of remaining uses of precondition 2024-06-18 12:45:16 -07:00
Alejandro Alonso
b059766481 Apply @_transparent consistently for (U)Int128 2024-06-18 10:47:48 -07:00
Alejandro Alonso
95195c60af Mark UInt128.Words as frozen 2024-06-17 17:40:30 -07:00
Karoy Lorentey
9d947e4de0 [stdlib] Add missing overload of extracting for UnboundedRange
I keep forgetting that `some RangeExpression<Element>` does not cover the `UnboundedRange` form.
2024-06-17 15:03:12 -07:00
Kuba (Brecka) Mracek
03b0f0cc57 Merge pull request #74442 from kubamracek/embedded-string-to-pointer
[embedded] Implement missing _convertConstStringToUTF8PointerArgument to support string to pointer conversion
2024-06-17 10:45:39 -07:00
Kuba Mracek
92a39fce2f [embedded] Implement missing _convertConstStringToUTF8PointerArgument to support string to pointer conversion 2024-06-14 15:32:25 -07:00
Karoy Lorentey
5e95c6e3c5 [stdlib] Define _StdlibVersion.v6_1_0 and set it as the current version 2024-06-13 18:00:45 -07:00
Karoy Lorentey
d4564e4328 [stdlib] Define availability for SwiftStdlib 6.0 2024-06-13 16:35:42 -07:00
eeckstein
6debc33128 Merge pull request #74332 from eeckstein/swift_dynamiccastclass
embedded: add swift_dynamicCastClass runtime function
2024-06-13 07:31:44 +02:00
Kavon Farvardin
ec4a125f3e NCGenerics: ext's might not infer invertible req's
If the extension adds conformance to an invertible protocol, it's
confusing for people to also infer conditional requirements on the
generic parameters for those invertible protocols. This came up in the
review of SE-427.
2024-06-12 14:44:22 -07:00
Erik Eckstein
13ecb51612 embedded: add swift_dynamicCastClass runtime function
To enable dynamic class casts

rdar://129672994
2024-06-12 18:23:38 +02:00
Kuba Mracek
5e1721dd4a [embedded] Make Mirror present but unavailable 2024-06-10 13:40:36 -07:00
Karoy Lorentey
ab51f1630c [stdlib] API additions for basic noncopyable primitives
- Add `exchange(_:with:)`
- Add `Optional.take()`
- Add `Unsafe[Mutable]BufferPointer.extracting(_:)`
- Finish generalizing `withExtendedLifetime`
- Radically simplify the implementation of `swap(_:_:)`
2024-06-07 14:09:53 -07:00
Alex Lorenz
c8b5344d3e Merge pull request #72014 from compnerd/android
utils: support building android SDKs on Windows
2024-06-07 12:37:00 -07:00