@@ -32,70 +32,6 @@ using namespace constraints;
3232#define DEBUG_TYPE " Constraint solver overall"
3333STATISTIC (NumDiscardedSolutions, " Number of solutions discarded" );
3434
35- static StringRef getScoreKindName (ScoreKind kind) {
36- switch (kind) {
37- case SK_Hole:
38- return " hole in the constraint system" ;
39-
40- case SK_Unavailable:
41- return " use of an unavailable declaration" ;
42-
43- case SK_AsyncInSyncMismatch:
44- return " async-in-synchronous mismatch" ;
45-
46- case SK_SyncInAsync:
47- return " sync-in-asynchronous" ;
48-
49- case SK_ForwardTrailingClosure:
50- return " forward scan when matching a trailing closure" ;
51-
52- case SK_Fix:
53- return " attempting to fix the source" ;
54-
55- case SK_DisfavoredOverload:
56- return " disfavored overload" ;
57-
58- case SK_UnresolvedMemberViaOptional:
59- return " unwrapping optional at unresolved member base" ;
60-
61- case SK_ForceUnchecked:
62- return " force of an implicitly unwrapped optional" ;
63-
64- case SK_UserConversion:
65- return " user conversion" ;
66-
67- case SK_FunctionConversion:
68- return " function conversion" ;
69-
70- case SK_NonDefaultLiteral:
71- return " non-default literal" ;
72-
73- case SK_CollectionUpcastConversion:
74- return " collection upcast conversion" ;
75-
76- case SK_ValueToOptional:
77- return " value to optional" ;
78-
79- case SK_EmptyExistentialConversion:
80- return " empty-existential conversion" ;
81-
82- case SK_KeyPathSubscript:
83- return " key path subscript" ;
84-
85- case SK_ValueToPointerConversion:
86- return " value-to-pointer conversion" ;
87-
88- case SK_FunctionToAutoClosureConversion:
89- return " function to autoclosure parameter" ;
90-
91- case SK_ImplicitValueConversion:
92- return " value-to-value conversion" ;
93-
94- case SK_UnappliedFunction:
95- return " overloaded unapplied function" ;
96- }
97- }
98-
9935void ConstraintSystem::increaseScore (ScoreKind kind, unsigned value) {
10036 if (isForCodeCompletion ()) {
10137 switch (kind) {
@@ -119,7 +55,8 @@ void ConstraintSystem::increaseScore(ScoreKind kind, unsigned value) {
11955 if (isDebugMode () && value > 0 ) {
12056 if (solverState)
12157 llvm::errs ().indent (solverState->depth * 2 );
122- llvm::errs () << " (increasing score due to " << getScoreKindName (kind) << " )\n " ;
58+ llvm::errs () << " (increasing '" << Score::getNameFor (kind) << " ' score by " << value
59+ << " )\n " ;
12360 }
12461
12562 unsigned index = static_cast <unsigned >(kind);
@@ -1420,7 +1357,7 @@ ConstraintSystem::findBestSolution(SmallVectorImpl<Solution> &viable,
14201357
14211358 for (unsigned i = 0 , n = viable.size (); i != n; ++i) {
14221359 llvm::errs ().indent (solverState->depth * 2 )
1423- << " --- Solution #" << i << " ---\n " ;
1360+ << " \n --- Solution #" << i << " ---\n " ;
14241361 viable[i].dump (llvm::errs ().indent (solverState->depth * 2 ));
14251362 }
14261363 }
0 commit comments