Skip to content

Commit 8ce4fd6

Browse files
author
Amritpan Kaur
committed
[CSStep] Add disjunction and conjunction printing to initial state displayed during component step.
1 parent 3dac2ff commit 8ce4fd6

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

lib/Sema/CSStep.cpp

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -342,13 +342,35 @@ StepResult ComponentStep::take(bool prevFailed) {
342342

343343
/// Try to figure out what this step is going to be,
344344
/// after the scope has been established.
345+
auto bestBindings = CS.determineBestBindings();
345346
auto *disjunction = CS.selectDisjunction();
346-
const bool isSolverStep = !IsSingle;
347-
auto bestBindings = CS.determineBestBindings(isSolverStep);
348-
if (isSolverStep) {
349-
auto &log = getDebugLogger();
350-
log << ")" << '\n';
351-
log.indent(0);
347+
auto *conjunction = CS.selectConjunction();
348+
349+
if (CS.isDebugMode()) {
350+
if (!IsSingle) {
351+
PrintOptions PO;
352+
PO.PrintTypesForDebugging = true;
353+
if (disjunction) {
354+
auto &log = getDebugLogger();
355+
log.indent(CS.solverState->depth);
356+
log << "(disjunction = [";
357+
auto constraints = disjunction->getNestedConstraints();
358+
log << constraints[0]->getFirstType()->getString(PO);
359+
log << "])\n";
360+
}
361+
if (conjunction) {
362+
auto &log = getDebugLogger();
363+
log.indent(CS.solverState->depth);
364+
log << "(conjunction = [";
365+
auto constraints = conjunction->getNestedConstraints();
366+
log << constraints[0]->getFirstType()->getString(PO);
367+
log << "])\n";
368+
}
369+
auto &log = getDebugLogger();
370+
log.indent(2);
371+
log << ")" << '\n';
372+
log.indent(0);
373+
}
352374
}
353375

354376
if (CS.shouldAttemptFixes()) {

0 commit comments

Comments
 (0)