MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / ValidateForwardDecls

Function ValidateForwardDecls

source/val/validate.cpp:92–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92spv_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:

Calls 5

UnresolvedForwardIdsMethod · 0.80
diagMethod · 0.80
strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected