Skip to content

Commit 39af1d0

Browse files
committed
[Constraint solver] Drop Expr* from finalization.
We don't need to pass an expression into rewriter finalization; the update of expression types can be handled per-expression.
1 parent 37c89f1 commit 39af1d0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/Sema/CSApply.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4697,7 +4697,7 @@ namespace {
46974697
return result;
46984698
}
46994699

4700-
void finalize(Expr *&result) {
4700+
void finalize() {
47014701
assert(ExprStack.empty());
47024702
assert(OpenedExistentials.empty());
47034703

@@ -4722,9 +4722,6 @@ namespace {
47224722
.fixItInsert(cast->getStartLoc(), "(")
47234723
.fixItInsertAfter(cast->getEndLoc(), ")");
47244724
}
4725-
4726-
// Set the final types on the expression.
4727-
cs.setExprTypes(result);
47284725
}
47294726

47304727
/// Diagnose an optional injection that is probably not what the
@@ -7561,7 +7558,9 @@ Expr *ConstraintSystem::applySolution(Solution &solution, Expr *expr,
75617558
}
75627559

75637560
if (result)
7564-
rewriter.finalize(result);
7561+
setExprTypes(result);
7562+
7563+
rewriter.finalize();
75657564

75667565
return result;
75677566
}
@@ -7575,6 +7574,7 @@ Expr *Solution::coerceToType(Expr *expr, Type toType,
75757574
if (!result)
75767575
return nullptr;
75777576

7578-
rewriter.finalize(result);
7577+
cs.setExprTypes(result);
7578+
rewriter.finalize();
75797579
return result;
75807580
}

0 commit comments

Comments
 (0)