| 408 | } |
| 409 | |
| 410 | bool Function::CheckLimitations(const ValidationState_t& _, |
| 411 | const Function* entry_point, |
| 412 | std::string* reason) const { |
| 413 | bool return_value = true; |
| 414 | std::stringstream ss_reason; |
| 415 | |
| 416 | for (const auto& is_compatible : limitations_) { |
| 417 | std::string message; |
| 418 | if (!is_compatible(_, entry_point, &message)) { |
| 419 | if (!reason) return false; |
| 420 | return_value = false; |
| 421 | if (!message.empty()) { |
| 422 | ss_reason << message << "\n"; |
| 423 | } |
| 424 | } |
| 425 | } |
| 426 | |
| 427 | if (!return_value && reason) { |
| 428 | *reason = ss_reason.str(); |
| 429 | } |
| 430 | |
| 431 | return return_value; |
| 432 | } |
| 433 | |
| 434 | } // namespace val |
| 435 | } // namespace spvtools |
no test coverage detected