[ORC] Update symbol lookup to use a single callback with a required symbol state
authorLang Hames <lhames@gmail.com>
Fri, 7 Jun 2019 19:33:51 +0000 (19:33 +0000)
committerLang Hames <lhames@gmail.com>
Fri, 7 Jun 2019 19:33:51 +0000 (19:33 +0000)
commitd4a8089f035a1724d2c6642c6d205b8c96b8b2e6
tree181e7616b2a82794b8ac99900536b74714aa9229
parent8cfb14fad6e67d778fbf289ed3789b6c0b7d08ad
[ORC] Update symbol lookup to use a single callback with a required symbol state
rather than two callbacks.

The asynchronous lookup API (which the synchronous lookup API wraps for
convenience) used to take two callbacks: OnResolved (called once all requested
symbols had an address assigned) and OnReady to be called once all requested
symbols were safe to access). This patch updates the asynchronous lookup API to
take a single 'OnComplete' callback and a required state (SymbolState) to
determine when the callback should be made. This simplifies the common use case
(where the client is interested in a specific state) and will generalize neatly
as new states are introduced to track runtime initialization of symbols.

Clients who were making use of both callbacks in a single query will now need to
issue two queries (one for SymbolState::Resolved and another for
SymbolState::Ready). Synchronous lookup API clients who were explicitly passing
the WaitOnReady argument will now need neeed to pass a SymbolState instead (for
'WaitOnReady == true' use SymbolState::Ready, for 'WaitOnReady == false' use
SymbolState::Resolved). Synchronous lookup API clients who were using default
arugment values should see no change.

llvm-svn: 362832
13 files changed:
llvm/include/llvm/ExecutionEngine/Orc/Core.h
llvm/include/llvm/ExecutionEngine/Orc/Legacy.h
llvm/lib/ExecutionEngine/Orc/Core.cpp
llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp
llvm/lib/ExecutionEngine/Orc/LazyReexports.cpp
llvm/lib/ExecutionEngine/Orc/Legacy.cpp
llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
llvm/lib/ExecutionEngine/Orc/OrcCBindingsStack.h
llvm/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h
llvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp
llvm/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp
llvm/unittests/ExecutionEngine/Orc/LegacyAPIInteropTest.cpp
llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp