Commit Graph

141 Commits

Author SHA1 Message Date
Arnold Schwaighofer
48d11bd540 stdlib: Fix test cases Dictionary.swift and Set.swift
After the llvm inliner fix to correctly handle notail calls we don't need this
anymore.

rdar://35639547
2017-11-27 12:21:46 -08:00
swift-ci
53ddcb5079 Merge pull request #13000 from gottesmm/pr-6a0399e1ebd7ccad1979a2af165d0b09595fb2cb 2017-11-18 20:55:27 -08:00
Michael Gottesman
89cefe0a70 [stdlib] Use a different access pattern to check uniqueness to work around more conservative SILGen codegen.
Using && here causes us to go down a SILGen path that guarantees that self will
be evaluated over the entire && expression instead of just the LHS. This cause
the uniqueness check to always return false at -Onone. At -O, the optimizer is
smart enough to remove this issue.

rdar://33358110
2017-11-18 20:16:28 -07:00
Pavel Yaskevich
57ccdf7423 Merge pull request #12520 from xedin/remove-strideable
[stdlib] changes to remove `_Strideable` protocol.
2017-11-16 19:06:40 -08:00
Pavel Yaskevich
7b121de1a0 [CSRanking] Change ranking to weight overload choices in evaluation order
Consider different overload choices for the same location in evaluation
order, this makes overload resolution more predictable because it's going
to follow expression bottom-up, that prevents situations when some
expressions are considered ambigious because choices taken further up
equate the score, instead each level is given distinct weight
based on evaluation order.

Resolves: rdar://problem/31888810
2017-11-16 13:38:24 -08:00
Arnold Schwaighofer
0971d82f70 SILGen: Remaining fixes for @callee_guaranteed closures and enable it
- Fix block to func reabstraction thunks block argument handling
- Forward cast ownership
- Fix applyPartiallyAppliedSuperMethod ownership for @callee_guaranteed closures
- Avoid a copy in buildBlockToFuncThunkBody
- Update tests for callee_guaranteed closures

SR-5441
rdar://33255593
2017-11-15 19:46:08 -08:00
Lance Parker
276f49af84 Merge pull request #11982 from lancep/comprehensiveArrayTests
[stdlib] Comprehensive array tests
2017-09-20 13:01:59 -07:00
Lance Parker
a386f747ed Removed more occurrences of the incorrect comment 2017-09-19 16:26:36 -07:00
Lance Parker
2ba35ca2b1 Added test that ensures Set conforms to SetAlgebra 2017-09-06 14:11:55 -07:00
Lance Parker
5644468a50 Add tests for all of the SetAlgebra methods on Set 2017-09-05 13:14:58 -07:00
Robert Widmann
e4bfd600cc Remove SwiftExperimental 2017-08-11 14:21:06 -07:00
swift-ci
4d5dfdd42c Merge pull request #10966 from rintaro/stdlib-hashedcollection-switchcase 2017-07-24 00:51:08 -07:00
Michael Gottesman
ab6a4f5249 Disable some failing tests.
rdar://33358110
2017-07-19 16:25:39 -07:00
Rintaro Ishizaki
d2eab3c342 [stdlib] Use #if guarded switch case
_Cocoa{Set,Dictionary}{Buffer,Index,Iterator} can be completely
eliminated from non-ObjC runtime environments.
2017-07-14 18:14:34 +09:00
Dmitri Gribenko
984210aa53 tests: replace '// RUN: rm -rf' '// RUN: mkdir' pairs with '%empty-directory(...)'
These changes were made using a script.
2017-06-04 11:08:39 -07:00
Nate Cook
2e2e4d9bda Revert "Revert "[stdlib] Dictionary/Set enhancements""
This reverts commit 328ebe8567.
2017-05-01 16:06:14 -05:00
Mark Lacey
ecfa406fc5 Re-instate "Improve disjunction selection"
Thie reinstates 3c5b393e0c, which was
backed out due to it exposing an ambiguous expression in a recent stdlib
commit.
2017-04-29 17:53:13 -07:00
Mark Lacey
1de530e229 Revert "Improve disjunction selection" 2017-04-29 10:45:15 -07:00
Mark Lacey
3c5b393e0c [Constraint solver] Rework how we select the next disjunction to visit.
We previously used a simple heuristic of visiting the disjunction with
the fewest number of elements in it.

Instead, this commit introduces a new way to select the best disjunction
to explore based on attempting disjunctions based on either how much
information we have about the associated type variables (e.g. how many
of the arguments of a function call in the case of bind overload
disjunctions) or by other criteria that help constraint the search or
split the connected components (e.g. coercions and calls to
initializers).

A key part of the improvement here is allowing the type checker to
attempt bindings of types to type variables when there are still
argument conversion constraints between type variables in the
system. The insight here is if there are no other constraints blocking
an attempt to bind types and we have types to try, we will be able to
test those types against active conformance constraints and potentially
fail much earlier while solving.

Visiting disjunctions in a different order exposed some other problems
with the type checker including a couple cases where map is used that
are now considered ambiguous due to problems in how we are ranking
solutions.

I measured an 11-13% reduction in type checking time for the standard
library using a release build of the compiler.
2017-04-28 00:50:16 -07:00
Doug Gregor
255fdb1d61 Fix some bogus bridging casts that were allowed in Swift 3.
Swift 3 unintentionally allowed collection casts from, e.g.,
Set<AnyHashable> to Set<NSObject>, when in fact the object
representation of the AnyHashable might not be an NSObject. Fix up our
tests and overlays that ran afoul of this rule.
2016-12-21 13:46:13 -08:00
Jordan Rose
88a4fbbbd7 [test] Update existing tests for array parameters with nullability.
No functionality change. These parameters were IUOs before; now
they're (correctly) true optionals.
2016-11-14 13:15:17 -08:00
Alexis Beingessner
8b44a07f58 remove nonsensical identity tests from test suite
The test was verifying that two independently constructed
empty cocoa sets somehow had the same identity. Not sure why this used
to hold, but it's definitely not something we guarantee.
2016-11-03 19:55:36 -04:00
Alexis Beingessner
7ec26fc976 fallout of renaming on tests which rely on internals
Some of these are kinda dubious, but I think this would be better
addressed as part of eager bridging, which will invalidate the concept
most of these are checking for.
2016-11-03 19:55:36 -04:00
Alexis Beingessner
052e94a34a refactor HashedCollections to support verbatim bridging 2016-11-03 19:52:30 -04:00
Alexis Beingessner
76c6281fea [stdlib] Rewriting native hashed collection indices
Changes:
- Native dictionary and set indices no longer hold references to storage
- Cocoa-based dictionary and set indices no longer hold references to storage
- Removed double indirection trick from hashed collections
- Rewrote storage types to reflect simpler model
- Updated unit tests
2016-10-29 10:04:35 -04:00
Dmitri Gribenko
39a3a1fb43 Eliminate boilerplate from stdlib tests 2016-09-15 10:20:09 -07:00
Dmitri Gribenko
c9041beea3 Migrate callsites from 'expectNotEmpty()' to 'expectNotNil()' 2016-09-10 20:05:43 -07:00
Dmitri Gribenko
243a35cd65 Migrate callsites from 'expectEmpty()' to 'expectNil()' 2016-09-10 20:05:42 -07:00
Doug Gregor
57f1090a11 Revert "[Set/Dictionary] Eliminate "bridging" collection entrypoints."
This reverts commit dc0ae675bc. The
change here (presumably the change to Foundation) caused a regression
in several of the bridging-related benchmarks, e.g.,
ObjectiveCBridgeFromNSSetAnyObjectToString, DictionaryBridge,
ObjectiveCBridgeFromNSDictionaryAnyObjectToString.
2016-08-24 13:20:03 -07:00
Doug Gregor
dc0ae675bc [Set/Dictionary] Eliminate "bridging" collection entrypoints.
Remove the functions
_(set|dictionary)Bridge(From|To)ObjectiveC(Conditional) from the
standard library. These entrypoints are no longer used by the compiler
(thanks to generalized collection up/downcasting), so stop using them
in Foundation and in tests.
2016-08-22 15:14:09 -07:00
Xiaodi Wu
f9435b9ce8 [stdlib] Restore MemoryLayout.*(ofValue:) 2016-08-08 10:46:37 -05:00
Joe Groff
c748ba6c12 Merge pull request #3870 from jckarter/no-bridged-default-literal-types
Sema: Don't try bridged classes as default literal types.
2016-07-29 22:16:53 -07:00
Robert Widmann
4f465224ea Polish off uses of dynamicType in tests 2016-07-29 16:59:14 -07:00
Dmitri Gribenko
99dffd7682 Merge pull request #3854 from rintaro/SE-0101-memorylayout
[SE-0101] Implement: Reconfiguring sizeof and related functions into a unified MemoryLayout struct - Part 1
2016-07-29 15:56:27 -07:00
Joe Groff
11f03cd8b5 Sema: Don't try bridged classes as default literal types.
One last bit of SE-0072. We shouldn't fall back to bridged classes in the absence of type context for literals anymore. By itself, this kind of hoses the use of literals with NS types, but I think we can get most of the QoI back with overlay changes I plan to propose following this.
2016-07-29 15:18:31 -07:00
Rintaro Ishizaki
c6f4bcd01e [SE-0101] MemoryLayout: Migrate testsuite and benchmarks 2016-07-30 03:11:45 +09:00
Arnold Schwaighofer
c65e1a31e3 Fix _bridgeToObjectiveC lookup code in optimizeBridgedSwiftToObjCCast
Previously it assumed that if we succeed in looking up the method in the current
module we must be able to request a definition (vs a declaration).

This is not true. It could be that we had declared the type in a different
module. Always ask for a declaration.

rdar://27547957
2016-07-28 14:54:16 -07:00
Arnold Schwaighofer
37b789007d Disable Dictionary/Set.swift tests that fail in optimize mode
Disable the tests in optimize mode until we have fix to unblock builders.

rdar://27547957
2016-07-27 07:50:32 -07:00
Joe Groff
21c15d8fe9 Update validation tests for id-as-Any. 2016-07-25 06:40:37 -07:00
Austin Zheng
d8b5a2a4fd [stdlib] Improving Dictionary/Set tests to use fewer unsafeBitCasts
NFC
2016-06-24 10:12:16 -07:00
Mishal Shah
87b7bcfd3e Update master to build with Xcode 8 beta 1, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs. 2016-06-14 14:53:55 -07:00
Rintaro Ishizaki
1bdce7ced6 [lit] Add substitutions: %utils and %line-directive
%utils => ${SWIFT_SOURCE_DIR}/utils
%line-directive => ${SWIFT_SOURCE_DIR}/utils/line-directive
2016-06-11 02:41:15 +09:00
Rintaro Ishizaki
4d686a424f [Parser] Don't report AttrsRequiringFoundation in inactive config block
Fixes rdar://problem/23487944
2016-05-26 02:43:21 +09:00
Rintaro Ishizaki
bcc18576cb [stdlib] Enable Set validation test on non-Darwin platforms 2016-05-17 18:45:23 +09:00
Dmitri Gribenko
0868b6f70c stdlib: Dictionary, Set: allow querying for a mismatched type when bridged
Swift's Dictionary and Set are typed, but when bridged to NSDictionary
and NSSet they should behave accordingly, that is, allow querying for
keys of arbitrary types.

rdar://problem/23679193
2016-05-16 15:30:44 -07:00
Joe Pamer
58f7e1568d Fix copy/paste error in Set test. 2016-05-06 23:18:13 -07:00
Joe Pamer
94c85b26b1 Add explicit bridging conversions to test/stdlib/Set.swift 2016-05-06 22:58:53 -07:00
Dmitri Gribenko
0562763c7b stdlib tests: remove unnecessary argument labels 2016-05-06 14:52:30 -07:00
Dave Abrahams
debde16e2c Merge set-api branch into swift-3-indexing-model 2016-04-26 15:56:42 -07:00
Dmitri Gribenko
fc8d62dfbb Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-18 14:40:06 -07:00