]> granicus.if.org Git - clang/commitdiff
Verify the whole module after codegen to catch silly IR bugs.
authorChris Lattner <sabre@nondot.org>
Wed, 30 Apr 2008 16:05:42 +0000 (16:05 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 30 Apr 2008 16:05:42 +0000 (16:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50485 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenModule.cpp

index 7e5e8f06b707b4c85e437486f83aea80f95d2b4e..bf1f0d823d7152315a9ae85a7967f96ce48d95d5 100644 (file)
@@ -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