diff options
| author | Reid Kleckner <rnk@google.com> | 2018-10-23 20:54:43 +0000 |
|---|---|---|
| committer | Reid Kleckner <rnk@google.com> | 2018-10-23 20:54:43 +0000 |
| commit | db367e952e8198706ab73ffc5f7bd7ba3e8164c8 (patch) | |
| tree | 977f058f782de3ca35000f6a9483299003436adc /llvm/tools/lli/lli.cpp | |
| parent | 841796decdcc7818736a7f7ba28fc636a6a497d2 (diff) | |
| download | bcm5719-llvm-db367e952e8198706ab73ffc5f7bd7ba3e8164c8.tar.gz bcm5719-llvm-db367e952e8198706ab73ffc5f7bd7ba3e8164c8.zip | |
Revert r345077 "[ORC] Change how non-exported symbols are matched during lookup."
Doesn't build on Windows. The call to 'lookup' is ambiguous. Clang and
MSVC agree, anyway.
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/787
C:\b\slave\clang-x64-windows-msvc\build\llvm.src\unittests\ExecutionEngine\Orc\CoreAPIsTest.cpp(315): error C2668: 'llvm::orc::ExecutionSession::lookup': ambiguous call to overloaded function
C:\b\slave\clang-x64-windows-msvc\build\llvm.src\include\llvm/ExecutionEngine/Orc/Core.h(823): note: could be 'llvm::Expected<llvm::JITEvaluatedSymbol> llvm::orc::ExecutionSession::lookup(llvm::ArrayRef<llvm::orc::JITDylib *>,llvm::orc::SymbolStringPtr)'
C:\b\slave\clang-x64-windows-msvc\build\llvm.src\include\llvm/ExecutionEngine/Orc/Core.h(817): note: or 'llvm::Expected<llvm::JITEvaluatedSymbol> llvm::orc::ExecutionSession::lookup(const llvm::orc::JITDylibSearchList &,llvm::orc::SymbolStringPtr)'
C:\b\slave\clang-x64-windows-msvc\build\llvm.src\unittests\ExecutionEngine\Orc\CoreAPIsTest.cpp(315): note: while trying to match the argument list '(initializer list, llvm::orc::SymbolStringPtr)'
llvm-svn: 345078
Diffstat (limited to 'llvm/tools/lli/lli.cpp')
| -rw-r--r-- | llvm/tools/lli/lli.cpp | 46 |
1 files changed, 7 insertions, 39 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp index c3c57e2cdee..f4585dc080d 100644 --- a/llvm/tools/lli/lli.cpp +++ b/llvm/tools/lli/lli.cpp @@ -115,11 +115,6 @@ namespace { "rather than individual functions"), cl::init(false)); - cl::list<std::string> - JITDylibs("jd", - cl::desc("Specifies the JITDylib to be used for any subsequent " - "-extra-module arguments.")); - // The MCJIT supports building for a target address space separate from // the JIT compilation process. Use a forked process and a copying // memory manager with IPC to execute using this functionality. @@ -754,8 +749,6 @@ static orc::IRTransformLayer::TransformFunction createDebugDumper() { llvm_unreachable("Unknown DumpKind"); } -static void exitOnLazyCallThroughFailure() { exit(1); } - int runOrcLazyJIT(const char *ProgName) { // Start setting up the JIT environment. @@ -785,11 +778,7 @@ int runOrcLazyJIT(const char *ProgName) { : None); DataLayout DL = ExitOnErr(JTMB.getDefaultDataLayoutForTarget()); - - auto J = ExitOnErr(orc::LLLazyJIT::Create( - std::move(JTMB), DL, - pointerToJITTargetAddress(exitOnLazyCallThroughFailure), - LazyJITCompileThreads)); + auto J = ExitOnErr(orc::LLLazyJIT::Create(std::move(JTMB), DL, LazyJITCompileThreads)); if (PerModuleLazy) J->setPartitionFunction(orc::CompileOnDemandLayer::compileWholeModule); @@ -814,32 +803,13 @@ int runOrcLazyJIT(const char *ProgName) { // Add the main module. ExitOnErr(J->addLazyIRModule(std::move(MainModule))); - // Create JITDylibs and add any extra modules. - { - // Create JITDylibs, keep a map from argument index to dylib. We will use - // -extra-module argument indexes to determine what dylib to use for each - // -extra-module. - std::map<unsigned, orc::JITDylib *> IdxToDylib; - IdxToDylib[0] = &J->getMainJITDylib(); - for (auto JDItr = JITDylibs.begin(), JDEnd = JITDylibs.end(); - JDItr != JDEnd; ++JDItr) { - IdxToDylib[JITDylibs.getPosition(JDItr - JITDylibs.begin())] = - &J->createJITDylib(*JDItr); - } + // Add any extra modules. + for (auto &ModulePath : ExtraModules) { + auto M = parseIRFile(ModulePath, Err, *TSCtx.getContext()); + if (!M) + reportError(Err, ProgName); - for (auto EMItr = ExtraModules.begin(), EMEnd = ExtraModules.end(); - EMItr != EMEnd; ++EMItr) { - auto M = parseIRFile(*EMItr, Err, *TSCtx.getContext()); - if (!M) - reportError(Err, ProgName); - - auto EMIdx = ExtraModules.getPosition(EMItr - ExtraModules.begin()); - assert(EMIdx != 0 && "ExtraModule should have index > 0"); - auto JDItr = std::prev(IdxToDylib.lower_bound(EMIdx)); - auto &JD = *JDItr->second; - ExitOnErr( - J->addLazyIRModule(JD, orc::ThreadSafeModule(std::move(M), TSCtx))); - } + ExitOnErr(J->addLazyIRModule(orc::ThreadSafeModule(std::move(M), TSCtx))); } // Add the objects. @@ -867,8 +837,6 @@ int runOrcLazyJIT(const char *ProgName) { AltEntryThreads.push_back(std::thread([EntryPoint]() { EntryPoint(); })); } - J->getExecutionSession().dump(llvm::dbgs()); - // Run main. auto MainSym = ExitOnErr(J->lookup("main")); typedef int (*MainFnPtr)(int, const char *[]); |

