[ORC] Fix the LLJITWithObjectCache example to address changes in ce2207abaf.

This commit is contained in:
Lang Hames 2020-01-21 22:43:08 -08:00
parent 1d1ebb9e59
commit 97d000da2e
1 changed files with 4 additions and 4 deletions

View File

@ -50,17 +50,17 @@ private:
void runJITWithCache(ObjectCache &ObjCache) { void runJITWithCache(ObjectCache &ObjCache) {
// Create an LLJIT instance with a custom CompileFunction. // Create an LLJIT instance with a custom IRCompiler.
auto J = ExitOnErr( auto J = ExitOnErr(
LLJITBuilder() LLJITBuilder()
.setCompileFunctionCreator( .setCompileFunctionCreator(
[&](JITTargetMachineBuilder JTMB) [&](JITTargetMachineBuilder JTMB)
-> Expected<IRCompileLayer::CompileFunction> { -> Expected<std::unique_ptr<IRCompileLayer::IRCompiler>> {
auto TM = JTMB.createTargetMachine(); auto TM = JTMB.createTargetMachine();
if (!TM) if (!TM)
return TM.takeError(); return TM.takeError();
return IRCompileLayer::CompileFunction( return std::make_unique<TMOwningSimpleCompiler>(std::move(*TM),
TMOwningSimpleCompiler(std::move(*TM), &ObjCache)); &ObjCache);
}) })
.create()); .create());