summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/Orc/OrcCBindingsStack.h
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2017-07-04 04:42:30 +0000
committerLang Hames <lhames@gmail.com>2017-07-04 04:42:30 +0000
commit5b51816020a0daf35f8c24ca06ddffb24d1d493e (patch)
treee31025566467d993f049a6ed82299fc64fe83401 /llvm/lib/ExecutionEngine/Orc/OrcCBindingsStack.h
parentb224d985940212e4f8986a5f505d7c7bff563fb4 (diff)
downloadbcm5719-llvm-5b51816020a0daf35f8c24ca06ddffb24d1d493e.tar.gz
bcm5719-llvm-5b51816020a0daf35f8c24ca06ddffb24d1d493e.zip
[Orc] Remove the memory manager argument to addModule, and de-templatize the
symbol resolver argument. De-templatizing the symbol resolver is part of the ongoing simplification of ORC layer API. Removing the memory management argument (and delegating construction of memory managers for RTDyldObjectLinkingLayer to a functor passed in to the constructor) allows us to build JITs whose base object layers need not be compatible with RTDyldObjectLinkingLayer's memory mangement scheme. For example, a 'remote object layer' that sends fully relocatable objects directly to the remote does not need a memory management scheme at all (that will be handled by the remote). llvm-svn: 307058
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc/OrcCBindingsStack.h')
-rw-r--r--llvm/lib/ExecutionEngine/Orc/OrcCBindingsStack.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/OrcCBindingsStack.h b/llvm/lib/ExecutionEngine/Orc/OrcCBindingsStack.h
index 931d0a9eb2a..e6c950e15fb 100644
--- a/llvm/lib/ExecutionEngine/Orc/OrcCBindingsStack.h
+++ b/llvm/lib/ExecutionEngine/Orc/OrcCBindingsStack.h
@@ -105,6 +105,10 @@ public:
IndirectStubsManagerBuilder IndirectStubsMgrBuilder)
: DL(TM.createDataLayout()), IndirectStubsMgr(IndirectStubsMgrBuilder()),
CCMgr(std::move(CCMgr)),
+ ObjectLayer(
+ []() {
+ return std::make_shared<SectionMemoryManager>();
+ }),
CompileLayer(ObjectLayer, orc::SimpleCompiler(TM)),
CODLayer(CompileLayer,
[](Function &F) { return std::set<Function *>({&F}); },
@@ -155,7 +159,7 @@ public:
return mapError(IndirectStubsMgr->updatePointer(Name, Addr));
}
- std::unique_ptr<JITSymbolResolver>
+ std::shared_ptr<JITSymbolResolver>
createResolver(LLVMOrcSymbolResolverFn ExternalResolver,
void *ExternalResolverCtx) {
return orc::createLambdaResolver(
@@ -204,8 +208,7 @@ public:
auto Resolver = createResolver(ExternalResolver, ExternalResolverCtx);
// Add the module to the JIT.
- auto LH = Layer.addModule(std::move(M), std::move(MemMgr),
- std::move(Resolver));
+ auto LH = Layer.addModule(std::move(M), std::move(Resolver));
ModuleHandleT H = createHandle(Layer, LH);
// Run the static constructors, and save the static destructor runner for
OpenPOWER on IntegriCloud