mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-18 05:43:14 +01:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user