[PATCH] D51497: [WIP][ORC][ThinLTO] Early ThinLTO-JIT prototype and basic tests for next-gen ORC APIs

Lang Hames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 30 12:30:57 PDT 2018


lhames added inline comments.


================
Comment at: lib/ExecutionEngine/Orc/LLThinLTOJIT.cpp:154
+    if (AddedModule && RelatedModuleInfo.Dylib != DefiningModuleInfo.Dylib) {
+      DefiningModuleInfo.Dylib->addToSearchOrder(*RelatedModuleInfo.Dylib);
+    }
----------------
sgraenitz wrote:
> It's not currently possible to obtain the SearchOrder to check for existing entries. That's on purpose?
There is no getSearchOrder() method as that would not be thread safe. You can use withSearchOrderDo:

  auto &NewJD = // Get dylib to add to search order.
  JD.withSearchOrderDo(
    [&](const JITDylibList &SearchOrder) {
      // Search to see if NewJD is already in the search order, bail out if it is.
      for (auto *E : SearchOrder)
        if (E == &NewJD)
          return;
      // NewJD was not in the search order. Add it.
      addToSearchOrder(NewJD);
    });

If this add-without-duplication operation turns out to be common we could add a DiscardDuplicates argument to addToSearchOrder and use that instead. 


Repository:
  rL LLVM

https://reviews.llvm.org/D51497





More information about the llvm-commits mailing list