@@ -61,6 +61,9 @@ static llvm::cl::opt<bool> AbortOnFailure(
61
61
static llvm::cl::opt<bool > ContinueOnFailure (" verify-continue-on-failure" ,
62
62
llvm::cl::init (false ));
63
63
64
+ static llvm::cl::opt<bool > DumpModuleOnFailure (" verify-dump-module-on-failure" ,
65
+ llvm::cl::init (false ));
66
+
64
67
static llvm::cl::opt<bool > VerifyDIHoles (
65
68
" verify-di-holes" ,
66
69
llvm::cl::init (true ));
@@ -712,8 +715,11 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
712
715
713
716
llvm::dbgs () << " In function:\n " ;
714
717
F.print (llvm::dbgs ());
715
- llvm::dbgs () << " In module:\n " ;
716
- F.getModule ().print (llvm::dbgs ());
718
+ if (DumpModuleOnFailure) {
719
+ // Don't do this by default because modules can be _very_ large.
720
+ llvm::dbgs () << " In module:\n " ;
721
+ F.getModule ().print (llvm::dbgs ());
722
+ }
717
723
718
724
// We abort by default because we want to always crash in
719
725
// the debugger.
@@ -1504,14 +1510,6 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
1504
1510
" cannot call coroutine with normal apply" );
1505
1511
require (!calleeConv.funcTy ->isAsync () || AI->getFunction ()->isAsync (),
1506
1512
" cannot call an async function from a non async function" );
1507
-
1508
- // Check that if the apply is of a noreturn callee, make sure that an
1509
- // unreachable is the next instruction.
1510
- if (AI->getModule ().getStage () == SILStage::Raw ||
1511
- !AI->isCalleeNoReturn ())
1512
- return ;
1513
- require (isa<UnreachableInst>(std::next (SILBasicBlock::iterator (AI))),
1514
- " No return apply without an unreachable as a next instruction." );
1515
1513
}
1516
1514
1517
1515
void checkTryApplyInst (TryApplyInst *AI) {
0 commit comments