@@ -353,6 +353,10 @@ bool ConstraintSystem::simplify() {
353
353
auto *constraint = &ActiveConstraints.front ();
354
354
deactivateConstraint (constraint);
355
355
356
+ auto isSimplifiable =
357
+ constraint->getKind () != ConstraintKind::Disjunction &&
358
+ constraint->getKind () != ConstraintKind::Conjunction;
359
+
356
360
if (isDebugMode ()) {
357
361
auto &log = llvm::errs ();
358
362
log .indent (solverState->getCurrentIndent ());
@@ -362,8 +366,7 @@ bool ConstraintSystem::simplify() {
362
366
363
367
// {Dis, Con}junction are returned unsolved in \c simplifyConstraint() and
364
368
// handled separately by solver steps.
365
- if (constraint->getKind () != ConstraintKind::Disjunction &&
366
- constraint->getKind () != ConstraintKind::Conjunction) {
369
+ if (isSimplifiable) {
367
370
log .indent (solverState->getCurrentIndent () + 2 )
368
371
<< " (simplification result:\n " ;
369
372
}
@@ -375,7 +378,9 @@ bool ConstraintSystem::simplify() {
375
378
retireFailedConstraint (constraint);
376
379
if (isDebugMode ()) {
377
380
auto &log = llvm::errs ();
378
- log .indent (solverState->getCurrentIndent () + 2 ) << " )\n " ;
381
+ if (isSimplifiable) {
382
+ log .indent (solverState->getCurrentIndent () + 2 ) << " )\n " ;
383
+ }
379
384
log .indent (solverState->getCurrentIndent () + 2 ) << " (outcome: error)\n " ;
380
385
}
381
386
break ;
@@ -386,7 +391,9 @@ bool ConstraintSystem::simplify() {
386
391
retireConstraint (constraint);
387
392
if (isDebugMode ()) {
388
393
auto &log = llvm::errs ();
389
- log .indent (solverState->getCurrentIndent () + 2 ) << " )\n " ;
394
+ if (isSimplifiable) {
395
+ log .indent (solverState->getCurrentIndent () + 2 ) << " )\n " ;
396
+ }
390
397
log .indent (solverState->getCurrentIndent () + 2 )
391
398
<< " (outcome: simplified)\n " ;
392
399
}
@@ -397,7 +404,9 @@ bool ConstraintSystem::simplify() {
397
404
++solverState->NumUnsimplifiedConstraints ;
398
405
if (isDebugMode ()) {
399
406
auto &log = llvm::errs ();
400
- log .indent (solverState->getCurrentIndent () + 2 ) << " )\n " ;
407
+ if (isSimplifiable) {
408
+ log .indent (solverState->getCurrentIndent () + 2 ) << " )\n " ;
409
+ }
401
410
log .indent (solverState->getCurrentIndent () + 2 )
402
411
<< " (outcome: unsolved)\n " ;
403
412
}
0 commit comments