Commit Graph

865 Commits

Author SHA1 Message Date
Dmitri Hrybenko
90f285fccb Restore compatibility with libstdc++
Swift SVN r11312
2013-12-14 12:18:24 +00:00
Doug Gregor
74784f89c4 Fold checking of the subexpression in "x as T" into the enclosing constraint system.
Previously, we had an artificial separation between the subexpression
"x" and the context of the expression "x as T". This breaks down when
the subexpression includes a reference to an anonymous closure
argument (e.g., $0) from a single-expression closure. By merging the
systems, we fix the crasher (<rdar://problem/15633178>) and allow
improved type inference for these expressions.



Swift SVN r11235
2013-12-13 04:30:20 +00:00
Doug Gregor
645f85a726 Don't try to bind incompatible type variables together.
Doing so causes the solver to loop infinitely. Fixes <rdar://problem/15536725>.


Swift SVN r11198
2013-12-12 19:13:55 +00:00
Doug Gregor
34c5c96a8b Only visit supertypes when we inferred from a constraint that permits supertypes.
Swift SVN r11100
2013-12-10 23:37:08 +00:00
Doug Gregor
61318e33f0 Compute potential bindings with the help of the constraint graph.
Rather than performing a two-pass walk over all of the constraints in
the system to attach them to type variables, use the existing type
variable -> constraints mapping in the constraint graph to make this a
faster single-pass process. Also clarify the type bindings a little
bit. Improves type checking time for the standard library by ~3%.



Swift SVN r11098
2013-12-10 23:25:37 +00:00
Doug Gregor
6fb1860f45 Replace multiple generated constraint sets with a single vector.
Swift SVN r11078
2013-12-10 16:46:46 +00:00
Doug Gregor
3755e6d556 Replace worklist deque with Active/Inactive constraint lists.
Swift SVN r11077
2013-12-10 16:36:36 +00:00
Doug Gregor
2d61bd31f8 Always use the constraint graph and worklist.
Since it takes the code in <rdar://problem/15476050> from > 10 minutes
to 4 seconds.


Swift SVN r11064
2013-12-10 01:25:56 +00:00
Doug Gregor
e4343a0f9d Don't infer [auto_closure] types; use the result type.
Swift SVN r11061
2013-12-10 00:39:22 +00:00
Doug Gregor
eaae20303d Look through one-tuples when deciding on a variable binding.
Swift SVN r11059
2013-12-10 00:30:36 +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
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
5bb053c0dd Fix renamed file names
Swift SVN r11017
2013-12-09 14:20:33 +00:00
Doug Gregor
ee545e9f68 Rename TypeCheckConstraintsFoo.cpp to CSFoo.cpp.
It's more idiomatic and easier to type.


Swift SVN r11015
2013-12-09 14:09:54 +00:00