21 template <
size_t Index>
struct IndexedWriter {
24 typename std::enable_if<
26 std::tuple_size<typename std::remove_reference<Tuple>::type>::value),
28 static size_t write(support::endian::Writer &OS, Tuple &&
T) {
29 OS.write(std::get<Index>(
T));
35 typename std::enable_if<
37 std::tuple_size<typename std::remove_reference<Tuple>::type>::value),
39 static size_t write(support::endian::Writer &OS, Tuple &&) {
44 template <uint8_t
Kind,
class... Values>
45 Error writeMetadata(support::endian::Writer &OS, Values &&... Ds) {
48 uint8_t FirstByte = (
static_cast<uint8_t
>(
Kind) << 1) | uint8_t{0x01u};
49 auto T = std::make_tuple(std::forward<Values>(std::move(Ds))...);
53 assert(Bytes <= 15 &&
"Must only ever write at most 16 byte metadata!");
55 for (; Bytes < 15; ++Bytes)
77 OS.write(FreeFormBytes);
83 return writeMetadata<7u>(OS, R.
size());
91 return writeMetadata<2u>(OS, R.
cpuid(), R.
tsc());
95 return writeMetadata<3u>(OS, R.
tsc());
99 if (
auto E = writeMetadata<5u>(OS, R.
size(), R.
tsc(), R.
cpu()))
108 if (
auto E = writeMetadata<5u>(OS, R.
size(), R.
delta()))
126 return writeMetadata<6u>(OS, R.
arg());
130 return writeMetadata<9u>(OS, R.
pid());
134 return writeMetadata<0u>(OS, R.
tid());
138 return writeMetadata<1u>(OS, 0);
144 TypeRecordFuncId <<= 3;
146 TypeRecordFuncId <<= 1;
147 TypeRecordFuncId &= ~
uint32_t{0x01};
148 OS.write(TypeRecordFuncId);
int32_t functionId() const
This class represents lattice values for constants.
RecordTypes recordType() const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Error visit(BufferExtents &) override
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
uint16_t eventType() const
static void write(bool isBE, void *P, T V)
static ErrorSuccess success()
Create a success value.
FDRTraceWriter(raw_ostream &O, const XRayFileHeader &H)
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Lightweight error class with error context and mandatory checking.
This class implements an extremely fast bulk output stream that can only output to a stream...