[llvm] r291376 - [Orc][RPC] Add a class-method version of addHandler to MultiThreadedRPCEndpoint.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 7 16:18:51 PST 2017
Author: lhames
Date: Sat Jan 7 18:18:51 2017
New Revision: 291376
URL: http://llvm.org/viewvc/llvm-project?rev=291376&view=rev
Log:
[Orc][RPC] Add a class-method version of addHandler to MultiThreadedRPCEndpoint.
This brings MultiThreadedRPCEndpoint's addHandler API in-line with
SingleThreadedRPCEndpoint's.
This will be tested in an up-coming unit-test for MultiThreadedRPCEndpoint.
Modified:
llvm/trunk/include/llvm/ExecutionEngine/Orc/RPCUtils.h
Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/RPCUtils.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/RPCUtils.h?rev=291376&r1=291375&r2=291376&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/Orc/RPCUtils.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/Orc/RPCUtils.h Sat Jan 7 18:18:51 2017
@@ -1062,6 +1062,15 @@ public:
std::move(Launch));
}
+ /// Add a class-method as a handler.
+ template <typename Func, typename ClassT, typename RetT, typename... ArgTs>
+ void addHandler(ClassT &Object, RetT (ClassT::*Method)(ArgTs...),
+ LaunchPolicy Launch = LaunchPolicy()) {
+ addHandler<Func>(
+ detail::MemberFnWrapper<ClassT, RetT, ArgTs...>(Object, Method),
+ Launch);
+ }
+
/// Negotiate a function id for Func with the other end of the channel.
template <typename Func> Error negotiateFunction() {
using OrcRPCNegotiate = typename BaseClass::OrcRPCNegotiate;
More information about the llvm-commits
mailing list