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 &&) {
42Error writeMetadata(support::endian::Writer &
OS, Values &&... Ds) {
46 auto T = std::make_tuple(std::forward<Values>(std::move(Ds))...);
49 auto Bytes = IndexedWriter<0>::write(
OS,
T);
50 assert(Bytes <= 15 &&
"Must only ever write at most 16 byte metadata!");
52 for (; Bytes < 15; ++Bytes)
64 (
H.ConstantTSC ? 0x01 : 0x0) | (
H.NonstopTSC ? 0x02 : 0x0);
71 OS.write(
H.CycleFrequency);
74 OS.write(FreeFormBytes);
80 return writeMetadata<7u>(
OS, R.size());
84 return writeMetadata<4u>(
OS, R.seconds(), R.nanos());
88 return writeMetadata<2u>(
OS, R.cpuid(), R.tsc());
92 return writeMetadata<3u>(
OS, R.tsc());
96 if (
auto E = writeMetadata<5u>(
OS, R.size(), R.tsc(), R.cpu()))
105 if (
auto E = writeMetadata<5u>(
OS, R.size(), R.delta()))
114 if (
auto E = writeMetadata<8u>(
OS, R.size(), R.delta(), R.eventType()))
123 return writeMetadata<6u>(
OS, R.arg());
127 return writeMetadata<9u>(
OS, R.pid());
131 return writeMetadata<0u>(
OS, R.tid());
135 return writeMetadata<1u>(
OS, 0);
141 TypeRecordFuncId <<= 3;
142 TypeRecordFuncId |=
static_cast<uint32_t>(R.recordType());
143 TypeRecordFuncId <<= 1;
145 OS.write(TypeRecordFuncId);
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Given that RA is a live value
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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.
Error visit(BufferExtents &) override
FDRTraceWriter(raw_ostream &O, const XRayFileHeader &H)
This is an optimization pass for GlobalISel generic memory operations.
Error write(MCStreamer &Out, ArrayRef< std::string > Inputs, OnCuIndexOverflow OverflowOptValue)