Commit Graph

315 Commits

Author SHA1 Message Date
Doug Gregor
a386faf5c9 Add debug output indicating why a solution's score increased.
Swift SVN r15888
2014-04-03 18:08:02 +00:00
Joe Pamer
f8a29859e5 Prevent incorrect flagging of distinct, otherwise structurally identical protocol members as being incomparable during overload resolution. This was resulting in incorrect 'ambiguous overload' errors.
Swift SVN r14691
2014-03-05 22:22:23 +00:00
Joe Groff
68db63b45d AST: Have GenericFunctionType use GenericSignature.
Change GenericFunctionType to reference a GenericSignature instead of containing its generic parameters and requirements in-line, and clean up some interface type APIs that awkwardly returned ArrayRef pairs to instead return GenericSignatures instead.

Swift SVN r13807
2014-02-12 03:44:28 +00:00
John McCall
9c415a3bed Remove the TrivialSubtype conversion kind and implement
its basic logic in libAST, which both makes it easier to
implement and makes it possible to use in the places that
should care about it, i.e. in IR-gen and SIL-gen.

Per Doug, none of the places that were introducing
trivial-subtype constraints really needed to do so rather
than just using subtype constraints.

Swift SVN r12679
2014-01-22 00:19:56 +00:00
Doug Gregor
256b946a83 Record protocol conformance when we start checking, rather than at the end.
As part of this, take away the poor attempt at recovering by adding an
explicit protocol conformance. The recovery mode isn't all that useful
in a system with only explicit conformance, and it messes with
diagnostics further down the line. We can bring it back later once
we're happy with explicit conformance checking.


Swift SVN r11503
2013-12-20 15:46:31 +00:00
Chris Lattner
31ca8889cd eliminate TypeChecker::transformType, replacing it with Type::transform.
Swift SVN r11502
2013-12-20 05:43:26 +00:00
Chris Lattner
b29748a6be remove the ASTContext argument from Type::transform,
(various) FunctionType::get's, ArrayType::get,
ArraySliceType::get, OptionalType::get, and a few
other places.

There is more to be done here, but this is all I plan to do
for now.


Swift SVN r11497
2013-12-20 02:23:21 +00:00
Joe Groff
017440165e Fix the weird capitalization of MetaTypeType.
Swift SVN r11475
2013-12-19 18:43:08 +00:00
Doug Gregor
2d75ca2adf Add a LazyResolver to ProtocolConformance::getWitness().
Swift SVN r11331
2013-12-15 19:40:49 +00:00
Doug Gregor
3040f2195b Factor our the selection of "alternative" literal type suggestions.
Swift SVN r11035
2013-12-09 19:19:21 +00:00
Doug Gregor
4ddd82cc89 As soon as a (partial) solution becomes worse than the best solution, stop.
This shaves about 10% off the number of solution states explored when
type-checking the standard library, although it doesn't improve
overall time by much. In a more targeted benchmark, 1 + 2.0 + 1, we
get a 21% speedup.


Swift SVN r11033
2013-12-09 18:13:37 +00:00
Doug Gregor
8cc1dc4535 Only consider relative scores when the fixed scores are identical.
Swift SVN r11030
2013-12-09 17:38:37 +00:00
Doug Gregor
79f8175e0b Solver: Keep track of a solution's score as we're computing it.
No functionality change here; just staging for some future optimizations.


Swift SVN r11028
2013-12-09 17:12:07 +00:00
Doug Gregor
951fd5620e Track the # of solutions computed and discarded.
Swift SVN r11018
2013-12-09 14:23:29 +00:00
Doug Gregor
691111eaf9 Split constraint system solution ranking into a separate source file.
Swift SVN r11016
2013-12-09 14:18:59 +00:00