10 #ifndef LLVM_EXECUTIONENGINE_ORC_RPCSERIALIZATION_H
11 #define LLVM_EXECUTIONENGINE_ORC_RPCSERIALIZATION_H
30 template <
typename OStream>
31 OStream &operator<<(OStream &OS, const RPCTypeNameSequence<> &V) {
36 template <
typename OStream,
typename ArgT>
37 OStream &operator<<(OStream &OS, const RPCTypeNameSequence<ArgT> &V) {
43 template <
typename OStream,
typename ArgT1,
typename ArgT2,
typename... ArgTs>
54 static const char*
getName() {
return "void"; }
60 static const char*
getName() {
return "int8_t"; }
66 static const char*
getName() {
return "uint8_t"; }
72 static const char*
getName() {
return "int16_t"; }
78 static const char*
getName() {
return "uint16_t"; }
84 static const char*
getName() {
return "int32_t"; }
90 static const char*
getName() {
return "uint32_t"; }
96 static const char*
getName() {
return "int64_t"; }
102 static const char*
getName() {
return "uint64_t"; }
108 static const char*
getName() {
return "bool"; }
114 static const char*
getName() {
return "std::string"; }
117 template <
typename T1,
typename T2>
121 std::lock_guard<std::mutex>
Lock(NameMutex);
128 static std::mutex NameMutex;
129 static std::string
Name;
132 template <
typename T1,
typename T2>
133 std::mutex RPCTypeName<std::pair<T1, T2>>::NameMutex;
134 template <
typename T1,
typename T2>
135 std::string RPCTypeName<std::pair<T1, T2>>
::Name;
137 template <
typename... ArgTs>
141 std::lock_guard<std::mutex>
Lock(NameMutex);
148 static std::mutex NameMutex;
149 static std::string
Name;
152 template <
typename... ArgTs>
153 std::mutex RPCTypeName<std::tuple<ArgTs...>>::NameMutex;
154 template <
typename... ArgTs>
155 std::string RPCTypeName<std::tuple<ArgTs...>>
::Name;
157 template <
typename T>
161 std::lock_guard<std::mutex>
Lock(NameMutex);
169 static std::mutex NameMutex;
170 static std::string
Name;
173 template <
typename T>
174 std::mutex RPCTypeName<std::vector<T>>::NameMutex;
175 template <
typename T>
176 std::string RPCTypeName<std::vector<T>>
::Name;
211 template <
typename ChannelT,
typename WireType,
212 typename ConcreteType = WireType,
typename =
void>
215 template <
typename ChannelT>
231 template <
typename ChannelT,
typename... ArgTs>
234 template <
typename ChannelT>
241 template <
typename ChannelT,
typename ArgT>
245 template <
typename CArgT>
250 template <
typename CArgT>
256 template <
typename ChannelT,
typename ArgT,
typename... ArgTs>
260 template <
typename CArgT,
typename... CArgTs>
262 const CArgTs&... CArgs) {
271 template <
typename CArgT,
typename... CArgTs>
283 template <
typename ChannelT,
typename... ArgTs>
288 template <
typename ChannelT,
typename... ArgTs>
294 template <
typename ChannelT,
typename T1,
typename T2>
307 template <
typename ChannelT,
typename... ArgTs>
323 template <
size_t... Is>
324 static Error serializeTupleHelper(ChannelT &
C,
const std::tuple<ArgTs...> &V,
330 template <
size_t... Is>
331 static Error deserializeTupleHelper(ChannelT &C, std::tuple<ArgTs...> &V,
338 template <
typename ChannelT,
typename T>
344 if (
auto Err =
serializeSeq(C, static_cast<uint64_t>(V.size())))
347 for (
const auto &
E : V)
373 #endif // LLVM_EXECUTIONENGINE_ORC_RPCSERIALIZATION_H
static Error serialize(ChannelT &C, const CArgT &CArg)
static Error deserialize(ChannelT &C, std::vector< T > &V)
Deserialize a std::vector<T> to a std::vector<T>.
static const char * getName()
static Error serialize(ChannelT &C, const std::pair< T1, T2 > &V)
static Error serialize(ChannelT &C)
static const char * getName()
static const char * getName()
static const char * getName()
static StringRef getName(Value *V)
static const char * getName()
Alias for the common case of a sequence of size_ts.
static Error emitSeparator(ChannelT &C)
static Error deserialize(ChannelT &C, CArgT &CArg, CArgTs &...CArgs)
static const char * getName()
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
static Error deserialize(ChannelT &C)
static const char * getName()
The SerializationTraits<ChannelT, T> class describes how to serialize and deserialize an instance of ...
static Error deserialize(ChannelT &C, std::pair< T1, T2 > &V)
static const char * getName()
static const char * getName()
static Error serialize(ChannelT &C, const std::tuple< ArgTs...> &V)
RPC channel serialization for std::tuple.
OStream & operator<<(OStream &OS, const RPCTypeNameSequence<> &V)
Render an empty TypeNameSequence to an ostream.
static ErrorSuccess success()
Create a success value.
static Error serialize(ChannelT &C, const CArgT &CArg, const CArgTs &...CArgs)
static const char * getName()
Creates a compile-time integer sequence for a parameter pack.
static const char * getName()
static const char * getName()
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
static const char * getName()
Error deserializeSeq(ChannelT &C, ArgTs &...Args)
static Error serialize(ChannelT &C, const std::vector< T > &V)
Serialize a std::vector<T> from std::vector<T>.
Error serializeSeq(ChannelT &C, const ArgTs &...Args)
TypeNameSequence is a utility for rendering sequences of types to a string by rendering each type...
Utility class for serializing sequences of values of varying types.
A raw_ostream that writes to an std::string.
static Error deserialize(ChannelT &C, CArgT &CArg)
Lightweight error class with error context and mandatory checking.
static const char * getName()
static Error consumeSeparator(ChannelT &C)
static Error deserialize(ChannelT &C, std::tuple< ArgTs...> &V)
RPC channel deserialization for std::tuple.