Browse Source

Execution Engine cleanups

cl-refactor
Paweł Bylica 10 years ago
parent
commit
bd85efa299
  1. 5
      libevmjit/ExecutionEngine.cpp

5
libevmjit/ExecutionEngine.cpp

@ -53,15 +53,11 @@ ReturnCode ExecutionEngine::run(std::unique_ptr<llvm::Module> _module, RuntimeDa
static const auto program = "EVM JIT";
llvm::PrettyStackTraceProgram X(1, &program);
llvm::InitializeNativeTarget();
llvm::InitializeNativeTargetAsmPrinter();
llvm::InitializeNativeTargetAsmParser();
llvm::EngineBuilder builder(module);
builder.setEngineKind(llvm::EngineKind::JIT);
builder.setUseMCJIT(true);
std::unique_ptr<llvm::SectionMemoryManager> memoryManager(new llvm::SectionMemoryManager);
builder.setMCJITMemoryManager(memoryManager.get());
builder.setOptLevel(llvm::CodeGenOpt::None);
auto triple = llvm::Triple(llvm::sys::getProcessTriple());
@ -74,7 +70,6 @@ ReturnCode ExecutionEngine::run(std::unique_ptr<llvm::Module> _module, RuntimeDa
if (!exec.engine)
return ReturnCode::LLVMConfigError;
_module.release(); // Successfully created llvm::ExecutionEngine takes ownership of the module
memoryManager.release(); // and memory manager
// TODO: Finalization not needed when llvm::ExecutionEngine::getFunctionAddress used
//auto finalizationStartTime = std::chrono::high_resolution_clock::now();

Loading…
Cancel
Save