[ORC-RT] Add WrapperFunctionResult, Simple Packed Serialization (SPS) system.
authorLang Hames <lhames@gmail.com>
Mon, 31 May 2021 22:50:26 +0000 (15:50 -0700)
committerLang Hames <lhames@gmail.com>
Tue, 1 Jun 2021 18:24:19 +0000 (11:24 -0700)
commitda5924132771576bcb0d46aeb63777b42b898265
tree1ea0e6a82e842198c47c3ddc8930785765e23c3c
parent28c3e9c0d150591105511d4aa8064e9366da0df7
[ORC-RT] Add WrapperFunctionResult, Simple Packed Serialization (SPS) system.

WrapperFunctionResult is a C++ wrapper for __orc_rt_CWrapperFunctionResult
that automatically manages the underlying struct.

The Simple Packed Serialization (SPS) utilities support a simple serialization
scheme for wrapper function argument and result buffers:

Primitive typess (bool, char, int8_t, and uint8_t, int16_t, uint16_t, int32_t,
uint32_t, int64_t, uint64_t) are serialized in little-endian form.

SPSTuples are serialized by serializing each of the tuple members in order
without padding.

SPSSequences are serialized by serializing a sequence length (as a uint64_t)
followed by each of the elements of the sequence in order without padding.

Serialization/deserialization always involves a pair of SPS type tag (a tag
representing the serialized format to use, e.g. uint32_t, or
SPSTuple<bool, SPSString>) and a concrete type to be serialized from or
deserialized to (uint32_t, std::pair<bool, std::string>). Serialization for new
types can be implemented by specializing the SPSSerializationTraits type.
compiler-rt/lib/orc/CMakeLists.txt
compiler-rt/lib/orc/unittests/CMakeLists.txt
compiler-rt/lib/orc/unittests/wrapper_function_utils_test.cpp [new file with mode: 0644]
compiler-rt/lib/orc/wrapper_function_utils.h [new file with mode: 0644]