[Orc][RPC] Add a HandlerTratis specialization for free functions.

llvm-svn: 294392
This commit is contained in:
Lang Hames 2017-02-08 00:13:51 +00:00
parent f7fe49c66d
commit efecfcc24b
2 changed files with 14 additions and 0 deletions

View File

@ -417,6 +417,11 @@ private:
}
};
// Handler traits for free functions.
template <typename RetT, typename... ArgTs>
class HandlerTraits<RetT(*)(ArgTs...)>
: public HandlerTraits<RetT(ArgTs...)> {};
// Handler traits for class methods (especially call operators for lambdas).
template <typename Class, typename RetT, typename... ArgTs>
class HandlerTraits<RetT (Class::*)(ArgTs...)>

View File

@ -145,6 +145,15 @@ private:
};
void freeVoidBool(bool B) {
};
TEST(DummyRPC, TestFreeFunctionHandler) {
Queue Q1, Q2;
DummyRPCEndpoint Server(Q2, Q1);
Server.addHandler<DummyRPCAPI::VoidBool>(freeVoidBool);
};
TEST(DummyRPC, TestAsyncVoidBool) {
Queue Q1, Q2;
DummyRPCEndpoint Client(Q1, Q2);