Several changes to optimizer related code.

- New functions codeGenOptLevel() and verifyModule() to remove code duplication
- Hidden option no-verify renamed to disable-verify and moved to optimizer (like opt tool)
- Removed global.params.noVerify
This commit is contained in:
kai 2012-08-16 23:26:52 +02:00
parent 34d595de26
commit e6a07ffdfe
8 changed files with 59 additions and 48 deletions

View file

@ -29,6 +29,7 @@
#include "gen/structs.h"
#include "gen/todebug.h"
#include "gen/tollvm.h"
#include "gen/optimizer.h"
#include "ir/irvar.h"
#include "ir/irmodule.h"
@ -289,19 +290,7 @@ llvm::Module* Module::genLLVMModule(llvm::LLVMContext& context, Ir* sir)
genmoduleinfo();
// verify the llvm
if (!global.params.noVerify) {
std::string verifyErr;
Logger::println("Verifying module...");
LOG_SCOPE;
if (llvm::verifyModule(*ir.module,llvm::ReturnStatusAction,&verifyErr))
{
error("%s", verifyErr.c_str());
fatal();
}
else {
Logger::println("Verification passed!");
}
}
verifyModule(*ir.module);
gIR = NULL;