Commit 4b944653 by Ben Clayton

LLVMReactor: Always run the IR verifier.

Stuff is broken and has gone unnoticed. Bug: b/131914569 Change-Id: I2624a38f78a05114caf69681291733343fbe1c90 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/30451 Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarBen Clayton <bclayton@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 99e57199
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
#include "llvm/IR/LegacyPassManager.h" #include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Mangler.h" #include "llvm/IR/Mangler.h"
#include "llvm/IR/Module.h" #include "llvm/IR/Module.h"
#include "llvm/IR/Verifier.h"
#include "llvm/Support/Error.h" #include "llvm/Support/Error.h"
#include "llvm/Support/TargetSelect.h" #include "llvm/Support/TargetSelect.h"
#include "llvm/Target/TargetOptions.h" #include "llvm/Target/TargetOptions.h"
...@@ -977,6 +978,15 @@ namespace rr ...@@ -977,6 +978,15 @@ namespace rr
::module->print(file, 0); ::module->print(file, 0);
} }
// FIXME: Disable for release builds once heavy development is over.
bool verifyIR = true;
if(verifyIR)
{
llvm::legacy::PassManager pm;
pm.add(llvm::createVerifierPass());
pm.run(*::module);
}
if(runOptimizations) if(runOptimizations)
{ {
optimize(); optimize();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment