@@ -345,24 +345,51 @@ bool ConstraintSystem::simplify() {
345
345
auto *constraint = &ActiveConstraints.front ();
346
346
deactivateConstraint (constraint);
347
347
348
+ if (isDebugMode ()) {
349
+ auto &log = llvm::errs ();
350
+ log.indent (solverState->getCurrentIndent ());
351
+ log << " (considering -> " ;
352
+ constraint->print (log, &getASTContext ().SourceMgr );
353
+ log << " \n " ;
354
+ }
355
+
348
356
// Simplify this constraint.
349
357
switch (simplifyConstraint (*constraint)) {
350
358
case SolutionKind::Error:
351
359
retireFailedConstraint (constraint);
360
+ if (isDebugMode ()) {
361
+ auto &log = llvm::errs ();
362
+ log.indent (solverState->getCurrentIndent () + 2 ) << " (outcome: error)\n " ;
363
+ }
352
364
break ;
353
365
354
366
case SolutionKind::Solved:
355
367
if (solverState)
356
368
++solverState->NumSimplifiedConstraints ;
357
369
retireConstraint (constraint);
370
+ if (isDebugMode ()) {
371
+ auto &log = llvm::errs ();
372
+ log.indent (solverState->getCurrentIndent () + 2 )
373
+ << " (outcome: simplified)\n " ;
374
+ }
358
375
break ;
359
376
360
377
case SolutionKind::Unsolved:
361
378
if (solverState)
362
379
++solverState->NumUnsimplifiedConstraints ;
380
+ if (isDebugMode ()) {
381
+ auto &log = llvm::errs ();
382
+ log.indent (solverState->getCurrentIndent () + 2 )
383
+ << " (outcome: unsolved)\n " ;
384
+ }
363
385
break ;
364
386
}
365
387
388
+ if (isDebugMode ()) {
389
+ auto &log = llvm::errs ();
390
+ log.indent (solverState->getCurrentIndent ()) << " )\n " ;
391
+ }
392
+
366
393
// Check whether a constraint failed. If so, we're done.
367
394
if (failedConstraint) {
368
395
return true ;
0 commit comments