// Copyright (c) 2015-2016 The Khronos Group Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include <unordered_set> #include <vector> #include "source/instruction.h" #include "source/opcode.h" #include "source/operand.h" #include "source/val/function.h" #include "source/val/validate.h" #include "source/val/validation_state.h" #include "spirv-tools/libspirv.h" namespace spvtools { namespace val { spv_result_t UpdateIdUse(ValidationState_t& _, const Instruction* inst) { … } /// This function checks all ID definitions dominate their use in the CFG. /// /// This function will iterate over all ID definitions that are defined in the /// functions of a module and make sure that the definitions appear in a /// block that dominates their use. /// /// NOTE: This function does NOT check module scoped functions which are /// checked during the initial binary parse in the IdPass below spv_result_t CheckIdDefinitionDominateUse(ValidationState_t& _) { … } // Performs SSA validation on the IDs of an instruction. The // can_have_forward_declared_ids functor should return true if the // instruction operand's ID can be forward referenced. spv_result_t IdPass(ValidationState_t& _, Instruction* inst) { … } } // namespace val } // namespace spvtools