diff options
author | Adrian Prantl <aprantl@apple.com> | 2016-05-09 17:43:24 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2016-05-09 17:43:24 +0000 |
commit | 614d411a0d0078cc20d55b20b37a32a8c0c52400 (patch) | |
tree | ccd9797e5a74d97a4e6f0d7bf28b28c4c27ff6ae /llvm/lib/IR/Verifier.cpp | |
parent | da43f0e76f9a9e7de5d13d902048ffe238cb591c (diff) | |
download | bcm5719-llvm-614d411a0d0078cc20d55b20b37a32a8c0c52400.tar.gz bcm5719-llvm-614d411a0d0078cc20d55b20b37a32a8c0c52400.zip |
Revert "Separate the Verifier into an analysis and a transformation pass and"
This reverts commit 268937 while investigating build bot breakage.
llvm-svn: 268939
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 9abe8d850f5..e09f763f10b 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -59,7 +59,6 @@ #include "llvm/IR/DataLayout.h" #include "llvm/IR/DebugInfo.h" #include "llvm/IR/DerivedTypes.h" -#include "llvm/IR/DiagnosticInfo.h" #include "llvm/IR/Dominators.h" #include "llvm/IR/InlineAsm.h" #include "llvm/IR/InstIterator.h" @@ -4483,38 +4482,15 @@ FunctionPass *llvm::createVerifierPass(bool FatalErrors) { return new VerifierLegacyPass(FatalErrors); } -char VerifierAnalysis::PassID; -VerifierAnalysis::Result VerifierAnalysis::run(Module &M) { - Result Res; - Res.IRBroken = llvm::verifyModule(M, &dbgs(), &Res.DebugInfoBroken); - return Res; -} - -VerifierAnalysis::Result VerifierAnalysis::run(Function &F) { - return { llvm::verifyFunction(F, &dbgs()), false }; -} +PreservedAnalyses VerifierPass::run(Module &M) { + if (verifyModule(M, &dbgs()) && FatalErrors) + report_fatal_error("Broken module found, compilation aborted!"); -PreservedAnalyses VerifierPass::run(Module &M, ModuleAnalysisManager &AM) { - auto Res = AM.getResult<VerifierAnalysis>(M); - if (FatalErrors) { - if (Res.IRBroken) - report_fatal_error("Broken module found, compilation aborted!"); - assert(!Res.DebugInfoBroken && "Module contains invalid debug info"); - } - - // Strip broken debug info. - if (Res.DebugInfoBroken) { - DiagnosticInfoIgnoringInvalidDebugMetadata DiagInvalid(M); - M.getContext().diagnose(DiagInvalid); - if (!StripDebugInfo(M)) - report_fatal_error("Failed to strip malformed debug info"); - } return PreservedAnalyses::all(); } -PreservedAnalyses VerifierPass::run(Function &F, FunctionAnalysisManager &AM) { - auto res = AM.getResult<VerifierAnalysis>(F); - if (res.IRBroken && FatalErrors) +PreservedAnalyses VerifierPass::run(Function &F) { + if (verifyFunction(F, &dbgs()) && FatalErrors) report_fatal_error("Broken function found, compilation aborted!"); return PreservedAnalyses::all(); |