Verifier: Remove the separate -verify-di pass
Remove `DebugInfoVerifierLegacyPass` and the `-verify-di` pass.
Instead, call into the `DebugInfoVerifier` from inside
`VerifierLegacyPass::finalizeModule()`. This better matches the logic
in `verifyModule()` (used by the new PassManager), avoids requiring two
separate passes to verify the IR, and makes the API for "add a pass to
verify the IR" simple.
Note: the `-verify-debug-info` flag still works (for now, at least;
eventually it might make sense to just remove it).
llvm-svn: 232772
diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp
index ee18169..f9f3f10 100644
--- a/llvm/tools/bugpoint/CrashDebugger.cpp
+++ b/llvm/tools/bugpoint/CrashDebugger.cpp
@@ -409,7 +409,6 @@
// Verify that this is still valid.
legacy::PassManager Passes;
Passes.add(createVerifierPass());
- Passes.add(createDebugInfoVerifierPass());
Passes.run(*M);
// Try running on the hacked up program...
diff --git a/llvm/tools/llvm-stress/llvm-stress.cpp b/llvm/tools/llvm-stress/llvm-stress.cpp
index 05ceeb5..f5e718b 100644
--- a/llvm/tools/llvm-stress/llvm-stress.cpp
+++ b/llvm/tools/llvm-stress/llvm-stress.cpp
@@ -713,7 +713,6 @@
legacy::PassManager Passes;
Passes.add(createVerifierPass());
- Passes.add(createDebugInfoVerifierPass());
Passes.add(createPrintModulePass(Out->os()));
Passes.run(*M.get());
Out->keep();
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index 6c27c1e..c1e120a 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/tools/opt/opt.cpp
@@ -185,10 +185,8 @@
PM.add(P);
// If we are verifying all of the intermediate steps, add the verifier...
- if (VerifyEach) {
+ if (VerifyEach)
PM.add(createVerifierPass());
- PM.add(createDebugInfoVerifierPass());
- }
}
/// This routine adds optimization passes based on selected optimization level,
@@ -198,8 +196,7 @@
static void AddOptimizationPasses(legacy::PassManagerBase &MPM,
legacy::FunctionPassManager &FPM,
unsigned OptLevel, unsigned SizeLevel) {
- FPM.add(createVerifierPass()); // Verify that input is correct
- MPM.add(createDebugInfoVerifierPass()); // Verify that debug info is correct
+ FPM.add(createVerifierPass()); // Verify that input is correct
PassManagerBuilder Builder;
Builder.OptLevel = OptLevel;
@@ -558,10 +555,8 @@
}
// Check that the module is well formed on completion of optimization
- if (!NoVerify && !VerifyEach) {
+ if (!NoVerify && !VerifyEach)
Passes.add(createVerifierPass());
- Passes.add(createDebugInfoVerifierPass());
- }
// Write bitcode or assembly to the output as the last step...
if (!NoOutput && !AnalyzeOnly) {