Commit Graph

34 Commits

Author SHA1 Message Date
Anthony Latsis
c731089068 Gardening: Migrate stdlib sources to GH issues 2022-09-26 06:30:49 +03:00
Florian Friedrich
67073c7a67 Fix typo in comparison in comments and help text 2020-07-09 18:05:25 +02:00
Michael Ilseman
30c92574ed [String] Concrete String/Substring overloads for ~=
Add concrete overloads for ~= for String/Substring
combinations. SR-12457 tracks making this generic after we understand
the expression type checker impact.
2020-04-02 10:37:30 -07:00
Paul Hudson
06f82a53b5 Replaced the majority of ' : ' with ': '. 2019-07-18 20:46:07 +01:00
Ravi Kandhadai
ee222c3fdf [Constant Evaluator] Add support for string appends and equals to
the constant evaluator.
2019-01-25 18:51:33 -08:00
Michael Ilseman
53ccd9e054 [string] Less inlining for code size.
Less inlining for hashing and comparison. Saves code size on very
frequent String comparison in exchange for costing us in some of our
ridiculuous micro-benchmarks.

Also adds in more _effects for better codegen
2018-11-04 10:42:42 -08:00
Michael Ilseman
d5da6fdbfd [String] More comparison speedups and cleanup 2018-11-04 10:42:41 -08:00
Michael Ilseman
7aea40680d [String] NFC iterator fast-paths
Refactor and rename _StringGutsSlice, apply NFC-aware fast paths to a
new buffered iterator.

Also, fix bug in _typeName which used to assume ASCIIness and better
SIL optimizations on StringObject.
2018-11-04 10:42:41 -08:00
Michael Ilseman
8851bac1be [String] Inlining, NFC fast paths, and more.
Add inlinability annotations to restore performance parity with 4.2 String.

Take advantage of known NFC as a fast-path for comparison, and
overhaul comparison dispatch.

RRC improvements and optmizations.
2018-11-04 10:42:41 -08:00
Michael Ilseman
4ab45dfe20 [String] Drop in initial UTF-8 String prototype
This is a giant squashing of a lot of individual changes prototyping a
switch of String in Swift 5 to be natively encoded as UTF-8. It
includes what's necessary for a functional prototype, dropping some
history, but still leaves plenty of history available for future
commits.

My apologies to anyone trying to do code archeology between this
commit and the one prior. This was the lesser of evils.
2018-11-04 10:42:40 -08:00
Michael Ilseman
ebdd5e6d98 [string] Fast-path for small string comparison
Promote small-string to small-string comparison into the fast path for
equality and less-than.

Small ASCII strings that are not binary equal do not compare equal,
allowing us to early exit. Small ASCII strings otherwise compare
lexicographically, which we can call prior to jumping through a few
intermediaries.
2018-05-24 14:47:04 -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
0661de22a2 [stdlib]Un-revert string comparison (#14694)
Restore (un-revert) sting comparison, with fixes

More exhaustive testing of opaque strings, which consistently reproduces prior sporadic failure. Shims fixups. Some test tweaking.
2018-02-18 10:50:33 -08:00
Lance Parker
abe6a6d177 Revert string comparison (#14657) 2018-02-15 14:37:43 -08:00
Lance Parker
897963a6f8 Unified String comparison strategy for all platforms 2018-02-14 15:44:11 -08:00
Michael Ilseman
6d1866f846 [StringGuts] Clean-up in preparation for merge.
Clean up a lot of the scattered utility functions, FIXMEs, etc in
preparation for the merge to master.
2018-01-21 12:38:49 -08:00
Karoy Lorentey
90e894729a [StringGuts] Linux support
Add support for compiling StringGuts without the Objective-C runtime.
2018-01-21 12:37:36 -08:00
Karoy Lorentey
f2a96496a0 [StringGuts] Support for 32-bit platforms
Add 32-bit support to the new StringGuts.
2018-01-21 12:36:09 -08:00
Michael Ilseman
3be2faf5d3 [String] Initial implementation of 64-bit StringGuts.
Include the initial implementation of _StringGuts, a 2-word
replacement for _LegacyStringCore. 64-bit Darwin supported, 32-bit and
Linux support in subsequent commits.
2018-01-21 12:32:26 -08:00
Greg Parker
da14cd79a6 [runtime] Clean up symbol exports in libc functions. (#13202) 2017-12-01 17:49:11 -08:00
Slava Pestov
c272d41e2f Re-apply "SIL: Remove special meaning for @_semantics("stdlib_binary_only")"
With -sil-serialize-all gone, this no longer means anything; just
don't declare the function as @_inlineable instead.

Fixes <rdar://problem/34564380>.
2017-10-04 14:07:52 -07:00
Jordan Rose
aab5f7aa4f Revert "SIL: Remove special meaning for @_semantics("stdlib_binary_only")" (#12270)
It still affects StdlibUnittest, which is still using -sil-serialize-all.
2017-10-04 12:49:21 -07:00
Slava Pestov
0fad13eeba SIL: Remove special meaning for @_semantics("stdlib_binary_only")
With -sil-serialize-all gone, this no longer means anything; just
don't declare the function as @_inlineable instead.

Fixes <rdar://problem/34564380>.
2017-10-03 13:48:22 -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
Maxim Moiseev
a5ff35cd41 [stdlib] extendingOrTruncating: => truncatingIfNeeded: 2017-07-26 11:09:36 -07:00
Ben Cohen
28c470da45 Test if two ascii string pointers are equal before memcmp (#10018) 2017-06-01 15:01:42 -07:00
Max Moiseev
2d49d17a75 [stdlib] Addressing the benchmark regression 2017-05-05 10:51:32 -07:00
Maxim Moiseev
1c1b2b966d [stdlib] String : RangeReplaceableCollection & BidirectionalCollection (#8921)
* [stdlib] String : RangeReplaceableCollection & BidirectionalCollection

* Add source compatibility hack for Swift.max

* Add source compatibility hack for Swift.min

* Remove redundant conformance in benchmarks

* Fix stupid typo I thought I'd already pushed

* XFAIL testing now-redundant conformance

* XFAIL an IDE test for now
2017-04-23 20:04:54 -07:00
Max Moiseev
2f5fd8e2ed Improving benchmarks 2017-03-27 14:59:27 -07:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01: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
Dmitri Gribenko
ef974af339 stdlib: disable an incorrect String comparison optimization on platforms that call ICU directly
... and add a test to ensure that the next attempt at writing this
optimization won't introduce a regression.
2016-09-06 22:46:40 -06:00
Dmitri Gribenko
fc6add3880 stdlib: move 'String : Comparable' conformance to a separate file
I'm about to add more code around it.
2016-09-04 14:01:35 -07:00