Commit Graph

5277 Commits

Author SHA1 Message Date
Graydon Hoare
874c2b7a09 Merge pull request #19943 from graydon/rdar-45347391-you-give-modules-a-bad-name-master
[ModuleInterface] Use 2-arg form of basename(1) in overlay validation tests.
2018-10-20 11:39:24 -07:00
Mark Lacey
f2f771d2d5 Fix type checker performance test to compile successfully.
At some point this test case was updated such that it no longer
compiled successfully. The originally reported test case did compile
successfully, just slowly.
2018-10-19 10:49:02 -07:00
Graydon Hoare
77280b00ea [ModuleInterface] Use 2-arg form of basename(1) in overlay validation tests.
A bunch of .swiftinterface files fail to build into their respective .swiftmodules
if you pass -module-name <foo> for some foo that is not the correct module name.

The two tests in this change were using a shell expansion that incorrectly picked
the first path component with a period in the name as the module name; this caused
the failures.

Rather than using a shell expansion, this change uses the 2-argument form of
basename(1) (which is POSIX) that also removes a suffix from the basename.
2018-10-18 15:01:25 -07:00
Mark Lacey
72ba110e5b [ConstraintSystem] Rework new constraint stat as a FRONTEND_STATISTIC.
In the process, remove the old incrementScopeCounter SWIFT_FUNC_STAT.
2018-10-18 07:18:02 -07:00
Mark Lacey
cc0386b461 [ConstraintSystem] Add a new stat to be used for expression type checker performance testing.
This counts the number of leaf scopes we reach while solving the
constraint sytem, and is a much better measure of the growth of
unnecessary work than the total number of scopes opened.

There were two tests where I had a difficult time getting scale-test
to fit the curve even after adjusting some of the parameters, so I've
left those to use the old stat for now.
2018-10-17 07:26:18 -07:00
Mark Lacey
3d6c93f3bd Merge pull request #19909 from rudkx/extend-operator-designated-type
[ConstraintSystem] Extend solver support for designated types for ope…
2018-10-16 10:42:17 -07:00
Greg Titus
4f8e3f3597 Merge pull request #19879 from gregomni/8757
[Sema] Omit protocol match diagnosis for constructors with differing names.
2018-10-16 09:36:16 -07:00
Mark Lacey
b158651119 [ConstraintSystem] Extend solver support for designated types for operators.
Have the constraint solver consider multiple designated types for an
operator. We currently consider the overloads from each in turn,
stopping as soon as we have a solution. As a result, we can still end
up with exponential type checking in some cases if an operator has
more than a single designated type. This still allows us to reduce the
base of that exponent, though, which makes it possible to increase the
number of expressions we can type check successfully in practice.
2018-10-15 23:51:43 -07:00
Pavel Yaskevich
59899a7911 [ConstraintSystem] Make sure that system is returned into its original state after solving
Currently (with or w/o failures) constraint system is not returned
back to its original state after solving, because constraints from
initial "active" list are not returned to the system. To fix that
let's allocate "initial" scope which captures state right before
solving begins, and add "active" list to the solver state to capture
information about "active" constraints at the time of its creation.

This is follow-up to https://github.com/apple/swift/pull/19873
2018-10-15 16:33:57 -07:00
Andrew Trick
e3a75de818 Merge pull request #19849 from atrick/remove-swift3-exclusivity
Remove exclusivity support for Swift 3 mode.
2018-10-15 11:03:06 -07:00
gregomni
85baf3f6c6 Diagnosis changes in fixed crasher 2018-10-15 10:36:37 -07:00
Greg Titus
5f2400580e Merge pull request #19830 from gregomni/8813
[Sema] When resolving type declarations, if there is an error with a typealias,...
2018-10-13 21:39:10 -07:00
Greg Titus
c7ae3e6736 Crasher fixed. 2018-10-13 20:13:35 -07:00
Slava Pestov
3178d6d8ac Merge pull request #19760 from gregomni/8902
[Sema]Allow associated type inference for requirement returning dynamic Self...
2018-10-13 15:14:47 -07:00
Andrew Trick
e560125d20 Create RuntimeUnittest library for C++ runtime unit tests from lit.
Create a new RuntimeUnittest library alongside the other stdlib unit
tests so we can write C++ runtime unit tests callable from lit.

Move runtime exclusivity tests into the stdlib unittest library and
create lit tests so we can verify that the runtime crashes with an
error message.
2018-10-13 10:06:35 -07:00
Andrew Trick
2ecb48a89d Remove exclusivity support for Swift 3 mode.
Remove the compiler support for exclusivity warnings.

Leave runtime support for exclusivity warnings in non-release builds
only for unit testing convenience.

Remove a test case that checked the warning log output.

Modify test cases that relied on successful compilation in the
presence of exclusivity violations.

Fixes: <rdar://problem/45146046> Remaining -swift-version 3 tests for exclusivity
2018-10-12 09:08:42 -07:00
swift-ci
a06fe6c92d Merge pull request #19518 from graydon/text-interface-to-module 2018-10-12 02:49:21 -07:00
Graydon Hoare
5e202697a3 [ModuleInterface] Mop up remaining "textual interface" terminology. 2018-10-11 23:56:19 -07:00
Slava Pestov
38072b9ec8 Add regression test for fixed crasher 2018-10-11 21:48:06 -07:00
Rintaro Ishizaki
2a18ea7b79 Merge pull request #19817 from rintaro/rdar43625800
[AST] Record invalid conformance for unsatisfied conformance requirement
2018-10-11 07:59:21 +09:00
Graydon Hoare
f05be88936 Merge pull request #19802 from graydon/rdar-43955209-breaking-up-is-hard-to-do
[Driver] <rdar://43955209> Remove obsolete/fragile batch mode 'repartitioning' code.
2018-10-10 14:26:24 -07:00
Rintaro Ishizaki
c6017095c3 [AST] Use invalid conformance for unsatisfied requirement
There is an invariant that SignatureConformances should have the same
size as the number of conformance requirements in the signature.
Previously, since unsatisfied requirements weren't reflected in it,
that caused a crash.

rdar://problem/43625800
2018-10-10 21:03:25 +09:00
Greg Parker
9043bf87df [test] Fix a solver flag rename that was missed in #19756. 2018-10-09 18:07:46 -07:00
Graydon Hoare
0f26b9c12d [Driver] <rdar://43955209> Remove obsolete/fragile batch mode 'repartitioning' code. 2018-10-09 13:31:41 -07:00
swift-ci
f37fa8231c Merge pull request #19768 from DougGregor/bridge-conformance-only-when-tc 2018-10-08 11:00:35 -07:00
Mark Lacey
25c02ced29 Merge pull request #19756 from rudkx/extend-operator-designated-type
Extend operator decls to allow any designated nominal type for lookup.
2018-10-08 10:12:53 -07:00
Doug Gregor
59543a10da [Type checker] Only "use" bridging conformances when there is a type checker.
Works around rdar://problem/45047761 and rdar://problem/45058722.
2018-10-08 09:55:41 -07:00
Karoy Lorentey
4967393618 Merge pull request #19688 from lorentey/hashed-bridgeobject
[stdlib] Set, Dictionary: Replace _Variant enums with _BridgeStorage
2018-10-08 12:07:40 +01:00
gregomni
ca53b27595 validation test now builds cleanly 2018-10-07 15:58:24 -07:00
Doug Gregor
ae5acb9147 [Type checker] Check for recursion when evaluating @objc on a property.
Fixes crash from rdar://problem/33093935.
2018-10-06 23:21:00 -07:00
Doug Gregor
9565f0d753 [Test] Add test for SR-8666 / rdar://problem/43893945.
This test case crashed at runtime in Swift 4.2, but is now fixed. Add it
so that we don't regress.
2018-10-06 22:12:55 -07:00
Doug Gregor
de18384d89 [AST] Don’t deserialize members of @objc protocol looking for associated types
Thanks to @slavapestov for pointing this out! The optimization to avoid
looking through the members of a protocol that can’t possibly have any
associated types was for both deserialized protocols and imported
protocols, but I only supported the former in my previous change. Check
both cases and make the reasons much more obvious.

Also, that change resolved an existing compiler crasher as well.
2018-10-06 22:08:45 -07:00
Mark Lacey
36284ba377 Extend operator decls to allow any designated nominal type for lookup.
Rather than limiting this to protocols, allow any nominal type.

Rename -enable-operator-designated-protocols to
-enable-operator-designated-types to reflect the change.
2018-10-06 17:02:31 -07:00
Doug Gregor
83e41daaa6 [AST] Ill-formed @objc protocols might have associated types.
As an optimization, we don't even look for associated types in @objc
protocols. However, this could lead to broken invariants like "every
associated type has a witness" in ill-formed @objc protocols that do
have associated types.

Implement this optimization by checking whether the protocol has a
Clang node. Fixes rdar://problem/41425828 / SR-8094.
2018-10-06 10:35:07 -07:00
Karoy Lorentey
aba15a1151 [test] Set and Dictionary now has an extra inhabitant (32-bit) 2018-10-06 01:47:09 +01:00
Karoy Lorentey
3665294d1e [test] Set and Dictionary now has an extra inhabitant 2018-10-05 12:33:25 +01:00
Karoy Lorentey
e112de3efa [test] Update Set/Dictionary tests 2018-10-05 12:33:25 +01:00
Karoy Lorentey
a301449e5f [test] Fix spurious failure in optimized tests
We don’t emit the trap message in optimized builds, so don’t check for it.
2018-10-05 12:30:51 +01:00
swift-ci
fa0ba4fa91 Merge pull request #19730 from rudkx/move-another-fast-test 2018-10-04 21:20:23 -07:00
Mark Lacey
5d6785bec5 Move another typechecker performance test to run with -solver-enable-operator-designated-protocols. 2018-10-04 20:10:13 -07:00
Jordan Rose
73d5ebaad2 Rename "textual interface" to "parseable interface" (#19713)
We already have something called "module interfaces" -- it's the
generated interface view that you can see in Xcode, the interface
that's meant for developers using a library. Of course, that's also a
textual format. To reduce confusion, rename the new module stability
feature to "parseable [module] interfaces".
2018-10-04 17:49:55 -07:00
Mark Lacey
e17898c70a Revert a type checker perf test that apparently is still not consistently fast enough. 2018-10-04 15:48:22 -07:00
Mark Lacey
1dcb06bdb4 Merge pull request #19698 from rudkx/designated-protocols
[ConstraintSystem] Use operator designated protocols to speed type checking.
2018-10-04 08:39:25 -07:00
Mark Lacey
1f517d328d [ConstraintSystem] Distinguish between overloads from a type vs. an extension.
For operators with default implementations in an extension, we don't
want to typecheck it both with overloads from the protocol type and
the ones from the extension.
2018-10-03 18:51:43 -07:00
Mark Lacey
48c6cb40cf Fix release-build test failure due to unaccounted-for warning. 2018-10-03 16:53:04 -07:00
Mark Lacey
472d333a1b Test updates for -solver-enable-operator-designated-protocols.
These are cases that I know are faster when this is enabled. The test
updates all additionally disable the existing performance hacks as
well as the shrink phase of the solver.
2018-10-03 16:01:59 -07:00
Karoy Lorentey
6e671b6631 [stdlib] Allow native dictionaries to advance Cocoa indices 2018-10-03 21:05:46 +01:00
Slava Pestov
2f38584b3a Add regression test for fixed crasher 2018-10-03 02:30:29 -04:00
swift-ci
7b03ea54ab Merge pull request #19641 from jrose-apple/overlay-more-like-overzealous 2018-10-01 10:56:20 -07:00
Jordan Rose
e3165342b0 [test] Don't test compiling SwiftLang.swiftinterface at all for now
It's not built in all configurations, and it's not really an overlay
anyway.
2018-10-01 09:56:47 -07:00