===----------------------------------------------------------------------===// Producer Section ===----------------------------------------------------------------------===// producer-section =: producerStringIndex[varint] // Index into the string table Parses the producer section and returns the producer string.
| 2330 | // |
| 2331 | /// Parses the producer section and returns the producer string. |
| 2332 | static 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. |
| 2353 | static LogicalResult |
no test coverage detected