The getMainJITDylib() method was removed in
4fc68b9b7f, replace it by creating a JITDylib on the fly.
PiperOrigin-RevId:
283948595
auto objectLayer = std::make_unique<RTDyldObjectLinkingLayer>(
session, []() { return std::make_unique<SectionMemoryManager>(); });
auto dataLayout = deserModule->getDataLayout();
+ llvm::orc::JITDylib *mainJD = session.getJITDylibByName("<main>");
+ if (!mainJD)
+ mainJD = &session.createJITDylib("<main>");
// Resolve symbols that are statically linked in the current process.
- session.getMainJITDylib().addGenerator(
+ mainJD->addGenerator(
cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess(
dataLayout.getGlobalPrefix())));