diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-26 05:03:10 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-03-26 05:03:10 +0000 |
commit | 5fbcc46a4a7ecfefd911ef7bd0c2563b04eb8c6f (patch) | |
tree | e3c91cc3b6b077784e0055ef4fa544bcd91bd9cc /llvm/tools/bugpoint/BugDriver.cpp | |
parent | 866aed7711f35a5dc56079780ef1ece3542f701f (diff) | |
download | bcm5719-llvm-5fbcc46a4a7ecfefd911ef7bd0c2563b04eb8c6f.tar.gz bcm5719-llvm-5fbcc46a4a7ecfefd911ef7bd0c2563b04eb8c6f.zip |
bugpoint: Verify input files
Like r233229 for `llvm-link`, start verifying input files to `bugpoint`.
llvm-svn: 233253
Diffstat (limited to 'llvm/tools/bugpoint/BugDriver.cpp')
-rw-r--r-- | llvm/tools/bugpoint/BugDriver.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/tools/bugpoint/BugDriver.cpp b/llvm/tools/bugpoint/BugDriver.cpp index d76e7d030ec..865cb513c55 100644 --- a/llvm/tools/bugpoint/BugDriver.cpp +++ b/llvm/tools/bugpoint/BugDriver.cpp @@ -16,6 +16,7 @@ #include "BugDriver.h" #include "ToolRunner.h" #include "llvm/IR/Module.h" +#include "llvm/IR/Verifier.h" #include "llvm/IRReader/IRReader.h" #include "llvm/Linker/Linker.h" #include "llvm/Pass.h" @@ -91,6 +92,11 @@ std::unique_ptr<Module> llvm::parseInputFile(StringRef Filename, return Result; } + if (verifyModule(*Result, &errs())) { + errs() << "bugpoint: " << Filename << ": error: does not verify\n"; + return std::unique_ptr<Module>(); + } + // If we don't have an override triple, use the first one to configure // bugpoint, or use the host triple if none provided. if (TargetTriple.getTriple().empty()) { |