@@ -322,12 +322,11 @@ Constraint *Constraint::clone(ConstraintSystem &cs) const {
322
322
llvm_unreachable (" Unhandled ConstraintKind in switch." );
323
323
}
324
324
325
- void Constraint::print (llvm::raw_ostream &Out, SourceManager *sm, bool repeatedLocator ) const {
325
+ void Constraint::print (llvm::raw_ostream &Out, SourceManager *sm, bool skipLocator ) const {
326
326
// Print all type variables as $T0 instead of _ here.
327
327
PrintOptions PO;
328
328
PO.PrintTypesForDebugging = true ;
329
329
330
- ConstraintLocator *firstLocator;
331
330
if (Kind == ConstraintKind::Disjunction ||
332
331
Kind == ConstraintKind::Conjunction) {
333
332
Out << (Kind == ConstraintKind::Disjunction ? " disjunction"
@@ -338,8 +337,8 @@ void Constraint::print(llvm::raw_ostream &Out, SourceManager *sm, bool repeatedL
338
337
if (isIsolated ())
339
338
Out << " (isolated)" ;
340
339
341
- firstLocator = Locator;
342
- if (Locator ) {
340
+ auto firstLocator = Locator;
341
+ if (firstLocator ) {
343
342
Out << " [[" ;
344
343
Locator->dump (sm, Out);
345
344
Out << " ]]" ;
@@ -354,11 +353,8 @@ void Constraint::print(llvm::raw_ostream &Out, SourceManager *sm, bool repeatedL
354
353
Out << " > [favored] " ;
355
354
else
356
355
Out << " > " ;
357
- if (constraint->getLocator () == firstLocator) {
358
- constraint->print (Out, sm, true );
359
- } else {
360
- constraint->print (Out, sm);
361
- }
356
+ constraint->print (Out, sm,
357
+ /* skipLocator=*/ constraint->getLocator () == firstLocator);
362
358
},
363
359
[&] { Out << " \n " ; });
364
360
return ;
@@ -528,7 +524,7 @@ void Constraint::print(llvm::raw_ostream &Out, SourceManager *sm, bool repeatedL
528
524
fix->print (Out);
529
525
}
530
526
531
- if (Locator && !repeatedLocator ) {
527
+ if (Locator && !skipLocator ) {
532
528
Out << " [[" ;
533
529
Locator->dump (sm, Out);
534
530
Out << " ]];" ;
0 commit comments