| 90 | } |
| 91 | |
| 92 | spv_result_t ValidateForwardDecls(ValidationState_t& _) { |
| 93 | if (_.unresolved_forward_id_count() == 0) return SPV_SUCCESS; |
| 94 | |
| 95 | std::stringstream ss; |
| 96 | std::vector<uint32_t> ids = _.UnresolvedForwardIds(); |
| 97 | |
| 98 | std::transform( |
| 99 | std::begin(ids), std::end(ids), |
| 100 | std::ostream_iterator<std::string>(ss, " "), |
| 101 | bind(&ValidationState_t::getIdName, std::ref(_), std::placeholders::_1)); |
| 102 | |
| 103 | auto id_str = ss.str(); |
| 104 | return _.diag(SPV_ERROR_INVALID_ID, nullptr) |
| 105 | << "The following forward referenced IDs have not been defined:\n" |
| 106 | << id_str.substr(0, id_str.size() - 1); |
| 107 | } |
| 108 | |
| 109 | // Entry point validation. Based on 2.16.1 (Universal Validation Rules) of the |
| 110 | // SPIRV spec: |
no test coverage detected