Skip to content

Commit 1b622a4

Browse files
committed
[ORC] Make callWrapperAsync forwards explicit in ExecutionSession. NFCI.
This change is intended to make the overloads of callWrapperAsync clearer for clients that only look at the ExecutionSession API. Previously we forwarded calls to the three callWrapperAsync overloads in ExecutorProcessControl using one variadic template, but this obscures the API for clients who only look at ExecutionSession.
1 parent 531c485 commit 1b622a4

File tree

1 file changed

+24
-6
lines changed
  • llvm/include/llvm/ExecutionEngine/Orc

1 file changed

+24
-6
lines changed

llvm/include/llvm/ExecutionEngine/Orc/Core.h

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,18 +1580,36 @@ class ExecutionSession {
15801580
return EPC->getBootstrapSymbols(Pairs);
15811581
}
15821582

1583-
/// Run a wrapper function in the executor.
1583+
/// Run a wrapper function in the executor. The given WFRHandler will be
1584+
/// called on the result when it is returned.
15841585
///
15851586
/// The wrapper function should be callable as:
15861587
///
15871588
/// \code{.cpp}
15881589
/// CWrapperFunctionResult fn(uint8_t *Data, uint64_t Size);
15891590
/// \endcode{.cpp}
1590-
///
1591-
/// The given OnComplete function will be called to return the result.
1592-
template <typename... ArgTs>
1593-
void callWrapperAsync(ArgTs &&... Args) {
1594-
EPC->callWrapperAsync(std::forward<ArgTs>(Args)...);
1591+
void callWrapperAsync(ExecutorAddr WrapperFnAddr,
1592+
ExecutorProcessControl::IncomingWFRHandler OnComplete,
1593+
ArrayRef<char> ArgBuffer) {
1594+
EPC->callWrapperAsync(WrapperFnAddr, std::move(OnComplete), ArgBuffer);
1595+
}
1596+
1597+
/// Run a wrapper function in the executor using the given Runner to dispatch
1598+
/// OnComplete when the result is ready.
1599+
template <typename RunPolicyT, typename FnT>
1600+
void callWrapperAsync(RunPolicyT &&Runner, ExecutorAddr WrapperFnAddr,
1601+
FnT &&OnComplete, ArrayRef<char> ArgBuffer) {
1602+
EPC->callWrapperAsync(std::forward<RunPolicyT>(Runner), WrapperFnAddr,
1603+
std::forward<FnT>(OnComplete), ArgBuffer);
1604+
}
1605+
1606+
/// Run a wrapper function in the executor. OnComplete will be dispatched
1607+
/// as a GenericNamedTask using this instance's TaskDispatch object.
1608+
template <typename FnT>
1609+
void callWrapperAsync(ExecutorAddr WrapperFnAddr, FnT &&OnComplete,
1610+
ArrayRef<char> ArgBuffer) {
1611+
EPC->callWrapperAsync(WrapperFnAddr, std::forward<FnT>(OnComplete),
1612+
ArgBuffer);
15951613
}
15961614

15971615
/// Run a wrapper function in the executor. The wrapper function should be

0 commit comments

Comments
 (0)