Skip to content

Commit dbfc5e0

Browse files
author
Amritpan Kaur
committed
[CSStep] Add disjunction and conjunction printing to initial state displayed during component step.
1 parent 840c801 commit dbfc5e0

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

lib/Sema/CSStep.cpp

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,31 @@ 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) {
347+
auto *conjunction = CS.selectConjunction();
348+
349+
if (CS.isDebugMode() && !IsSingle) {
350+
PrintOptions PO;
351+
PO.PrintTypesForDebugging = true;
352+
if (disjunction) {
353+
auto &log = getDebugLogger();
354+
log.indent(CS.solverState->depth);
355+
log << "(disjunction = [";
356+
auto constraints = disjunction->getNestedConstraints();
357+
log << constraints[0]->getFirstType()->getString(PO);
358+
log << "])\n";
359+
}
360+
if (conjunction) {
361+
auto &log = getDebugLogger();
362+
log.indent(CS.solverState->depth);
363+
log << "(conjunction = [";
364+
auto constraints = conjunction->getNestedConstraints();
365+
log << constraints[0]->getFirstType()->getString(PO);
366+
log << "])\n";
367+
}
349368
auto &log = getDebugLogger();
369+
log.indent(2);
350370
log << ")" << '\n';
351371
log.indent(0);
352372
}

0 commit comments

Comments
 (0)