| 348 | } |
| 349 | |
| 350 | Engine::Engine(const std::shared_ptr<Configuration>& conf, |
| 351 | std::unique_ptr<llvm::orc::LLJIT> lljit, |
| 352 | std::shared_ptr<llvm::TargetMachine> target_machine, bool cached) |
| 353 | : context_(std::make_unique<llvm::LLVMContext>()), |
| 354 | lljit_(std::move(lljit)), |
| 355 | ir_builder_(std::make_unique<llvm::IRBuilder<>>(*context_)), |
| 356 | types_(*context_), |
| 357 | optimize_(conf->optimize()), |
| 358 | cached_(cached), |
| 359 | function_registry_(conf->function_registry()), |
| 360 | target_machine_(std::move(target_machine)), |
| 361 | conf_(conf) { |
| 362 | // LLVM 10 doesn't like the expr function name to be the same as the module name |
| 363 | auto module_id = "gdv_module_" + std::to_string(reinterpret_cast<uintptr_t>(this)); |
| 364 | module_ = std::make_unique<llvm::Module>(module_id, *context_); |
| 365 | module_->setDataLayout(target_machine_->createDataLayout()); |
| 366 | } |
| 367 | |
| 368 | Engine::~Engine() {} |
| 369 |
nothing calls this directly
no test coverage detected