Commit Graph

44 Commits

Author SHA1 Message Date
Xiaodi Wu
f9435b9ce8 [stdlib] Restore MemoryLayout.*(ofValue:) 2016-08-08 10:46:37 -05:00
Rintaro Ishizaki
c6f4bcd01e [SE-0101] MemoryLayout: Migrate testsuite and benchmarks 2016-07-30 03:11:45 +09:00
Bob Wilson
58395b3b2f [SE-0127] Add "to:" argument label to withUnsafe[Mutable]Pointer.
rdar://problem/26529498
2016-07-26 17:44:33 -07:00
Bob Wilson
112451c44a [SE-0127] Remove withUnsafePointers and withUnsafeMutablePointers APIs.
These provide the same functionality as the one-argument versions for both
2 and 3 argument closures. Since these are less common, the same thing can be
achieved by composing the one-argument version. rdar://problem/26529498
2016-07-26 17:43:33 -07:00
Dmitri Gribenko
a85a8c1948 OpenCL overlay: make the test more robust by allowing any device 2016-05-16 11:44:11 -07:00
Jacob Mizraji
e17bc326b2 Test fix for OpenCLSDKOverlay 2016-05-05 14:23:32 -07:00
practicalswift
dc6c2aeef6 [gardening] "Type->Type" → "Type -> Type" in Swift code 2016-04-13 23:03:55 +02:00
Dave Abrahams
1c3d998951 Revert "[gardening] "Type->Type" → "Type -> Type" in Swift code"
This reverts commit 14edeaf67a because
it's breaking tests:
https://ci.swift.org/job/oss-swift-incremental-RA-osx/lastFailedBuild/consoleFull#1361088108ee1a197b-acac-4b17-83cf-a53b95139a76
2016-04-13 10:29:57 -07:00
practicalswift
14edeaf67a [gardening] "Type->Type" → "Type -> Type" in Swift code 2016-04-13 10:51:53 +02: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
practicalswift
abfecfde17 [gardening] if ([space]…[space]) → if (…), for(…) → for (…), while(…) → while (…), [[space]x, y[space]] → [x, y] 2016-04-04 16:22:11 +02:00
Slava Pestov
49c54870c1 Serialization: Auto-linking recursively walks modules imported from -sil-serialize-all modules 2016-04-01 12:21:36 -07:00
Max Moiseev
bb3eaaf308 Merging in latest master 2016-02-24 15:10:25 -08:00
Max Moiseev
61c837209b Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-04 16:13:39 -08:00
David Farler
8a5ed405bf Make var parameters an error for Swift 3
This finishes up revisions to SE-0003 - only var function parameters
are disallowed for Swift 3.
2016-01-30 12:39:17 -08:00
David Farler
3f635d04c7 Reinstante var bindings in refutable patterns, except function parameters.
This reverts commits: b96e06da44,
                      8f2fbdc93a,
                      93b6962478,
                      64024118f4,
                      a759ca9141,
                      3434f9642b,
                      9f33429891,
                      47c043e8a6.

This commit leaves 'var' on function parameters as a warning to be
merged into Swift 2.2. For Swift 3, this will be an error, to be
converted in a follow-up.
2016-01-29 15:27:08 -08:00
Dmitri Gribenko
9bcd5a1056 Collection.length => .count 2016-01-22 18:41:19 -08:00
Erik Eckstein
adef0368bb tests: add import statements to workaround linker errors in all relevant tests.
This is needed if we compile StdlibUnittest with -sil-serialize-all
So far I added the imports only in files which needed them. But this may change, depending on the optimizer (inlining).
Adding them in all files doesn't harm and avoids confusion if someone makes an unrelated change which would result in such a linker error.
2016-01-21 09:59:50 -08:00
Max Moiseev
f51e708a8f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-04 12:25:25 -08:00
Dmitri Gribenko
9d5cbc4428 Revert "Removed the ++ and -- operators" 2015-12-26 12:48:02 +01:00
David Walter
23772b1a21 Merge remote-tracking branch 'apple/master'
# Conflicts:
#	stdlib/private/SwiftPrivate/ShardedAtomicCounter.swift
#	stdlib/public/core/ArrayCast.swift
#	stdlib/public/core/Collection.swift
#	stdlib/public/core/ContiguousArrayBuffer.swift
#	stdlib/public/core/StringBuffer.swift
#	stdlib/public/core/StringUnicodeScalarView.swift
#	test/1_stdlib/Builtins.swift
#	test/1_stdlib/Collection.swift
#	test/1_stdlib/ErrorType.swift
#	test/1_stdlib/ErrorTypeBridging.swift
#	test/1_stdlib/ExistentialCollection.swift
#	test/1_stdlib/Float.swift
#	test/1_stdlib/Map.swift
#	test/1_stdlib/Mirror.swift
#	test/1_stdlib/Optional.swift
#	test/DebugInfo/arg-debug_value.swift
#	test/DebugInfo/closure.swift
#	test/DebugInfo/for.swift
#	test/DebugInfo/return.swift
#	test/Interpreter/availability_weak_linking.swift
#	test/Interpreter/break_continue.swift
#	test/SILGen/sil_locations.swift
#	test/SILGen/statements.swift
#	test/SILGen/unreachable_code.swift
#	test/SILPasses/definite_init_diagnostics.swift
#	test/SILPasses/return.swift
#	test/SILPasses/switch.swift
#	test/SILPasses/unreachable_code.swift
2015-12-24 13:18:29 +01:00
ken0nek
a03824e3a9 Add spaces before and after closure arrow in validation-test/stdlib 2015-12-23 04:57:29 +09:00
Max Moiseev
f4aaece75e revisiting CString related String extensions 2015-12-17 17:27:29 -08:00
Dmitri Gribenko
73ce9ae7e9 Collection.count => .length
And other API changes that naturally fall out from this, like
Array(repeating:count:) => Array(repeating:length:).
2015-12-17 15:55:29 -08:00
Max Moiseev
3fe0c60d7f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2015-12-17 11:00:02 -08:00
Daniel Duan
ebb0c3a204 replaced single-line ++/-- with +=/-= 2015-12-15 09:05:37 -08:00
Max Moiseev
d610fa0d1c Merge remote-tracking branch 'origin' into swift-3-api-guidelines 2015-12-10 10:29:52 -08:00
Dmitri Gribenko
df17ddbc9b init(count: Int, repeatedValue: Element) => init(repeating:count:)
Affected types: _ArrayType, Array, ArraySlice, ContiguousArray, Repeat,
String (initializers from Character and UnicodeScalar)
2015-12-09 17:14:37 -08:00
David Walter
dacd6834a6 Merge remote-tracking branch 'apple/master' 2015-12-08 20:28:54 +01:00
Nadav Rotem
a652945d9a Revert "A small step towards removing C-style loops"
This reverts commit 0d001480a9.

The commit that changed the iteration style from c-based loops into for-each
loops caused major regressions in our string benchmarks. Arnold believes that we
are making a different inlining decision in the for-each loops. We should
reapply this patch after we fix the optimizer

The regression was detected in rdar://23776732.
2015-12-08 09:17:17 -08:00
David Walter
4d80d1001b Reverted unnecessary changes 2015-12-07 02:47:17 +01:00
David Walter
e178c513fd Removed C-style loops and postincrements
Removed some C-style loops and postincrements
2015-12-06 16:38:47 +01:00
Haris Amin
0d001480a9 A small step towards removing C-style loops 2015-12-06 01:07:24 -05:00
Michael Gottesman
45308f68b1 Try apply insts can also have guaranteed parameters.
This was a piece of code that was not updated with FullApplySite when try_apply
was added.

rdar://23505191
2015-11-19 08:33:56 -08:00
Xin Tong
6b1328d059 Reapply XFAIL OpenCLSDKOverlay.swift to appease the bots for now. Bug tracked in rdar//23505191 2015-11-14 06:43:42 -08:00
Xin Tong
670c105a9e Revert "Reapply XFAIL OpenCLSDKOverlay.swift to appease the bots for now. Bug tracked in rdar//23505191"
This reverts commit 8c55907efd.

Committed some of my local changes.
2015-11-14 06:42:23 -08:00
Xin Tong
8c55907efd Reapply XFAIL OpenCLSDKOverlay.swift to appease the bots for now. Bug tracked in rdar//23505191 2015-11-14 06:35:55 -08:00
Jordan Rose
bdc42e71d9 Revert several commits working around the autolinking breakage.
Swift was failing to autolink frameworks in the new text-based SDKs.
Clang r253060 fixes the underlying issue, so we can go back to relying
on autolinking for these.

This reverts the following commits (newest to oldest):
f658841
59092a3
7ea9d54
e52ef22

rdar://problem/23511008
2015-11-13 20:21:04 -08:00
Michael Gottesman
59092a3fa3 Disable a test until rdar23505191 is fixed. 2015-11-12 17:03:00 -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
Arnold Schwaighofer
ee0a1d1a58 More executable tests in validation-test
Swift SVN r29279
2015-06-03 23:28:45 +00:00
Dmitri Hrybenko
f46f16ae82 stdlib: implement new print() API
rdar://20775683

Swift SVN r28309
2015-05-08 01:37:59 +00:00
Dmitri Hrybenko
ea344fc49a tests: use println() instead of print() with a "\n"
Swift SVN r27920
2015-04-29 21:29:59 +00:00
Dave Abrahams
cb68f83129 [stdlib] Fix OpenCL overlay test
Just replace it with a translation of some C sample code, and switch up
the way the kernel args are passed

Swift SVN r25426
2015-02-20 15:24:31 +00:00