20 template <
size_t Index>
struct IndexedWriter {
23 typename std::enable_if<
25 std::tuple_size<typename std::remove_reference<Tuple>::type>::value),
27 static size_t write(support::endian::Writer &OS, Tuple &&
T) {
28 OS.write(std::get<Index>(
T));
34 typename std::enable_if<
36 std::tuple_size<typename std::remove_reference<Tuple>::type>::value),
38 static size_t write(support::endian::Writer &OS, Tuple &&) {
43 template <uint8_t
Kind,
class... Values>
44 Error writeMetadata(support::endian::Writer &OS, Values &&... Ds) {
47 uint8_t FirstByte = (
static_cast<uint8_t
>(
Kind) << 1) | uint8_t{0x01u};
48 auto T = std::make_tuple(std::forward<Values>(std::move(Ds))...);
52 assert(Bytes <= 15 &&
"Must only ever write at most 16 byte metadata!");
54 for (; Bytes < 15; ++Bytes)
76 OS.write(FreeFormBytes);
82 return writeMetadata<7u>(OS, R.
size());
90 return writeMetadata<2u>(OS, R.
cpuid(), R.
tsc());
94 return writeMetadata<3u>(OS, R.
tsc());
98 if (
auto E = writeMetadata<5u>(OS, R.
size(), R.
tsc(), R.
cpu()))
107 if (
auto E = writeMetadata<5u>(OS, R.
size(), R.
delta()))
125 return writeMetadata<6u>(OS, R.
arg());
129 return writeMetadata<9u>(OS, R.
pid());
133 return writeMetadata<0u>(OS, R.
tid());
137 return writeMetadata<1u>(OS, 0);
143 TypeRecordFuncId <<= 3;
145 TypeRecordFuncId <<= 1;
146 TypeRecordFuncId &= ~
uint32_t{0x01};
147 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...