Commit Graph

7762 Commits

Author SHA1 Message Date
Maxim Moiseev
7372e9e045 COpaquePointer => OpaquePointer 2015-12-07 16:52:45 -08:00
Max Moiseev
d0e1cb3a0e Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2015-12-07 16:43:20 -08:00
Nick van der Ploeg
42b4b02df3 Fixed typos in comments throughout the project. 2015-12-07 12:15:52 -06:00
Florian Reinhart
2134e55c25 Fix typo in comment 2015-12-07 14:24:11 +01:00
Radek Pietruszewski
d029f7e5ae Fix typo in UnavailableStringAPIs.swift.gyb 2015-12-06 11:28:35 +01:00
Dmitri Gribenko
8bba74eaee Merge pull request #241 from codestergit/master
[stdlib] Used map and guard for nil handling
2015-12-05 23:48:59 -08:00
Dmitri Gribenko
403b46ccea stdlib: simplify code 2015-12-05 23:29:31 -08:00
Dmitri Gribenko
4b8fff424b Merge pull request #270 from hamin/cleaning-up-cstyle-loops
A small step towards removing C-style loops
2015-12-05 22:47:26 -08:00
Haris Amin
0d001480a9 A small step towards removing C-style loops 2015-12-06 01:07:24 -05:00
codestergit
6e85e69283 [stdlib] Using map and guard let for nil handling 2015-12-06 04:01:33 +05:30
Alfredo Delli Bovi
e437c4557c Fix typo in comments 2015-12-05 15:34:45 +01:00
Dmitri Gribenko
f47f206ca0 Merge pull request #164 from jawwad/remove-trailing-semicolons-from-stdlib
Remove trailing semicolons from files in stdlib
2015-12-05 01:28:37 -08:00
Dmitri Gribenko
16de5d1fc4 Merge pull request #203 from landonf/landonf/freebsd-patchset-1
Partial FreeBSD Support
2015-12-04 22:14:38 -08:00
Ted Kremenek
4c153f6a95 Merge pull request #230 from wxxsw/whitespaces
Erase redundant whitespaces.
2015-12-04 21:56:30 -08:00
Ge Sen
20030242bd Erase redundant whitespaces. 2015-12-05 12:11:47 +08:00
Rob Hudson
14960fdb1e Fix typo 2015-12-04 22:48:17 -05:00
Joe Groff
76eb96e29e Runtime: Reinstate _stdlib_demangleName hook.
This is needed for Xcode support, even though it appeared dead within the Swift repo itself.
2015-12-04 18:45:51 -08:00
Patrick
14fdf744b0 Make documented complexity consistent
Since most of the documentation in the code use O(`self.count`) instead of O(`count`), change the inconsistent code documentation to O(`self.count`).
2015-12-04 17:15:55 -08:00
Landon Fuller
83b706df8a Merge branch 'master' into landonf/freebsd-patchset-1 2015-12-04 17:11:54 -07:00
aschwaighofer
ea848834f9 Merge pull request #193 from chriseidhof/use-map
Use Optional's built-in map
2015-12-04 18:06:08 -05:00
Landon Fuller
a7ec794287 Add basic build system and Driver support for FreeBSD targets/hosts. 2015-12-04 12:24:46 -07:00
Chris Eidhof
44b0e4f2dd Use Optional's built-in map 2015-12-04 09:15:29 -08:00
Jawwad Ahmad
8f6f5ab0dd [stdlib] Remove trailing semicolons from files in stdlib 2015-12-04 15:50:13 +05:00
ken0nek
2218e433b4 Add whitespaces after comma and remove redundant whitespaces.
Manage whitespaces

Remove unrelated line

Fix

Fix again
2015-12-04 15:36:34 +09:00
Thomas Jeans
8b7cee09cc Fix typo 2015-12-03 22:40:27 -05:00
Noah Fradin
048327cd02 Update Shims.swift 2015-12-03 16:36:19 -08:00
Vincent Esche
b7a6236040 Fixing wrong method documentation for SetAlgebra (see my rdar://22031133)
Spot the error:

	/// Return true iff `self.intersect(other).isEmpty`.
	@warn_unused_result
	func subtract(other: Self) -> Self
	
	…
	
	/// Return true iff `self.intersect(other).isEmpty`.
	@warn_unused_result
	func isDisjointWith(other: Self) -> Bool

😉
2015-12-03 21:44:26 +01:00
Johan K. Jensen
fa76656c82 Remove instances of duplicated words 2015-12-03 20:00:29 +01:00
Johan K. Jensen
110f48d2a5 Update referenced IntegerArithmetic filename 2015-12-03 19:42:38 +01:00
Riley Avron
d3fa0c1b91 Fix typo in String.swift documentation. 2015-12-03 09:42:23 -08:00
Dmitri Gribenko
f431025638 stdlib: Fix documentation comments for Sequence.{dropFirst(),dropLast()} 2015-12-02 10:29:07 -08:00
Joe Groff
fed7f79147 Runtime: Static-ize swift_unsafeReflectAny.
The _unsafeReflect entry point never ended up getting used on the Swift side, so don't export it, and remove the _silgen_name'd declaration.
2015-12-02 09:39:29 -08:00
Dmitri Gribenko
174d475833 stdlib: Remove unavavailable APIs that were left as migration aids
These APIs are from the Swift 1.2 => Swift 2.0 transition, and are not
relevant anymore.

Removing them reduces the surface area of the library that needs to be
reviewed.
2015-12-02 01:19:50 -08:00
Nadav Rotem
b6c284b24f Rename a variable. NFC.
"builder" -> "result", as requested by @gribozavr.
2015-12-01 17:10:42 -08:00
Nadav Rotem
2b47167d24 Simplify another implementation of map() and filter().
This commit removes _UnsafePartiallyInitializedContiguousArrayBuffer from two
more methods. I did not measure the performance impact of this change but I am
expecting this code to run faster.
2015-12-01 17:10:42 -08:00
Nadav Rotem
8885997807 Simplify map() to a simple loop
This commit simplifies map() of collections into a simple append-loop. The Swift
optimizer can do a better job optimizing code without unsafe constructs. This
change accelerates the MapReduce benchmark by 2x.
2015-12-01 12:32:30 -08:00
Andrew Trick
c1e45d899e Add a shim: swift_stdlib_objcDebugDescription, NFC.
This allows removal of the DebugDescription protocol which is invalid
because no classes actually conform to it. The problem is that we need
to send a debugDescription message to an NSObject without loading
Foundation. This is exactly what shims are for. A very simple shim
solves the problem.
2015-11-18 18:40:45 -08:00
Andrew Trick
b3604aaa83 Remove the fake _CocoaStringType protocol, NFC.
Adding a conformance to Foundation doesn't work because NSString can
be used without loading Foundation. debugDescription is one example of
this.

The only value we derive from the _CocoaStringType is its name, which
makes some APIs more readable. Adding a type safe wrapper around it
serves no purpose since we're almost always immediately casting back
and forth from an 'id'. This was previously done with unsafeBitCast,
which should be avoided unless we really need to reinterpret a bit
pattern.
2015-11-18 18:40:45 -08:00
Joe Groff
fbd2e4d872 Rename @asmname to @_silgen_name.
This reflects the fact that the attribute's only for compiler-internal use, and isn't really equivalent to C's asm attribute, since it doesn't change the calling convention to be C-compatible.
2015-11-17 14:13:48 -08:00
Joe Groff
0fc6dc8e3b Runtime: Rename swift_stdlib_getDemangledTypeName to swift_getTypeName and decouple it from String.
Getting the name of a type seems like reasonable core runtime functionality, and something the runtime can cache on its side too. Have the function return a pointer to a raw string in memory owned by the runtime, and have it be wrappen in a Swift.String on the standard library side.
2015-11-17 08:37:50 -08:00
Enrico Granata
868035b7c8 Fix an issue where the PlaygroundQuickLook for an NSRange would cause a crash for certain values
rdar://problem/23153462
2015-11-16 13:26:44 -08:00
Jordan Rose
cf8baedee2 Re-apply "Rename @transparent to @_transparent for now."
This re-applies 90fcbfe9a6. I'll be committing
the corresponding change to Foundation momentarily.
2015-11-16 10:53:56 -08:00
Xin Tong
16843684b2 Revert "Rename @transparent to @_transparent for now."
This reverts commit 90fcbfe9a6.

Seems there are still some tests that are left not modified.
2015-11-14 07:04:31 -08:00
Jordan Rose
90fcbfe9a6 Rename @transparent to @_transparent for now.
This feature has not been fully designed, let alone properly implemented.
For more information, see docs/TransparentAttr.rst.
2015-11-13 16:25:34 -08:00
Joe Groff
d8b68590c6 Runtime: Remove unused swift_stdlib_demangleName stub. 2015-11-13 12:09:41 -08:00
Joe Groff
9690bda3a1 Remove dead @asmname declaration. 2015-11-13 08:37:13 -08:00
Joe Groff
49261a03af Runtime/stdlib: Remove _stdlib_getDemangledTypeName.
We don't really need its peculiar behavior characteristics; its uses in the legacy mirror implementations can now be replaced by direct stringification of metatypes.
2015-11-13 08:37:12 -08:00
Joe Groff
69a206229d Runtime: Start splitting out stubs only needed by the standard library.
Set up a separate libSwiftStubs.a archive for C++ stub functionality that's needed by the standard library but not part of the core runtime interface. Seed it with the Stubs.cpp and LibcShims.cpp files, which consist only of stubs, though a few stubs are still strewn across the runtime code base.
2015-11-11 17:28:57 -08:00
Maxim Moiseev
0ea9c29acd Remove unnecessary unsafeUnwrap calls.
Since `dropFirst` does not return an `Optional`,
`unsafeUnwrap(xs.dropFirst())` first implicitly wraps result of
`dropFirst` into an optional and then calls `unsafeUnwrap` on that.
2015-11-10 11:03:38 -08:00
David Farler
8f2fbdc93a Make function parameters and refutable patterns always immutable
All refutable patterns and function parameters marked with 'var'
is now an error.

- Using explicit 'let' keyword on function parameters causes a warning.
- Don't suggest making function parameters mutable
- Remove uses in the standard library
- Update tests

rdar://problem/23378003
2015-11-09 16:56:13 -08:00