| 181 | } |
| 182 | |
| 183 | std::pair<std::string, std::string> |
| 184 | mlir::tblgen::extractVersionFromResult(unsigned resultIndex, |
| 185 | const Operator &op) { |
| 186 | assert(resultIndex < static_cast<unsigned>(op.getNumResults()) && |
| 187 | "TableGen backend bug: result index out of bounds"); |
| 188 | |
| 189 | // Look for version metadata in result decorators. |
| 190 | for (const auto &decorator : op.getResultDecorators(resultIndex)) { |
| 191 | if (!decorator.getDef().isSubClassOf("CudaTileArgMetadata")) |
| 192 | continue; |
| 193 | |
| 194 | const std::string version = |
| 195 | decorator.getDef().getValueAsString("sinceVersion").str(); |
| 196 | return parseVersion(version); |
| 197 | } |
| 198 | |
| 199 | // Result missing required metadata. |
| 200 | const auto &result = op.getResult(resultIndex); |
| 201 | PrintFatalError(op.getLoc(), |
| 202 | "result '" + result.name.str() + "' in operation '" + |
| 203 | op.getOperationName() + |
| 204 | "' is missing version metadata (CudaTileArgMetadata)"); |
| 205 | } |
nothing calls this directly
no test coverage detected