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

Function writeHeader

lib/Bytecode/Writer/BytecodeWriter.cpp:172–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170//===----------------------------------------------------------------------===//
171
172static LogicalResult writeHeader(raw_ostream &stream, Operation *op,
173 const BytecodeWriterConfig &config) {
174 // Validate the bytecode version.
175 if (config.bytecodeVersion < BytecodeVersion::kMinSupportedVersion) {
176 return op->emitError() << "unsupported version requested "
177 << config.bytecodeVersion.toString()
178 << ", must be in range ["
179 << BytecodeVersion::kMinSupportedVersion.toString()
180 << ", "
181 << BytecodeVersion::kCurrentVersion.toString()
182 << ']';
183 }
184
185 EncodingWriter writer(stream);
186 const char magicNumber[8] = {0x7F, 'T', 'i', 'l', 'e', 'I', 'R', 0x00};
187 writer.write(magicNumber, sizeof(magicNumber));
188 writer.writeLE(config.bytecodeVersion.getMajor());
189 writer.writeLE(config.bytecodeVersion.getMinor());
190 writer.writeLE(config.bytecodeVersion.getTag());
191
192 return success();
193}
194
195//===----------------------------------------------------------------------===//
196// Section Header Writer

Callers 1

writeBytecodeMethod · 0.85

Calls 7

emitErrorMethod · 0.80
writeMethod · 0.80
writeLEMethod · 0.80
getMajorMethod · 0.80
getMinorMethod · 0.80
getTagMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected