aboutsummaryrefslogtreecommitdiff
path: root/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
commita1945fa74d04098d7e22d7c31585342555eca928 (patch)
treef59491bcd1cfc0ba048cbbb4a247a2dc0a1d2fd7 /lib/CodeGen/CodeGenModule.cpp
parent226249424893f9375ab4e5dabb4d2d9677263835 (diff)
Verify the whole module after codegen to catch silly IR bugs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50485 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 7e5e8f06b7..bf1f0d823d 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/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