@@ -512,28 +512,28 @@ class ClosureConstraintGenerator
512
512
}
513
513
514
514
void visitBreakStmt (BreakStmt *breakStmt) {
515
- if (! isSupportedMultiStatementClosure ())
516
- llvm_unreachable ( " Unsupported statement: Break" );
515
+ assert ( isSupportedMultiStatementClosure () &&
516
+ " Unsupported statement: Break" );
517
517
}
518
518
519
519
void visitContinueStmt (ContinueStmt *continueStmt) {
520
- if (! isSupportedMultiStatementClosure ())
521
- llvm_unreachable ( " Unsupported statement: Continue" );
520
+ assert ( isSupportedMultiStatementClosure () &&
521
+ " Unsupported statement: Continue" );
522
522
}
523
523
524
524
void visitDeferStmt (DeferStmt *deferStmt) {
525
- if (! isSupportedMultiStatementClosure ())
526
- llvm_unreachable ( " Unsupported statement: Defer" );
525
+ assert ( isSupportedMultiStatementClosure () &&
526
+ " Unsupported statement: Defer" );
527
527
}
528
528
529
529
void visitFallthroughStmt (FallthroughStmt *fallthroughStmt) {
530
- if (! isSupportedMultiStatementClosure ())
531
- llvm_unreachable ( " Unsupported statement: Fallthrough" );
530
+ assert ( isSupportedMultiStatementClosure () &&
531
+ " Unsupported statement: Fallthrough" );
532
532
}
533
533
534
534
void visitIfStmt (IfStmt *ifStmt) {
535
- if (! isSupportedMultiStatementClosure ())
536
- llvm_unreachable ( " Unsupported statement: If" );
535
+ assert ( isSupportedMultiStatementClosure () &&
536
+ " Unsupported statement: If" );
537
537
538
538
SmallVector<ElementInfo, 4 > elements;
539
539
@@ -562,8 +562,8 @@ class ClosureConstraintGenerator
562
562
}
563
563
564
564
void visitGuardStmt (GuardStmt *guardStmt) {
565
- if (! isSupportedMultiStatementClosure ())
566
- llvm_unreachable ( " Unsupported statement: Guard" );
565
+ assert ( isSupportedMultiStatementClosure () &&
566
+ " Unsupported statement: Guard" );
567
567
568
568
createConjunction (cs,
569
569
{makeElement (guardStmt->getCondPointer (),
@@ -574,8 +574,8 @@ class ClosureConstraintGenerator
574
574
}
575
575
576
576
void visitWhileStmt (WhileStmt *whileStmt) {
577
- if (! isSupportedMultiStatementClosure ())
578
- llvm_unreachable ( " Unsupported statement: Guard " );
577
+ assert ( isSupportedMultiStatementClosure () &&
578
+ " Unsupported statement: While " );
579
579
580
580
createConjunction (cs,
581
581
{makeElement (whileStmt->getCondPointer (),
@@ -586,15 +586,15 @@ class ClosureConstraintGenerator
586
586
}
587
587
588
588
void visitDoStmt (DoStmt *doStmt) {
589
- if (! isSupportedMultiStatementClosure ())
590
- llvm_unreachable ( " Unsupported statement: Do" );
589
+ assert ( isSupportedMultiStatementClosure () &&
590
+ " Unsupported statement: Do" );
591
591
592
592
visitBraceStmt (doStmt->getBody ());
593
593
}
594
594
595
595
void visitRepeatWhileStmt (RepeatWhileStmt *repeatWhileStmt) {
596
- if (! isSupportedMultiStatementClosure ())
597
- llvm_unreachable ( " Unsupported statement: RepeatWhile" );
596
+ assert ( isSupportedMultiStatementClosure () &&
597
+ " Unsupported statement: RepeatWhile" );
598
598
599
599
createConjunction (cs,
600
600
{makeElement (repeatWhileStmt->getCond (),
@@ -606,8 +606,8 @@ class ClosureConstraintGenerator
606
606
}
607
607
608
608
void visitPoundAssertStmt (PoundAssertStmt *poundAssertStmt) {
609
- if (! isSupportedMultiStatementClosure ())
610
- llvm_unreachable ( " Unsupported statement: PoundAssert" );
609
+ assert ( isSupportedMultiStatementClosure () &&
610
+ " Unsupported statement: PoundAssert" );
611
611
612
612
createConjunction (cs,
613
613
{makeElement (poundAssertStmt->getCondition (),
@@ -618,8 +618,8 @@ class ClosureConstraintGenerator
618
618
}
619
619
620
620
void visitThrowStmt (ThrowStmt *throwStmt) {
621
- if (! isSupportedMultiStatementClosure ())
622
- llvm_unreachable ( " Unsupported statement: Throw" );
621
+ assert ( isSupportedMultiStatementClosure () &&
622
+ " Unsupported statement: Throw" );
623
623
624
624
Type errType =
625
625
cs.getASTContext ().getErrorDecl ()->getDeclaredInterfaceType ();
@@ -641,8 +641,8 @@ class ClosureConstraintGenerator
641
641
}
642
642
643
643
void visitForEachStmt (ForEachStmt *forEachStmt) {
644
- if (! isSupportedMultiStatementClosure ())
645
- llvm_unreachable ( " Unsupported statement: ForEach" );
644
+ assert ( isSupportedMultiStatementClosure () &&
645
+ " Unsupported statement: ForEach" );
646
646
647
647
auto *stmtLoc = cs.getConstraintLocator (locator);
648
648
@@ -679,8 +679,8 @@ class ClosureConstraintGenerator
679
679
}
680
680
681
681
void visitSwitchStmt (SwitchStmt *switchStmt) {
682
- if (! isSupportedMultiStatementClosure ())
683
- llvm_unreachable ( " Unsupported statement: Switch" );
682
+ assert ( isSupportedMultiStatementClosure () &&
683
+ " Unsupported statement: Switch" );
684
684
685
685
auto *switchLoc = cs.getConstraintLocator (
686
686
locator, LocatorPathElt::ClosureBodyElement (switchStmt));
@@ -705,8 +705,8 @@ class ClosureConstraintGenerator
705
705
}
706
706
707
707
void visitDoCatchStmt (DoCatchStmt *doStmt) {
708
- if (! isSupportedMultiStatementClosure ())
709
- llvm_unreachable ( " Unsupported statement: DoCatch" );
708
+ assert ( isSupportedMultiStatementClosure () &&
709
+ " Unsupported statement: DoCatch" );
710
710
711
711
auto *doLoc = cs.getConstraintLocator (
712
712
locator, LocatorPathElt::ClosureBodyElement (doStmt));
@@ -725,8 +725,8 @@ class ClosureConstraintGenerator
725
725
}
726
726
727
727
void visitCaseStmt (CaseStmt *caseStmt) {
728
- if (! isSupportedMultiStatementClosure ())
729
- llvm_unreachable ( " Unsupported statement: Case" );
728
+ assert ( isSupportedMultiStatementClosure () &&
729
+ " Unsupported statement: Case" );
730
730
731
731
Type contextualTy;
732
732
0 commit comments