summaryrefslogtreecommitdiffstats
path: root/mlir/lib/ExecutionEngine
diff options
context:
space:
mode:
authorAlex Zinenko <zinenko@google.com>2019-08-15 04:50:51 -0700
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-08-15 04:51:16 -0700
commit30e9c2fe4fe93f288307159ba2a3e762c7ab2304 (patch)
tree9a5ee465f8058d0e7c46bb783577b0c6285d1054 /mlir/lib/ExecutionEngine
parent92a7b1080eb055d3af031be2b88b0e487fdc1ff2 (diff)
downloadbcm5719-llvm-30e9c2fe4fe93f288307159ba2a3e762c7ab2304.tar.gz
bcm5719-llvm-30e9c2fe4fe93f288307159ba2a3e762c7ab2304.zip
ExecutionEngine: fix after upstream LLVM ORC update
LLVM r368707 updated the APIs in llvm::orc::DynamicLibrarySearchGenerator to use unique_ptr for holding the instance of the generator. Update our uses of DynamicLibrarySearchGenerator in the ExecutionEngine to reflect that. PiperOrigin-RevId: 263539855
Diffstat (limited to 'mlir/lib/ExecutionEngine')
-rw-r--r--mlir/lib/ExecutionEngine/ExecutionEngine.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/mlir/lib/ExecutionEngine/ExecutionEngine.cpp b/mlir/lib/ExecutionEngine/ExecutionEngine.cpp
index b830c53b552..99bf43de8c1 100644
--- a/mlir/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/mlir/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -91,7 +91,7 @@ public:
// `llvm::sys::DynamicLibrary::AddSymbol`.
Expected<llvm::orc::SymbolNameSet>
operator()(llvm::orc::JITDylib &JD, const llvm::orc::SymbolNameSet &Names) {
- auto res = defaultGenerator(JD, Names);
+ auto res = defaultGenerator->tryToGenerate(JD, Names);
if (!res)
return res;
llvm::orc::SymbolMap newSymbols;
@@ -114,7 +114,7 @@ public:
}
private:
- llvm::orc::DynamicLibrarySearchGenerator defaultGenerator;
+ std::unique_ptr<llvm::orc::DynamicLibrarySearchGenerator> defaultGenerator;
};
// Simple layered Orc JIT compilation engine.
@@ -139,8 +139,9 @@ public:
transformLayer(session, compileLayer, makeIRTransformFunction()),
dataLayout(layout), mangler(session, this->dataLayout),
threadSafeCtx(llvm::make_unique<llvm::LLVMContext>()) {
- session.getMainJITDylib().setGenerator(
- SearchGenerator(layout.getGlobalPrefix()));
+ session.getMainJITDylib().addGenerator(
+ cantFail(llvm::orc::DynamicLibrarySearchGenerator::GetForCurrentProcess(
+ layout.getGlobalPrefix())));
loadLibraries(sharedLibPaths);
}
@@ -223,7 +224,7 @@ void mlir::impl::OrcJIT::loadLibraries(ArrayRef<StringRef> sharedLibPaths) {
<< "\n";
continue;
}
- JD.setGenerator(loaded.get());
+ JD.addGenerator(std::move(*loaded));
auto res = objectLayer.add(JD, std::move(mb.get()));
if (res)
llvm::errs() << "Could not add: " << libPath << " " << res << "\n";
OpenPOWER on IntegriCloud