summaryrefslogtreecommitdiffstats
path: root/llvm/tools/lli/OrcLazyJIT.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/lli/OrcLazyJIT.cpp')
-rw-r--r--llvm/tools/lli/OrcLazyJIT.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/tools/lli/OrcLazyJIT.cpp b/llvm/tools/lli/OrcLazyJIT.cpp
index 552f5791a10..a36d5731599 100644
--- a/llvm/tools/lli/OrcLazyJIT.cpp
+++ b/llvm/tools/lli/OrcLazyJIT.cpp
@@ -105,7 +105,8 @@ static PtrTy fromTargetAddress(JITTargetAddress Addr) {
return reinterpret_cast<PtrTy>(static_cast<uintptr_t>(Addr));
}
-int llvm::runOrcLazyJIT(std::unique_ptr<Module> M, int ArgC, char* ArgV[]) {
+int llvm::runOrcLazyJIT(std::vector<std::unique_ptr<Module>> Ms, int ArgC,
+ char* ArgV[]) {
// Add the program's symbols into the JIT's search space.
if (sys::DynamicLibrary::LoadLibraryPermanently(nullptr)) {
errs() << "Error loading program symbols.\n";
@@ -143,8 +144,9 @@ int llvm::runOrcLazyJIT(std::unique_ptr<Module> M, int ArgC, char* ArgV[]) {
OrcInlineStubs);
// Add the module, look up main and run it.
- auto MainHandle = J.addModule(std::move(M));
- auto MainSym = J.findSymbolIn(MainHandle, "main");
+ for (auto &M : Ms)
+ J.addModule(std::move(M));
+ auto MainSym = J.findSymbol("main");
if (!MainSym) {
errs() << "Could not find main function.\n";
OpenPOWER on IntegriCloud