20template <
size_t Index>
struct IndexedWriter {
23 std::enable_if_t<(
Index <
24 std::tuple_size<std::remove_reference_t<Tuple>>::value),
26 static size_t write(support::endian::Writer &OS, Tuple &&
T) {
27 OS.
write(std::get<Index>(
T));
28 return sizeof(std::get<Index>(
T)) + IndexedWriter<Index + 1>::write(OS,
T);
33 std::enable_if_t<(
Index >=
34 std::tuple_size<std::remove_reference_t<Tuple>>::value),
36 static size_t write(support::endian::Writer &OS, Tuple &&) {
42template <
uint8_t Kind,
class... Values>
47 auto T = std::make_tuple(std::forward<Values>(std::move(Ds))...);
50 auto Bytes = IndexedWriter<0>::write(OS,
T);
51 assert(Bytes <= 15 &&
"Must only ever write at most 16 byte metadata!");
53 for (; Bytes < 15; ++Bytes)
63 (
H.ConstantTSC ? 0x01 : 0x0) | (
H.NonstopTSC ? 0x02 : 0x0);
70 OS.write(
H.CycleFrequency);
73 OS.write(FreeFormBytes);
140 TypeRecordFuncId <<= 3;
141 TypeRecordFuncId |=
static_cast<uint32_t>(R.recordType());
142 TypeRecordFuncId <<= 1;
144 OS.write(TypeRecordFuncId);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static Error writeMetadata(support::endian::Writer &OS, Values &&...Ds)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
This class implements an extremely fast bulk output stream that can only output to a stream.
FDRTraceWriter(raw_ostream &O, const XRayFileHeader &H)
Error visit(BufferExtents &) override
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI Error write(MCStreamer &Out, ArrayRef< std::string > Inputs, OnCuIndexOverflow OverflowOptValue)
Adapter to write values to a stream in a particular byte order.
void write(ArrayRef< value_type > Val)