aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGen.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CodeGen.cc')
-rw-r--r--lib/CodeGen/CodeGen.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGen.cc b/lib/CodeGen/CodeGen.cc
index d81c4ff..e45a3db 100644
--- a/lib/CodeGen/CodeGen.cc
+++ b/lib/CodeGen/CodeGen.cc
@@ -364,7 +364,9 @@ void CodeGen::compile(const std::vector<SourceUnit> &Sources) {
RuntimeChecker->emitStderr(Msg);
Builder->CreateRet(ConstantInt::get(Type::getInt32Ty(*TheContext), 1));
- if (verifyModule(*TheModule, &errs())) {
+ // After a reported error the IR may be incomplete; verifying it would only
+ // dump noise behind the real diagnostic.
+ if (!HadError && verifyModule(*TheModule, &errs())) {
errs() << cps::diagnosticPrefix(cps::Severity::Fatal, "") << "LLVM module verification failed\n";
HadError = true;
}