summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/lli/lli.cpp12
-rw-r--r--llvm/tools/llvm-jitlink/llvm-jitlink.cpp2
2 files changed, 12 insertions, 2 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index fc76a6c5ad2..84b0f6c08c9 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/tools/lli/lli.cpp
@@ -792,7 +792,7 @@ int runOrcLazyJIT(const char *ProgName) {
});
return TSM;
});
- J->getMainJITDylib().setGenerator(
+ J->getMainJITDylib().addGenerator(
ExitOnErr(orc::DynamicLibrarySearchGenerator::GetForCurrentProcess(
J->getDataLayout().getGlobalPrefix())));
@@ -832,6 +832,16 @@ int runOrcLazyJIT(const char *ProgName) {
ExitOnErr(
J->addLazyIRModule(JD, orc::ThreadSafeModule(std::move(M), TSCtx)));
}
+
+ for (auto EAItr = ExtraArchives.begin(), EAEnd = ExtraArchives.end();
+ EAItr != EAEnd; ++EAItr) {
+ auto EAIdx = ExtraArchives.getPosition(EAItr - ExtraArchives.begin());
+ assert(EAIdx != 0 && "ExtraArchive should have index > 0");
+ auto JDItr = std::prev(IdxToDylib.lower_bound(EAIdx));
+ auto &JD = *JDItr->second;
+ JD.addGenerator(ExitOnErr(orc::StaticLibraryDefinitionGenerator::Load(
+ J->getObjLinkingLayer(), EAItr->c_str())));
+ }
}
// Add the objects.
diff --git a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
index eff2ec18bc5..79c185a926e 100644
--- a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
+++ b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
@@ -380,7 +380,7 @@ Error loadProcessSymbols(Session &S) {
auto FilterMainEntryPoint = [InternedEntryPointName](SymbolStringPtr Name) {
return Name != InternedEntryPointName;
};
- S.ES.getMainJITDylib().setGenerator(
+ S.ES.getMainJITDylib().addGenerator(
ExitOnErr(orc::DynamicLibrarySearchGenerator::GetForCurrentProcess(
GlobalPrefix, FilterMainEntryPoint)));
OpenPOWER on IntegriCloud