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

Function parseProducerSection

lib/Bytecode/Reader/BytecodeReader.cpp:2332–2350  ·  view source on GitHub ↗

===----------------------------------------------------------------------===// Producer Section ===----------------------------------------------------------------------===// producer-section =: producerStringIndex[varint] // Index into the string table Parses the producer section and returns the producer string.

Source from the content-addressed store, hash-verified

2330//
2331/// Parses the producer section and returns the producer string.
2332static LogicalResult parseProducerSection(ArrayRef<uint8_t> payload,
2333 const EncodingReader &mainReader,
2334 std::optional<StringRef> &producer,
2335 MLIRContext &context) {
2336 EncodingReader sectionReader(payload, context);
2337 sectionReader.inheritStringTableFrom(mainReader);
2338
2339 uint64_t producerIndex;
2340 if (failed(sectionReader.readVarInt(producerIndex)))
2341 return sectionReader.emitError() << "failed to read producer string index";
2342
2343 StringRef producerStr;
2344 if (failed(sectionReader.getString(producerIndex, producerStr, context)))
2345 return sectionReader.emitError()
2346 << "failed to get producer string at index " << producerIndex;
2347
2348 producer = producerStr;
2349 return success();
2350}
2351
2352/// Creates a global (cuda_tile::GlobalOp) based on the parsed GlobalInfo.
2353static LogicalResult

Callers 1

readBytecodeMethod · 0.85

Calls 4

readVarIntMethod · 0.80
emitErrorMethod · 0.80
getStringMethod · 0.80

Tested by

no test coverage detected