File tree Expand file tree Collapse file tree 4 files changed +8
-17
lines changed Expand file tree Collapse file tree 4 files changed +8
-17
lines changed Original file line number Diff line number Diff line change @@ -2533,8 +2533,8 @@ class ConstraintSystem {
2533
2533
// / The number of the solution attempts we're looking at.
2534
2534
unsigned SolutionAttempt;
2535
2535
2536
- // / Refers to the innermost partial solution scope.
2537
- SolverScope *PartialSolutionScope = nullptr ;
2536
+ // / The number of fixes in the innermost partial solution scope.
2537
+ unsigned numPartialSolutionFixes = 0 ;
2538
2538
2539
2539
// Statistics
2540
2540
#define CS_STATISTIC (Name, Description ) unsigned Name = 0 ;
@@ -2784,11 +2784,6 @@ class ConstraintSystem {
2784
2784
// / The length of \c Trail.
2785
2785
unsigned numTrailChanges;
2786
2786
2787
- // / The length of \c Fixes.
2788
- // /
2789
- // / FIXME: Remove this.
2790
- unsigned numFixes;
2791
-
2792
2787
// / The scope number of this scope. Set when the scope is registered.
2793
2788
unsigned scopeNumber = 0 ;
2794
2789
Original file line number Diff line number Diff line change @@ -128,11 +128,8 @@ Solution ConstraintSystem::finalize() {
128
128
129
129
// For each of the fixes, record it as an operation on the affected
130
130
// expression.
131
- unsigned firstFixIndex = 0 ;
132
- if (solverState && solverState->PartialSolutionScope ) {
133
- firstFixIndex = solverState->PartialSolutionScope ->numFixes ;
134
- }
135
-
131
+ unsigned firstFixIndex =
132
+ (solverState ? solverState->numPartialSolutionFixes : 0 );
136
133
for (const auto &fix :
137
134
llvm::make_range (Fixes.begin () + firstFixIndex, Fixes.end ()))
138
135
solution.Fixes .push_back (fix);
@@ -709,7 +706,6 @@ ConstraintSystem::SolverScope::SolverScope(ConstraintSystem &cs)
709
706
numTrailChanges = cs.solverState ->Trail .size ();
710
707
711
708
numTypeVariables = cs.TypeVariables .size ();
712
- numFixes = cs.Fixes .size ();
713
709
714
710
cs.solverState ->beginScope (this );
715
711
assert (!cs.failedConstraint && " Unexpected failed constraint!" );
Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ ComponentStep::Scope::Scope(ComponentStep &component)
42
42
workList.splice (workList.end (), *component.Constraints );
43
43
44
44
SolverScope = new ConstraintSystem::SolverScope (CS);
45
- PrevPartialScope = CS.solverState ->PartialSolutionScope ;
46
- CS.solverState ->PartialSolutionScope = SolverScope ;
45
+ prevPartialSolutionFixes = CS.solverState ->numPartialSolutionFixes ;
46
+ CS.solverState ->numPartialSolutionFixes = CS. Fixes . size () ;
47
47
}
48
48
49
49
StepResult SplitterStep::take (bool prevFailed) {
Original file line number Diff line number Diff line change @@ -342,7 +342,7 @@ class ComponentStep final : public SolverStep {
342
342
ConstraintSystem::SolverScope *SolverScope;
343
343
344
344
SetVector<TypeVariableType *> TypeVars;
345
- ConstraintSystem::SolverScope *PrevPartialScope = nullptr ;
345
+ unsigned prevPartialSolutionFixes = 0 ;
346
346
347
347
// The component this scope is associated with.
348
348
ComponentStep &Component;
@@ -352,7 +352,7 @@ class ComponentStep final : public SolverStep {
352
352
353
353
~Scope () {
354
354
delete SolverScope; // rewind back all of the changes.
355
- CS.solverState ->PartialSolutionScope = PrevPartialScope ;
355
+ CS.solverState ->numPartialSolutionFixes = prevPartialSolutionFixes ;
356
356
357
357
// return all of the saved type variables back to the system.
358
358
CS.TypeVariables = std::move (TypeVars);
You can’t perform that action at this time.
0 commit comments