File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -595,6 +595,12 @@ namespace swift {
595
595
// / than this many seconds.
596
596
unsigned ExpressionTimeoutThreshold = 600 ;
597
597
598
+ // / If the shared pointer is not a \c nullptr and the pointee is \c true,
599
+ // / typechecking should be aborted at the next possible opportunity.
600
+ // / This is used by SourceKit to cancel requests for which the result is no
601
+ // / longer of interest.
602
+ std::shared_ptr<bool > CancellationFlag = nullptr ;
603
+
598
604
// / If non-zero, abort the switch statement exhaustiveness checker if
599
605
// / the Space::minus function is called more than this many times.
600
606
// /
Original file line number Diff line number Diff line change @@ -5155,6 +5155,10 @@ class ConstraintSystem {
5155
5155
if (isExpressionAlreadyTooComplex)
5156
5156
return true ;
5157
5157
5158
+ auto CancellationFlag = getASTContext ().TypeCheckerOpts .CancellationFlag ;
5159
+ if (CancellationFlag && *CancellationFlag)
5160
+ return true ;
5161
+
5158
5162
auto used = getASTContext ().getSolverMemory () + solutionMemory;
5159
5163
MaxMemory = std::max (used, MaxMemory);
5160
5164
auto threshold = getASTContext ().TypeCheckerOpts .SolverMemoryThreshold ;
You can’t perform that action at this time.
0 commit comments