diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-04-15 16:27:38 +0000 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-04-15 16:27:38 +0000 |
| commit | 6ef5f284d6f89e77191d3b72e3d4893efe10f9b1 (patch) | |
| tree | e27da78c201fe61af98b46e4a79b38a9b7784458 /llvm/tools | |
| parent | 67b44da0dd8c0733d71a5fe7dda6607c9f294775 (diff) | |
| download | bcm5719-llvm-6ef5f284d6f89e77191d3b72e3d4893efe10f9b1.tar.gz bcm5719-llvm-6ef5f284d6f89e77191d3b72e3d4893efe10f9b1.zip | |
verify-di: Implement DebugInfoVerifier
Implement DebugInfoVerifier, which steals verification relying on
DebugInfoFinder from Verifier.
- Adds LegacyDebugInfoVerifierPassPass, a ModulePass which wraps
DebugInfoVerifier. Uses -verify-di command-line flag.
- Change verifyModule() to invoke DebugInfoVerifier as well as
Verifier.
- Add a call to createDebugInfoVerifierPass() wherever there was a
call to createVerifierPass().
This implementation as a module pass should sidestep efficiency issues,
allowing us to turn debug info verification back on.
<rdar://problem/15500563>
llvm-svn: 206300
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/bugpoint/CrashDebugger.cpp | 1 | ||||
| -rw-r--r-- | llvm/tools/llvm-stress/llvm-stress.cpp | 1 | ||||
| -rw-r--r-- | llvm/tools/opt/opt.cpp | 18 |
3 files changed, 17 insertions, 3 deletions
diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp index bdaa6c9c89d..c646ff49b1c 100644 --- a/llvm/tools/bugpoint/CrashDebugger.cpp +++ b/llvm/tools/bugpoint/CrashDebugger.cpp @@ -410,6 +410,7 @@ bool ReduceCrashingInstructions::TestInsts(std::vector<const Instruction*> // Verify that this is still valid. 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 18f1e6ca1be..5e42bb9fcbf 100644 --- a/llvm/tools/llvm-stress/llvm-stress.cpp +++ b/llvm/tools/llvm-stress/llvm-stress.cpp @@ -713,6 +713,7 @@ int main(int argc, char **argv) { 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 5a198816e67..8f958bbd0aa 100644 --- a/llvm/tools/opt/opt.cpp +++ b/llvm/tools/opt/opt.cpp @@ -191,7 +191,10 @@ static inline void addPass(PassManagerBase &PM, Pass *P) { PM.add(P); // If we are verifying all of the intermediate steps, add the verifier... - if (VerifyEach) PM.add(createVerifierPass()); + if (VerifyEach) { + PM.add(createVerifierPass()); + PM.add(createDebugInfoVerifierPass()); + } } /// AddOptimizationPasses - This routine adds optimization passes @@ -201,7 +204,8 @@ static inline void addPass(PassManagerBase &PM, Pass *P) { /// OptLevel - Optimization Level static void AddOptimizationPasses(PassManagerBase &MPM,FunctionPassManager &FPM, unsigned OptLevel, unsigned SizeLevel) { - FPM.add(createVerifierPass()); // Verify that input is correct + FPM.add(createVerifierPass()); // Verify that input is correct + MPM.add(createDebugInfoVerifierPass()); // Verify that debug info is correct PassManagerBuilder Builder; Builder.OptLevel = OptLevel; @@ -240,6 +244,9 @@ static void AddStandardCompilePasses(PassManagerBase &PM) { if (StripDebug) addPass(PM, createStripSymbolsPass(true)); + // Verify debug info only after it's (possibly) stripped. + PM.add(createDebugInfoVerifierPass()); + if (DisableOptimizations) return; // -std-compile-opts adds the same module passes as -O3. @@ -257,6 +264,9 @@ static void AddStandardLinkPasses(PassManagerBase &PM) { if (StripDebug) addPass(PM, createStripSymbolsPass(true)); + // Verify debug info only after it's (possibly) stripped. + PM.add(createDebugInfoVerifierPass()); + if (DisableOptimizations) return; PassManagerBuilder Builder; @@ -600,8 +610,10 @@ 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) { |

