Commit Graph

160 Commits

Author SHA1 Message Date
Michael Ilseman
cdfeb88cfe [string] Simplify creation logic, especially for C strings.
Streamline internal String creation. Previously, everything funneled
into a single generic function, however, every single call of the
generic funnel had relevant specific information that could be used
for a more efficient algorithm.

In preparation for efficiently forming small strings, refactor this
logic into a handful of more specialized subroutines to preserve more
specific information from the callers.
2018-03-27 10:49:02 -07:00
Devin Coughlin
e9d0be2365 [stdlib] Fix exclusivity warning in SwiftPrivate/IO.swift. NFC. 2018-03-25 16:13:18 -07:00
Greg Parker
da14cd79a6 [runtime] Clean up symbol exports in libc functions. (#13202) 2017-12-01 17:49:11 -08:00
taylor swift
c85880899d implement SE 184: add allocation methods to Unsafe buffer pointers, drop all parameters from deallocation, adjust namings, and add repeated-value assignment methods 2017-11-17 21:28:03 -08:00
Roman Levenstein
c3bc08ec06 Remove any mention of sil-serialize-all related flags from CMake files and build-script-impl
These flags are not needed anymore.
2017-10-21 19:18:15 -07:00
Xiaodi Wu
3528479730 Silence compiler warnings 2017-07-05 23:56:44 -05:00
Dave Abrahams
ddf7ad517f UnicodeScalar => Unicode.Scalar 2017-05-11 15:23:25 -07:00
Max Moiseev
27889c6376 Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-06 15:54:44 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Max Moiseev
70b2343626 Merge branch 'master' into new-integer-protocols 2016-11-28 15:25:01 -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
Maxim Moiseev
655bfe2a57 FIXMEs to change FixedWidthInteger to BinaryInteger in generic code 2016-07-29 13:31:21 +03:00
Maxim Moiseev
6dbb572038 toIntMax is gone 2016-07-29 13:31:21 +03:00
Maxim Moiseev
6ccc6ae490 SetAlgebra conformance errors 2016-07-29 13:31:21 +03:00
Max Moiseev
28a252e33d Operators compile 2016-07-29 13:31:21 +03:00
Xiaodi Wu
670dbdc408 [SE-0134] Rename UTF8-related properties on String 2016-07-27 21:13:58 -05:00
Andrew Trick
2e0dd7b046 Use UnsafeRawPointer in withArrayOfCStrings.
To obey the memory model.
2016-07-27 08:05:55 -07:00
Tony Parker
3cb4a76fed Merge pull request #3576 from parkera/se86_outputstream
Rename OutputStream to OutputStreamable [SE-0086]
2016-07-19 13:45:01 -07:00
Andrew Trick
5a8271c621 Rename UnsafePointer allocate & deallocate. (#3608)
As proposed in SE-0107: UnsafeRawPointer:
Rename 'init(allocatingCapacity:)' to 'UnsafeMutablePointer.allocate(capacity:)'
Rename 'deallocateCapacity' to 'deallocate(capacity:)'

`allocate` should not be an initializer. It's primary function is to allocate
memory, not initialize a pointer.
2016-07-19 11:48:18 -07:00
Andrew Trick
73106dd7c3 Rename initialize(with:count:) to initialize(to:count:). (#3601)
As proposed in SE-0107: UnsafeRawPointer.

"with" is considered a vacuous preposition. "to" implies direction.
2016-07-18 23:37:45 -07:00
Tony Parker
2a4e916296 Rename OutputStream to TextOutputStream [SE-0086] 2016-07-18 16:47:23 -07:00
Brian Gesiak
328de9e280 [SR-1738] add_swift_library takes SHARED/STATIC arg
As a first step to allowing the build script to build *only*
static library versions of the stdlib, change `add_swift_library`
such that callers must pass in `SHARED`, `STATIC`, or `OBJECT_LIBRARY`.

Ideally, only these flags would be used to determine whether to
build shared, static, or object libraries, but that is not currently
the case -- `add_swift_library` also checks whether the library
`IS_STDLIB` before performing certain additional actions. This will be
cleaned up in a future commit.
2016-06-16 13:15:58 -04:00
rintaro ishizaki
6401324993 [stdlib] Apply tail style "where" clause to stdlib/{internal,private} 2016-06-02 12:01:21 +09:00
Dmitri Gribenko
a1e73a6b0d CMake: remove dead code 2016-05-31 21:57:07 -07:00
Bryan Chan
85fde8b1fb Add support for Linux s390x. LLVM's Swift calling convention support is used to ensure correct operations of C++ code in the runtime. This patch also includes some (incomplete) changes to enum handling to make enums work in most common cases. 2016-05-24 20:03:28 -04:00
Trent Nadeau
6e327b4ddb Updated stdlib to use @discardableResult and _ = . 2016-05-11 22:53:37 -04:00
Dave Abrahams
9bee5d182f [stdlib] location/formLocation => index/formIndex 2016-04-26 17:46:16 -07:00
Dave Abrahams
47a870cc50 [stdlib] Use location/formLocation for all index movement 2016-04-21 17:13:41 -07:00
Dmitri Gribenko
cfea1a3f58 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-14 17:00:46 -07:00
Dmitri Gribenko
c52787e900 Merge commit '9cdbec13eee72feccfc5f8b987882a8c52e8107b' into swift-3-indexing-model 2016-04-14 16:23:53 -07:00
Dmitri Gribenko
10697f939f Merge commit '510f29abf77e202780c11d5f6c7449313c819030' into swift-3-indexing-model 2016-04-14 13:45:27 -07:00
Jordan Rose
b5127aa747 Adjust private API withArrayOfCStrings.
Produce UnsafeMutablePointers instead of UnsafePointers, because that
matches the signatures of posix_spawn, execve, and similar.
2016-04-12 14:30:27 -07:00
Jordan Rose
bc83940301 Make pointer nullability explicit using Optional.
Implements SE-0055: https://github.com/apple/swift-evolution/blob/master/proposals/0055-optional-unsafe-pointers.md

- Add NULL as an extra inhabitant of Builtin.RawPointer (currently
  hardcoded to 0 rather than being target-dependent).
- Import non-object pointers as Optional/IUO when nullable/null_unspecified
  (like everything else).
- Change the type checker's *-to-pointer conversions to handle a layer of
  optional.
- Use 'AutoreleasingUnsafeMutablePointer<NSError?>?' as the type of error
  parameters exported to Objective-C.
- Drop NilLiteralConvertible conformance for all pointer types.
- Update the standard library and then all the tests.

I've decided to leave this commit only updating existing tests; any new
tests will come in the following commits. (That may mean some additional
implementation work to follow.)

The other major piece that's missing here is migration. I'm hoping we get
a lot of that with Swift 1.1's work for optional object references, but
I still need to investigate.
2016-04-11 20:06:38 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Dmitri Gribenko
5a12349e9c Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-01 14:12:13 -07:00
Han Sangjin
5c1854bfcf stdlib: Portable random function
Changed rand32() implementation using a random engine in C++11 <random>.
2016-03-31 04:39:46 +09:00
Dave Abrahams
01127b32d5 index(n, stepsFrom: i)
M-x findr-query-replace

\<advance(\([^:]+?\),\([
]+\)by: *\([^(),]*\|[^(),]+([^()]*)[^(),]*\)\(,\(?:[
]+\)limit: *\(?:[^()]*\|[^()]+([^()]*)[^()]*\)\)?)

index(\3,\2stepsFrom: \1\4)
2016-03-25 17:54:39 -07:00
Dave Abrahams
88a9f2e628 [stdlib] indexing model: Complete Interval/Range merge
Down to 22 failures; only 5 in stdlib tests
2016-03-18 10:04:09 -07:00
Dmitri Gribenko
dfedb6d418 New indexing model: make ... return RangeOfStrideable, this seems to match expectations better 2016-03-11 18:40:29 -08:00
Dmitri Gribenko
85fa40de89 New indexing model: uncomment SwiftPrivate.withArrayOfCStrings(), it builds now 2016-03-11 13:25:48 -08:00
Shawn Erickson
b097b55f1a New indexing model: fix RNG and addition of RandomAccess to UTF16View on foundation load 2016-03-10 07:29:41 -08:00
Dmitri Gribenko
886d5a707c Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-03-09 20:51:38 -08:00
Max Moiseev
7fe6916bf6 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-07 12:10:47 -08:00
Hugh Bellamy
c1b25bb32f [gardening] Remove double new lines from stdlib files 2016-03-05 15:44:54 +00:00
Shawn Erickson
fe42606062 [stdlib] - WIP moved aspects of ForwardIndex and BidirectionalIndex into their Collection equivalents 2016-03-04 07:40:59 -08:00
Jordan Rose
b319e3da32 stdlib: Adjust to insert(contentsOf:at:) and append(contentsOf:)
instead of insertContents(of:at:) and appendContents(of:),
originally insertContentsOf(_:at:) and appendContentsOf(_:)
per internal discussion.
2016-02-25 12:50:39 -08:00
Dave Abrahams
64a5165ecf stdlib: deinitializePointee(_) => deinitialize()
Tacking "Pointee" on just for unary operations (and especially
operations with an optional count) created inconsistency.
2016-02-23 15:34:20 -08:00
Dave Abrahams
d96b051d28 stdlib: initializePointee(_) => initialize(with:)
Tacking "Pointee" on just for unary operations (and especially
operations with an optional count) created inconsistency.
2016-02-23 15:15:23 -08:00
Max Moiseev
52f0cf49b0 [stdlib] indexOf => index(of:)/index(where:) 2016-02-23 11:45:11 -08:00
Max Moiseev
4b9eab6288 appendContentsOf => appendContents(of:) 2016-02-22 18:02:04 -08:00