Commit Graph

4274 Commits

Author SHA1 Message Date
Arnold Schwaighofer
094091c8d7 stdlib: Fix UXPass in ArrayNew.swift.gyb
Michael recently fixed the original issue that the xfail was for.

rdar://35639581
2017-11-27 13:50:40 -08:00
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
Doug Gregor
9554e61705 [AST] Fix a crash when conformance lookup fails during substitution.
The enclosing conformance-lookup operation can fail (i.e., it returns
Optional), but the nested call was force-unwrapping the optional from
an inner call for no particular reason. Stop doing that, which fixes
SR-6466.

Note that the offending code is still something that should go away in
time, so this is merely polishing the band-aid to avoid a crash that
occurs often with conditional conformances.
2017-11-24 23:18:11 -08:00
Pavel Yaskevich
090acade11 [stdlib] Remove iterator type workaround from ClosedRange
After changes to stdlib and type-checker related to removing
of the `_Strideable` it's now possible to properly support
iterator types for *ClosedRange without any workarounds.

Resolves: rdar://problem/25584401
2017-11-23 18:51:35 -08:00
Doug Gregor
050fd9b0a4 Merge pull request #13032 from DougGregor/conditional-conformances-superclass
[AST] Properly adjust substitution type for inherited conformances.
2017-11-19 22:25:42 -08:00
Doug Gregor
41e0648336 [AST] Properly adjust substitution type for inherited conformances.
When we substitute into an inherited conformance, make sure that we
follow the superclass chain from the new conforming type up to the
matching superclass *before* doing the substitution.

Fixes rdar://problem/35632543.
2017-11-19 21:50:24 -08:00
Hamish
79d8209ffa [stdlib] Use addressor for Dictionary's subscript(_:default:) 2017-11-19 15:45:27 +00: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
ematejska
a00b0749c4 Merge pull request #12849 from rudkx/SE-0054
SE-0054: Rework diagnostics for IUOs and revise Swift 3 /4 semantics.
2017-11-18 18:51:39 -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
Doug Gregor
9f1cd0bf6b [Stdlib] Move _OptionalNilComparisonType operators into an extension on Optional.
Because global operators are “meh”.
2017-11-17 20:41:43 -08:00
Mark Lacey
8b55a0f61b SE-0054: Rework diagnostics for IUOs and revise Swift 3 /4 semantics.
For Swift 3 / 4:

Deprecate the spelling "ImplicitlyUnwrappedOptional", emitting a warning
and suggesting "!" in places where they are allowed according to
SE-0054.

In places where SE-0054 disallowed IUOs but we continued to accept them
in previous compilers, emit a warning suggesting "Optional" or "?"  as
an alternative depending on context and treat the IUO as an Optional,
noting this in the diagnostic.

For Swift 5:

Treat "ImplicitlyUnwrappedOptional" as an error, suggesting
"!" in places where they are allowed by SE-0054.

In places where SE-0054 disallowed IUOs, emit an error suggestion
"Optional" or "?" as an alternative depending on context.
2017-11-18 11:41:53 +09:00
Pavel Yaskevich
b56786fc03 Merge pull request #12986 from xedin/rdar-35540159
[CSSolver] Prune disjunction choices based on their equivalence class
2017-11-17 13:05:04 -08:00
eeckstein
73fc4b221b Merge pull request #12976 from eeckstein/remove-semantic
Remove @_semantics("optimize.sil.never")
2017-11-17 07:54:31 -08:00
Doug Gregor
7ec8512b11 Merge pull request #12970 from DougGregor/conformance-interface-type
[AST] Store only interface types in NormalProtocolConformances.
2017-11-17 07:52:59 -08:00
Pavel Yaskevich
b16add7685 [CSSolver] Prune disjunction choices based on their equivalence class
There are situations where we know equivalence relationship between
multiple disjunctions, let's prune dependent choice space based on
choice picked for the parent disjunction.

Resolves: rdar://problem/35540159
2017-11-16 19:35:14 -08: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
Erik Eckstein
76f281510f Remove @_semantics("optimize.sil.never")
The replacement is @_optimize(none)
2017-11-16 14:11:52 -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
Doug Gregor
a8cd86f811 Add no-longer-crashing test case from rdar://problem/35441779. 2017-11-16 11:36:52 -08:00
Arnold Schwaighofer
ce2966dd6e Merge pull request #12957 from aschwaighofer/callee_guaranteed_closures
SILGen: Remaining fixes for @callee_guaranteed closures and enable it
2017-11-16 11:12:54 -08:00
Slava Pestov
3f51dbc3b1 Sema: Don't validate types when binding extensions 2017-11-15 21:55:55 -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
Slava Pestov
4096000530 Merge pull request #12942 from slavapestov/lazy-protocol-member-validation
Lazy protocol member validation
2017-11-15 18:03:40 -08:00
Slava Pestov
772bd7634c Sema: Lazily validate protocol members 2017-11-15 16:26:27 -08:00
Greg Parker
e8475cc130 Revert "Use conditional conformances to implement Equatable for Optional, Array and Dictionary" 2017-11-15 14:17:22 -08:00
Slava Pestov
eea544f4e5 Merge pull request #12931 from slavapestov/you-do-not-require-asserts-unless-you-crash
Fixed crashers don't require asserts
2017-11-14 21:45:54 -08:00
Doug Gregor
4cc3447de8 Fix a test due to Equatable Optional/Array/Dictionary change. 2017-11-14 16:23:20 -08:00
Slava Pestov
afd9903509 Fixed crashers don't require asserts 2017-11-14 12:19:09 -08:00
Slava Pestov
b6200728a6 Sema: Fix crash on invalid openUnboundGenericType()
We can't construct a nominal type with an ErrorType as a
parent, so in the bad circular case, return a Type() instead
to bail out of transform() altogether.
2017-11-14 00:07:56 -08:00
Slava Pestov
fb2a6d2025 SILOptimizer: Fix convert_function -> apply peephole for metatype conversions
Fixes <rdar://problem/35492775>.
2017-11-13 22:10:14 -08:00
Arnold Schwaighofer
76f538a684 Disable test_superclass_methods.swift and test_superclass_properties.swift
rdar://35492775
2017-11-12 06:24:12 -08:00
Arnold Schwaighofer
be114b156d Merge pull request #12883 from aschwaighofer/disable_modelio_test_ios
Disable ModelIO test on ios
2017-11-11 20:39:57 -08:00
Arnold Schwaighofer
4aecd0d74f Also fails on appletvos 2017-11-11 18:52:20 -08:00
Arnold Schwaighofer
bb32c67c79 Disable ModelIO test on ios
This test fails on the iphonesimulator x86_64

rdar://35490456
2017-11-11 17:26:28 -08:00
Slava Pestov
2146383697 SILGen: Resilient method dispatch thunks 2017-11-11 16:31:53 -08:00
Xi Ge
0d9745f6eb libSyntax: teach parser to parse dictionary and array literals. (#12821)
This commit also adds ArrayExpr and DictionaryExpr to the libSyntax nodes
family. Also, it refactors the original parser code for these two
expressions to better fit to the design of SyntaxParsingContext.

This commit has also fixed two crashers.
2017-11-09 09:00:43 -08:00
Greg Parker
9a38e609af [IRGen][runtime] Reduce object header to 8 bytes on 32-bit platforms. (#12790)
SR-4353, rdar://29765800
2017-11-08 02:50:11 -08:00
Nate Cook
dcf6e2b409 [stdlib] Fix FloatingPoint.init(exactly:) (#12739)
* [stdlib] Fix FloatingPoint.init(exactly:)

This initializer wasn't actually checking the exact conversion.

SR-4634, rdar://problem/31836766
2017-11-06 15:24:44 -08:00
Doug Gregor
5be25a690c Re-enable parse_stdlib test 2017-11-02 07:16:29 -07:00
Slava Pestov
ccfa6e43f5 Add a crasher 2017-11-01 21:48:07 -07:00
Doug Gregor
00801f4c80 Disable the parse_stdlib test, again.
Recent work on witness tables broke it. We're (still) tracking this failure
via rdar://problem/34771322.
2017-11-01 16:09:35 -07:00
Doug Gregor
dfa9982edd Collapse the 17 “parse_stdlib” tests into a single test.
The sharding of this test buys us nothing, because it was only sharding
the AST verifier, which is an insignificant portion of the runtime
(and memory usage) of this test. Given that the test takes ~2m30s to run
and consumes > 2GB memory, having 17 copies of it running is a problem.
2017-11-01 16:02:20 -07:00
Doug Gregor
d17059c882 Re-enable parse_stdlib tests on macOS.
Our Linux CI is still running out of memory on these tests, but try to
reinstate macOS testing so we don't regress here.
2017-11-01 14:05:12 -07:00
Doug Gregor
945ac3de0a Revert " Re-enable parse_stdlib tests." 2017-11-01 06:59:35 -07:00
swift-ci
c89e49091a Merge pull request #12700 from DougGregor/reenable-parse-stdlib-test 2017-11-01 01:36:07 -07:00
Pavel Yaskevich
ebe3abaff1 Merge pull request #12593 from xedin/rdar-35142121
[ConstraintSolver] Avoid unnecessarily increasing score when matching function types
2017-11-01 00:47:37 -07:00
Doug Gregor
ef0f347885 Re-enable parse_stdlib tests.
Now that memory usage is (more) under control, re-enable the parse_stdlib
tests. Fixes rdar://problem/34771322.
2017-10-31 23:41:41 -07:00
Pavel Yaskevich
66e13bcc85 [ConstraintSolver] Avoid unnecessarily increasing score when matching function types
Remove function-to-function type match score increase, which should only
happen contextually in presence of other restrictions, this used to fix
the case related to matching of arrays of functions with and w/e `throws`
as function parameters which used to be ambigious, and now handled by
collection-upcast conversion score.

Resolves: rdar://problem/35142121
2017-10-31 23:14:35 -07:00