Verify the whole module after codegen to catch silly IR bugs.

llvm-svn: 50485
This commit is contained in:
Chris Lattner 2008-04-30 16:05:42 +00:00
parent e16406d2b1
commit dd477ce32b
1 changed files with 4 additions and 0 deletions

View 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