Skip to content

Commit 4f50710

Browse files
committed
[CSStep] Use # of disjunctions directly to determine component ordering
1 parent 198003d commit 4f50710

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/Sema/CSStep.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ void SplitterStep::computeFollowupSteps(
188188
// want to have smaller/faster components at the back of the list.
189189
std::sort(componentSteps.begin(), componentSteps.end(),
190190
[](const ComponentStep *lhs, const ComponentStep *rhs) {
191-
return lhs > rhs;
191+
return lhs->disjunctionCount() > rhs->disjunctionCount();
192192
});
193193
}
194194

lib/Sema/CSStep.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,8 @@ class ComponentStep final : public SolverStep {
361361
StepResult take(bool prevFailed) override;
362362
StepResult resume(bool prevFailed) override;
363363

364-
bool operator>(const ComponentStep *other) const {
365-
return NumDisjunctions > other->NumDisjunctions;
366-
}
364+
// The number of disjunction constraints associated with this component.
365+
unsigned disjunctionCount() const { return NumDisjunctions; }
367366

368367
void print(llvm::raw_ostream &Out) override {
369368
Out << "ComponentStep with at #" << Index << '\n';

0 commit comments

Comments
 (0)