diff options
Diffstat (limited to 'llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp')
| -rw-r--r-- | llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp | 104 |
1 files changed, 51 insertions, 53 deletions
diff --git a/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp b/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp index 734511b..1ad13e8 100644 --- a/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp +++ b/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/ExecutionEngine/Orc/RPC/RPCUtils.h" +#include "llvm/ExecutionEngine/Orc/Shared/RPCUtils.h" #include "QueueChannel.h" #include "gtest/gtest.h" @@ -14,19 +14,18 @@ using namespace llvm; using namespace llvm::orc; -using namespace llvm::orc::rpc; +using namespace llvm::orc::shared; class RPCFoo {}; namespace llvm { namespace orc { -namespace rpc { +namespace shared { - template <> - class RPCTypeName<RPCFoo> { - public: - static const char* getName() { return "RPCFoo"; } - }; +template <> class SerializationTypeName<RPCFoo> { +public: + static const char *getName() { return "RPCFoo"; } +}; template <> class SerializationTraits<QueueChannel, RPCFoo, RPCFoo> { @@ -40,7 +39,7 @@ namespace rpc { } }; -} // end namespace rpc + } // namespace shared } // end namespace orc } // end namespace llvm @@ -96,65 +95,64 @@ void registerDummyErrorSerialization() { namespace llvm { namespace orc { -namespace rpc { +namespace shared { - template <> - class SerializationTraits<QueueChannel, RPCFoo, RPCBar> { - public: - static Error serialize(QueueChannel&, const RPCBar&) { - return Error::success(); - } +template <> class SerializationTraits<QueueChannel, RPCFoo, RPCBar> { +public: + static Error serialize(QueueChannel &, const RPCBar &) { + return Error::success(); + } - static Error deserialize(QueueChannel&, RPCBar&) { - return Error::success(); - } + static Error deserialize(QueueChannel &, RPCBar &) { + return Error::success(); + } }; -} // end namespace rpc +} // end namespace shared } // end namespace orc } // end namespace llvm namespace DummyRPCAPI { - class VoidBool : public Function<VoidBool, void(bool)> { - public: - static const char* getName() { return "VoidBool"; } - }; - - class IntInt : public Function<IntInt, int32_t(int32_t)> { - public: - static const char* getName() { return "IntInt"; } - }; +class VoidBool : public RPCFunction<VoidBool, void(bool)> { +public: + static const char *getName() { return "VoidBool"; } +}; - class VoidString : public Function<VoidString, void(std::string)> { - public: - static const char* getName() { return "VoidString"; } - }; +class IntInt : public RPCFunction<IntInt, int32_t(int32_t)> { +public: + static const char *getName() { return "IntInt"; } +}; - class AllTheTypes - : public Function<AllTheTypes, void(int8_t, uint8_t, int16_t, uint16_t, - int32_t, uint32_t, int64_t, uint64_t, - bool, std::string, std::vector<int>, - std::set<int>, std::map<int, bool>)> { - public: - static const char* getName() { return "AllTheTypes"; } - }; +class VoidString : public RPCFunction<VoidString, void(std::string)> { +public: + static const char *getName() { return "VoidString"; } +}; - class CustomType : public Function<CustomType, RPCFoo(RPCFoo)> { - public: - static const char* getName() { return "CustomType"; } - }; +class AllTheTypes + : public RPCFunction<AllTheTypes, + void(int8_t, uint8_t, int16_t, uint16_t, int32_t, + uint32_t, int64_t, uint64_t, bool, std::string, + std::vector<int>, std::set<int>, + std::map<int, bool>)> { +public: + static const char *getName() { return "AllTheTypes"; } +}; - class ErrorFunc : public Function<ErrorFunc, Error()> { - public: - static const char* getName() { return "ErrorFunc"; } - }; +class CustomType : public RPCFunction<CustomType, RPCFoo(RPCFoo)> { +public: + static const char *getName() { return "CustomType"; } +}; - class ExpectedFunc : public Function<ExpectedFunc, Expected<uint32_t>()> { - public: - static const char* getName() { return "ExpectedFunc"; } - }; +class ErrorFunc : public RPCFunction<ErrorFunc, Error()> { +public: + static const char *getName() { return "ErrorFunc"; } +}; +class ExpectedFunc : public RPCFunction<ExpectedFunc, Expected<uint32_t>()> { +public: + static const char *getName() { return "ExpectedFunc"; } +}; } class DummyRPCEndpoint : public SingleThreadedRPCEndpoint<QueueChannel> { |
