summaryrefslogtreecommitdiffstats
path: root/llvm/tools/lli
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2019-05-21 22:07:53 +0000
committerLang Hames <lhames@gmail.com>2019-05-21 22:07:53 +0000
commita2ee80b084e5c0b20364ed4379384706f5e059b1 (patch)
treed26d41b94f23ae7a27a792bd6b1a756ad2043e1a /llvm/tools/lli
parentfeb9953081158b3f26c9916326a9a059acfbeae6 (diff)
downloadbcm5719-llvm-a2ee80b084e5c0b20364ed4379384706f5e059b1.tar.gz
bcm5719-llvm-a2ee80b084e5c0b20364ed4379384706f5e059b1.zip
[ORC] Guarantee unique JITDylib names in lli, add usage notes to createJITDylib.
JITDylibs should have unique names. This patch adds code to lli to respect this invariant (by refering to the exist JITDylib if a -jd <name> option is specified more than once). It also adds usage notes to the doxygen comment for createJITDylib method in ExecutionSession and LLJIT. http://llvm.org/PR41937 llvm-svn: 361322
Diffstat (limited to 'llvm/tools/lli')
-rw-r--r--llvm/tools/lli/lli.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index a44b7437f70..fb6cf6ff915 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/tools/lli/lli.cpp
@@ -821,8 +821,10 @@ int runOrcLazyJIT(const char *ProgName) {
IdxToDylib[0] = &J->getMainJITDylib();
for (auto JDItr = JITDylibs.begin(), JDEnd = JITDylibs.end();
JDItr != JDEnd; ++JDItr) {
- IdxToDylib[JITDylibs.getPosition(JDItr - JITDylibs.begin())] =
- &J->createJITDylib(*JDItr);
+ orc::JITDylib *JD = J->getJITDylibByName(*JDItr);
+ if (!JD)
+ JD = &J->createJITDylib(*JDItr);
+ IdxToDylib[JITDylibs.getPosition(JDItr - JITDylibs.begin())] = JD;
}
for (auto EMItr = ExtraModules.begin(), EMEnd = ExtraModules.end();
OpenPOWER on IntegriCloud