| 482 | } |
| 483 | |
| 484 | bool IsValid(const opt::IRContext* context, |
| 485 | spv_validator_options validator_options, |
| 486 | MessageConsumer consumer) { |
| 487 | std::vector<uint32_t> binary; |
| 488 | context->module()->ToBinary(&binary, false); |
| 489 | SpirvTools tools(context->grammar().target_env()); |
| 490 | tools.SetMessageConsumer(std::move(consumer)); |
| 491 | return tools.Validate(binary.data(), binary.size(), validator_options); |
| 492 | } |
| 493 | |
| 494 | bool IsValidAndWellFormed(const opt::IRContext* ir_context, |
| 495 | spv_validator_options validator_options, |