function-type =: typeTag[Func] numInputs[varint] inputTypeIndices[varint*numInputs] numResults[varint] resultTypeIndices[varint*numResults]
| 556 | // numResults[varint] |
| 557 | // resultTypeIndices[varint*numResults] |
| 558 | LogicalResult parseFunctionType(EncodingReader &reader, Type &result) { |
| 559 | uint64_t numParams, numResults; |
| 560 | // Read the number of parameters (VarInt as per specification). |
| 561 | if (failed(reader.readVarInt(numParams, |
| 562 | std::numeric_limits<uint32_t>::max() - 1))) |
| 563 | return reader.emitError() << "failed to read number of parameters"; |
| 564 | |
| 565 | // Read parameter types |
| 566 | SmallVector<Type, 4> paramTypes; |
| 567 | paramTypes.reserve(numParams); |
| 568 | for (uint64_t i = 0; i < numParams; ++i) { |
| 569 | Type paramType = readAndGetType(reader); |
| 570 | if (!paramType) |
| 571 | return reader.emitError() << "failed to get parameter type"; |
| 572 | paramTypes.push_back(paramType); |
| 573 | } |
| 574 | // Read the number of results (VarInt as per specification). |
| 575 | if (failed(reader.readVarInt(numResults, |
| 576 | std::numeric_limits<uint32_t>::max() - 1))) |
| 577 | return reader.emitError() << "failed to read number of results"; |
| 578 | // Read result types |
| 579 | SmallVector<Type, 4> resultTypes; |
| 580 | resultTypes.reserve(numResults); |
| 581 | for (uint64_t i = 0; i < numResults; ++i) { |
| 582 | Type resultType = readAndGetType(reader); |
| 583 | if (!resultType) |
| 584 | return reader.emitError() << "failed to get result type"; |
| 585 | resultTypes.push_back(resultType); |
| 586 | } |
| 587 | result = FunctionType::get(&context, paramTypes, resultTypes); |
| 588 | return success(); |
| 589 | } |
| 590 | |
| 591 | LogicalResult parseTypeImpl(uint8_t typeTag, ArrayRef<uint8_t> payloadBytes, |
| 592 | Type &result) { |
nothing calls this directly
no test coverage detected