Index: llvm/examples/OrcV2Examples/LLJITWithObjectCache/LLJITWithObjectCache.cpp =================================================================== --- llvm/examples/OrcV2Examples/LLJITWithObjectCache/LLJITWithObjectCache.cpp +++ llvm/examples/OrcV2Examples/LLJITWithObjectCache/LLJITWithObjectCache.cpp @@ -54,7 +54,7 @@ auto J = ExitOnErr( LLJITBuilder() .setCompileFunctionCreator( - [&](JITTargetMachineBuilder JTMB) + [&](JITTargetMachineBuilder &JTMB) -> Expected> { auto TM = JTMB.createTargetMachine(); if (!TM) Index: llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h =================================================================== --- llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h +++ llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h @@ -256,7 +256,7 @@ using CompileFunctionCreator = std::function>( - JITTargetMachineBuilder JTMB)>; + JITTargetMachineBuilder &JTMB)>; using PlatformSetupFunction = std::function; Index: llvm/lib/ExecutionEngine/Orc/LLJIT.cpp =================================================================== --- llvm/lib/ExecutionEngine/Orc/LLJIT.cpp +++ llvm/lib/ExecutionEngine/Orc/LLJIT.cpp @@ -816,7 +816,7 @@ /// If there is a custom compile function creator set then use it. if (S.CreateCompileFunction) - return S.CreateCompileFunction(std::move(JTMB)); + return S.CreateCompileFunction(JTMB); // Otherwise default to creating a SimpleCompiler, or ConcurrentIRCompiler, // depending on the number of threads requested. Index: llvm/tools/lli/lli.cpp =================================================================== --- llvm/tools/lli/lli.cpp +++ llvm/tools/lli/lli.cpp @@ -897,7 +897,7 @@ CacheManager = std::make_unique(ObjectCacheDir); Builder.setCompileFunctionCreator( - [&](orc::JITTargetMachineBuilder JTMB) + [&](orc::JITTargetMachineBuilder &JTMB) -> Expected> { if (LazyJITCompileThreads > 0) return std::make_unique(std::move(JTMB),