| 707 | } |
| 708 | |
| 709 | spv_result_t VerifyIds(const MessageConsumer& consumer, |
| 710 | opt::IRContext* linked_context) { |
| 711 | std::unordered_set<uint32_t> ids; |
| 712 | bool ok = true; |
| 713 | linked_context->module()->ForEachInst( |
| 714 | [&ids, &ok](const opt::Instruction* inst) { |
| 715 | ok &= ids.insert(inst->unique_id()).second; |
| 716 | }); |
| 717 | |
| 718 | if (!ok) { |
| 719 | consumer(SPV_MSG_INTERNAL_ERROR, "", {}, "Non-unique id in merged module"); |
| 720 | return SPV_ERROR_INVALID_ID; |
| 721 | } |
| 722 | |
| 723 | return SPV_SUCCESS; |
| 724 | } |
| 725 | |
| 726 | spv_result_t VerifyLimits(const MessageConsumer& consumer, |
| 727 | const opt::IRContext& linked_context) { |
no test coverage detected