StandardInstrumentation: print verifier output to errs
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Tue, 28 Jun 2022 17:14:09 +0000 (19:14 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 29 Jun 2022 10:11:55 +0000 (12:11 +0200)
Enabling the verifiers is not very helpful if their output is
suppressed beyond the fatal error.

Differential Revision: https://reviews.llvm.org/D128743

llvm/lib/Passes/StandardInstrumentations.cpp

index 4cd2a1a..ab9f8bf 100644 (file)
@@ -1192,7 +1192,7 @@ void VerifyInstrumentation::registerCallbacks(
           if (DebugLogging)
             dbgs() << "Verifying function " << F->getName() << "\n";
 
-          if (verifyFunction(*F))
+          if (verifyFunction(*F, &errs()))
             report_fatal_error("Broken function found, compilation aborted!");
         } else if (any_isa<const Module *>(IR) ||
                    any_isa<const LazyCallGraph::SCC *>(IR)) {
@@ -1207,7 +1207,7 @@ void VerifyInstrumentation::registerCallbacks(
           if (DebugLogging)
             dbgs() << "Verifying module " << M->getName() << "\n";
 
-          if (verifyModule(*M))
+          if (verifyModule(*M, &errs()))
             report_fatal_error("Broken module found, compilation aborted!");
         }
       });