summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-30 16:05:42 +0000
committerChris Lattner <sabre@nondot.org>2008-04-30 16:05:42 +0000
commitdd477ce32ba4472c50fa4636c80a94105efc0b0f (patch)
tree580f1aa8affd2d5ec5e1be4c43cef3e600d3e6ec /clang/lib/CodeGen/CodeGenModule.cpp
parente16406d2b19e1881650f017943be5cb4cdcf0dbd (diff)
downloadbcm5719-llvm-dd477ce32ba4472c50fa4636c80a94105efc0b0f.tar.gz
bcm5719-llvm-dd477ce32ba4472c50fa4636c80a94105efc0b0f.zip
Verify the whole module after codegen to catch silly IR bugs.
llvm-svn: 50485
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 7e5e8f06b70..bf1f0d823d7 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -24,6 +24,7 @@
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
#include "llvm/Intrinsics.h"
+#include "llvm/Analysis/Verifier.h"
#include <algorithm>
using namespace clang;
using namespace CodeGen;
@@ -48,6 +49,9 @@ CodeGenModule::~CodeGenModule() {
EmitGlobalCtors();
EmitAnnotations();
delete Runtime;
+
+ // Run the verifier to check that the generated code is consistent.
+ assert(!verifyModule(TheModule));
}
/// WarnUnsupported - Print out a warning that codegen doesn't support the
OpenPOWER on IntegriCloud