[ORC] Add a "lazy call-through" utility based on the same underlying trampoline
authorLang Hames <lhames@gmail.com>
Wed, 26 Sep 2018 04:18:30 +0000 (04:18 +0000)
committerLang Hames <lhames@gmail.com>
Wed, 26 Sep 2018 04:18:30 +0000 (04:18 +0000)
commitc1275e72cb47b7a9ef5a6a2ffe1961f3e0025528
treeee4cec8e7dd8a4ce68e2948d094aaf23a6a4ebbb
parentea0b7bb548befa8539ce3a9b02584fa001fd89f3
[ORC] Add a "lazy call-through" utility based on the same underlying trampoline
implementation as lazy compile callbacks, and a "lazy re-exports" utility that
builds lazy call-throughs.

Lazy call-throughs are similar to lazy compile callbacks (and are based on the
same underlying state saving/restoring trampolines) but resolve their targets
by performing a standard ORC lookup rather than invoking a user supplied
compiler callback. This allows them to inherit the thread-safety of ORC lookups
while blocking only the calling thread (whereas compile callbacks also block one
compile thread).

Lazy re-exports provide a simple way of building lazy call-throughs. Unlike a
regular re-export, a lazy re-export generates a new address (a stub entry point)
that will act like the re-exported symbol when called. The first call via a
lazy re-export will trigger compilation of the re-exported symbol before calling
through to it.

llvm-svn: 343061
llvm/include/llvm/ExecutionEngine/Orc/LazyReexports.h [new file with mode: 0644]
llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
llvm/lib/ExecutionEngine/Orc/LazyReexports.cpp [new file with mode: 0644]
llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt
llvm/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp
llvm/unittests/ExecutionEngine/Orc/LazyCallThroughAndReexportsTest.cpp [new file with mode: 0644]
llvm/unittests/ExecutionEngine/Orc/OrcTestCommon.h