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).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232772 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-03-19 22:24:17 +00:00
parent 10f24ca2ad
commit a60d430e31
10 changed files with 9 additions and 72 deletions

View File

@@ -185,10 +185,8 @@ static inline void addPass(legacy::PassManagerBase &PM, Pass *P) {
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 inline void addPass(legacy::PassManagerBase &PM, Pass *P) {
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 @@ int main(int argc, char **argv) {
}
// 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) {