summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2018-08-28 20:20:31 +0000
committerLang Hames <lhames@gmail.com>2018-08-28 20:20:31 +0000
commit37a66413c107373b52714ace3e9548f929f23539 (patch)
tree26b0430087dc662fc511642809bbef2f0a3103e5 /llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
parent9401fd0ed24166e10fa34ae90ac6a2409a93097c (diff)
downloadbcm5719-llvm-37a66413c107373b52714ace3e9548f929f23539.tar.gz
bcm5719-llvm-37a66413c107373b52714ace3e9548f929f23539.zip
[ORC] Add an addObjectFile method to LLJIT.
The addObjectFile method adds the given object file to the JIT session, making its code available for execution. Support for the -extra-object flag is added to lli when operating in -jit-kind=orc-lazy mode to support testing of this feature. llvm-svn: 340870
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc/LLJIT.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/Orc/LLJIT.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp b/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
index 12ec65a2050..f9cc763f802 100644
--- a/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
@@ -38,6 +38,13 @@ Error LLJIT::addIRModule(JITDylib &JD, std::unique_ptr<Module> M) {
return CompileLayer.add(JD, K, std::move(M));
}
+Error LLJIT::addObjectFile(JITDylib &JD, std::unique_ptr<MemoryBuffer> Obj) {
+ assert(Obj && "Can not add null object");
+
+ auto K = ES->allocateVModule();
+ return ObjLinkingLayer.add(JD, K, std::move(Obj));
+}
+
Expected<JITEvaluatedSymbol> LLJIT::lookupLinkerMangled(JITDylib &JD,
StringRef Name) {
return llvm::orc::lookup({&JD}, ES->getSymbolStringPool().intern(Name));
OpenPOWER on IntegriCloud