diff --git a/mlir/lib/ExecutionEngine/ExecutionEngine.cpp b/mlir/lib/ExecutionEngine/ExecutionEngine.cpp index 58f783824bc4..2913c436ad51 100644 --- a/mlir/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/mlir/lib/ExecutionEngine/ExecutionEngine.cpp @@ -234,9 +234,12 @@ Expected> ExecutionEngine::create( auto objectLayer = std::make_unique( session, []() { return std::make_unique(); }); auto dataLayout = deserModule->getDataLayout(); + llvm::orc::JITDylib *mainJD = session.getJITDylibByName("
"); + if (!mainJD) + mainJD = &session.createJITDylib("
"); // Resolve symbols that are statically linked in the current process. - session.getMainJITDylib().addGenerator( + mainJD->addGenerator( cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess( dataLayout.getGlobalPrefix())));