MCPcopy Create free account
hub / github.com/NVIDIA/cuda-tile / writeVarInt

Method writeVarInt

lib/Bytecode/Writer/BytecodeWriter.cpp:73–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71 }
72
73 void writeVarInt(uint64_t value) {
74 uint8_t bytes[10]; // Supports up to 64 bits
75 size_t index = 0;
76
77 do {
78 uint8_t byte = value & 0x7F; // Lower 7 bits
79 value >>= 7;
80 if (value != 0)
81 byte |= 0x80; // Set continuation bit
82 bytes[index++] = byte;
83 } while (value != 0 && index < sizeof(bytes));
84
85 stream.write(reinterpret_cast<char *>(bytes), index);
86 }
87
88 template <typename Enum, std::enable_if_t<std::is_enum<Enum>::value, int> = 0>
89 void writeVarInt(Enum value) {

Callers 15

writeSectionHeaderFunction · 0.80
writeAPIntFunction · 0.80
writeStringSectionMethod · 0.80
writeTypeSectionMethod · 0.80
writeTypeIndexMethod · 0.80
serializeFunctionTypeMethod · 0.80
serializeAttributeMethod · 0.80
writeConstantSectionMethod · 0.80
writeDebugInfoSectionMethod · 0.80
serializeMethod · 0.80
serializeUnknownMethod · 0.80
writeOperationMethod · 0.80

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected