Commit 92edb295 authored by Lang Hames's avatar Lang Hames Committed by Hans Wennborg
Browse files

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

(cherry picked from commit 97d000da)
parent 011adfcb
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -50,17 +50,17 @@ private:

void runJITWithCache(ObjectCache &ObjCache) {

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