diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp --- a/llvm/lib/CodeGen/WinEHPrepare.cpp +++ b/llvm/lib/CodeGen/WinEHPrepare.cpp @@ -1071,10 +1071,10 @@ DemoteCatchSwitchPHIOnlyOpt); if (!DisableCleanups) { - LLVM_DEBUG(verifyFunction(F)); + assert(!verifyFunction(F, &dbgs())); removeImplausibleInstructions(F); - LLVM_DEBUG(verifyFunction(F)); + assert(!verifyFunction(F, &dbgs())); cleanupPreparedFunclets(F); } diff --git a/llvm/lib/Target/Hexagon/HexagonCommonGEP.cpp b/llvm/lib/Target/Hexagon/HexagonCommonGEP.cpp --- a/llvm/lib/Target/Hexagon/HexagonCommonGEP.cpp +++ b/llvm/lib/Target/Hexagon/HexagonCommonGEP.cpp @@ -1292,7 +1292,8 @@ #ifdef EXPENSIVE_CHECKS // Run this only when expensive checks are enabled. - verifyFunction(F); + if (verifyFunction(F, &dbgs())) + report_fatal_error("Broken function"); #endif return true; } diff --git a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp --- a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp +++ b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp @@ -894,7 +894,8 @@ // For now, we do a mandatory verification step because we don't // entirely trust this pass. Note that we don't want to add a verifier // pass to FPM below because it will also verify all the global data. - verifyFunction(F); + if (verifyFunction(F, &errs())) + report_fatal_error("Broken function"); legacy::FunctionPassManager FPM(F.getParent()); diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -7669,7 +7669,7 @@ // Mark the loop as already vectorized to avoid vectorizing again. Hints.setAlreadyVectorized(); - LLVM_DEBUG(verifyFunction(*L->getHeader()->getParent())); + assert(!verifyFunction(*L->getHeader()->getParent(), &dbgs())); return true; } @@ -7971,7 +7971,7 @@ Hints.setAlreadyVectorized(); } - LLVM_DEBUG(verifyFunction(*L->getHeader()->getParent())); + assert(!verifyFunction(*L->getHeader()->getParent())); return true; } diff --git a/llvm/tools/llvm-as-fuzzer/llvm-as-fuzzer.cpp b/llvm/tools/llvm-as-fuzzer/llvm-as-fuzzer.cpp --- a/llvm/tools/llvm-as-fuzzer/llvm-as-fuzzer.cpp +++ b/llvm/tools/llvm-as-fuzzer/llvm-as-fuzzer.cpp @@ -70,6 +70,7 @@ if (!M.get()) return 0; - verifyModule(*M.get()); + if (verifyModule(*M.get(), &errs())) + report_fatal_error("Broken module"); return 0; } diff --git a/llvm/tools/llvm-split/llvm-split.cpp b/llvm/tools/llvm-split/llvm-split.cpp --- a/llvm/tools/llvm-split/llvm-split.cpp +++ b/llvm/tools/llvm-split/llvm-split.cpp @@ -61,7 +61,11 @@ exit(1); } - verifyModule(*MPart); + if (verifyModule(*MPart, &errs())) { + errs() << "Broken module!\n"; + exit(1); + } + WriteBitcodeToFile(*MPart, Out->os()); // Declare success.