Skip to content

Commit 72190ed

Browse files
author
Amritpan Kaur
committed
[CSStep] Print disjunctions with bindOverload choices.
Print all disjunctions in scope, not just the one selected. Remove conjunction printing.
1 parent 8d03c68 commit 72190ed

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

lib/Sema/CSStep.cpp

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ StepResult ComponentStep::take(bool prevFailed) {
356356
});
357357

358358
auto *disjunction = CS.selectDisjunction();
359-
auto *conjunction = CS.selectConjunction();
360359

361360
if (CS.isDebugMode()) {
362361
PrintOptions PO;
@@ -369,19 +368,29 @@ StepResult ComponentStep::take(bool prevFailed) {
369368
}
370369
log.indent(CS.solverState->getCurrentIndent());
371370

372-
if (disjunction) {
373-
log.indent(2);
374-
log << "Disjunction(s) = [";
371+
SmallVector<Constraint *, 4> disjunctions;
372+
CS.collectDisjunctions(disjunctions);
373+
std::vector<std::string> overloadDisjunctions;
374+
for (const auto &disjunction : disjunctions) {
375+
PrintOptions PO;
376+
PO.PrintTypesForDebugging = true;
377+
375378
auto constraints = disjunction->getNestedConstraints();
376-
log << constraints[0]->getFirstType()->getString(PO);
377-
log << "]";
379+
if (constraints[0]->getKind() == ConstraintKind::BindOverload)
380+
overloadDisjunctions.push_back(
381+
constraints[0]->getFirstType()->getString(PO));
378382
}
379-
if (conjunction) {
383+
if (!overloadDisjunctions.empty()) {
384+
auto &log = getDebugLogger();
380385
log.indent(2);
381-
log << "Conjunction(s) = [";
382-
auto constraints = conjunction->getNestedConstraints();
383-
log << constraints[0]->getFirstType()->getString(PO);
384-
log << "]";
386+
log << "Disjunction(s) = [";
387+
interleave(overloadDisjunctions, log, ", ");
388+
log << "]\n";
389+
390+
if (!potentialBindings.empty() || !overloadDisjunctions.empty()) {
391+
auto &log = getDebugLogger();
392+
log << ")\n";
393+
}
385394
}
386395
log << ")\n";
387396
}

0 commit comments

Comments
 (0)