[all-commits] [llvm/llvm-project] d2fabd: [ORC] Update lazyReexports to support aliases with...

lhames via All-commits all-commits at lists.llvm.org
Wed Jan 15 08:03:22 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d2fabd70065edefacee0d8a3122c73bc15e0f848
      https://github.com/llvm/llvm-project/commit/d2fabd70065edefacee0d8a3122c73bc15e0f848
  Author: Lang Hames <lhames at gmail.com>
  Date:   2020-01-15 (Wed, 15 Jan 2020)

  Changed paths:
    M llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h
    M llvm/lib/ExecutionEngine/Orc/LazyReexports.cpp
    M llvm/unittests/ExecutionEngine/Orc/LazyCallThroughAndReexportsTest.cpp

  Log Message:
  -----------
  [ORC] Update lazyReexports to support aliases with different symbol names.

A bug in the existing implementation meant that lazyReexports would not work if
the aliased name differed from the alias's name, i.e. all lazy reexports had to
be of the form (lib1, name) -> (lib2, name). This patch fixes the issue by
capturing the alias's name in the NotifyResolved callback. To simplify this
capture, and the LazyCallThroughManager code in general, the NotifyResolved
callback is updated to use llvm::unique_function rather than a custom class.

No test case yet: This can only be tested at runtime, and the only in-tree
client (lli) always uses aliases with matching names. I will add a new LLJIT
example shortly that will directly test the lazyReexports API and the
non-trivial alias use case.


  Commit: e9e26c01cd865da678b1af6ba5f417c713956a66
      https://github.com/llvm/llvm-project/commit/e9e26c01cd865da678b1af6ba5f417c713956a66
  Author: Lang Hames <lhames at gmail.com>
  Date:   2020-01-15 (Wed, 15 Jan 2020)

  Changed paths:
    M llvm/examples/LLJITExamples/CMakeLists.txt
    A llvm/examples/LLJITExamples/LLJITWithLazyReexports/CMakeLists.txt
    A llvm/examples/LLJITExamples/LLJITWithLazyReexports/LLJITWithLazyReexports.cpp
    M llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
    M llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
    M llvm/tools/lli/lli.cpp

  Log Message:
  -----------
  [ORC] Simplify use of lazyReexports with LLJIT.

This patch makes the target triple available via the LLJIT interface, and moves
the IRTransformLayer from LLLazyJIT down into LLJIT. Together these changes make
it easier to use the lazyReexports utility with LLJIT, and to apply IR
transforms to code as it is compiled in LLJIT (rather than requiring transforms
to be applied manually before code is added). An code example is added in
llvm/examples/LLJITExamples/LLJITWithLazyReexports


Compare: https://github.com/llvm/llvm-project/compare/63b428e3861b...e9e26c01cd86


More information about the All-commits mailing list