// Callback to inspect the cache and recompile on demand. This follows Lang's
// LLJITWithObjectCache example.
auto compileFunctionCreator = [&](JITTargetMachineBuilder JTMB)
- -> Expected<IRCompileLayer::CompileFunction> {
+ -> Expected<std::unique_ptr<IRCompileLayer::IRCompiler>> {
if (jitCodeGenOptLevel)
JTMB.setCodeGenOptLevel(jitCodeGenOptLevel.getValue());
auto TM = JTMB.createTargetMachine();
if (!TM)
return TM.takeError();
- return IRCompileLayer::CompileFunction(
- TMOwningSimpleCompiler(std::move(*TM), engine->cache.get()));
+ return std::make_unique<TMOwningSimpleCompiler>(std::move(*TM),
+ engine->cache.get());
};
// Create the LLJIT by calling the LLJITBuilder with 2 callbacks.