#include <cassert>
#include <functional>
#include <iostream>
#include <map>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include "source/cfa.h"
#include "source/opcode.h"
#include "source/spirv_constant.h"
#include "source/spirv_validator_options.h"
#include "source/val/basic_block.h"
#include "source/val/construct.h"
#include "source/val/function.h"
#include "source/val/validate.h"
#include "source/val/validation_state.h"
namespace spvtools {
namespace val {
namespace {
spv_result_t ValidatePhi(ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ValidateBranch(ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ValidateBranchConditional(ValidationState_t& _,
const Instruction* inst) { … }
spv_result_t ValidateSwitch(ValidationState_t& _, const Instruction* inst) { … }
spv_result_t ValidateReturnValue(ValidationState_t& _,
const Instruction* inst) { … }
uint32_t operator>>(const spv::LoopControlShift& lhs,
const spv::LoopControlShift& rhs) { … }
spv_result_t ValidateLoopMerge(ValidationState_t& _, const Instruction* inst) { … }
}
void printDominatorList(const BasicBlock& b) { … }
#define CFG_ASSERT(ASSERT_FUNC, TARGET) …
spv_result_t FirstBlockAssert(ValidationState_t& _, uint32_t target) { … }
spv_result_t MergeBlockAssert(ValidationState_t& _, uint32_t merge_block) { … }
void UpdateContinueConstructExitBlocks(
Function& function,
const std::vector<std::pair<uint32_t, uint32_t>>& back_edges) { … }
std::tuple<std::string, std::string, std::string> ConstructNames(
ConstructType type) { … }
std::string ConstructErrorString(const Construct& construct,
const std::string& header_string,
const std::string& exit_string,
const std::string& dominate_text) { … }
spv_result_t FindCaseFallThrough(
ValidationState_t& _, BasicBlock* target_block, uint32_t* case_fall_through,
const BasicBlock* merge, const std::unordered_set<uint32_t>& case_targets,
Function* function) { … }
spv_result_t StructuredSwitchChecks(ValidationState_t& _, Function* function,
const Instruction* switch_inst,
const BasicBlock* header,
const BasicBlock* merge) { … }
spv_result_t ValidateStructuredSelections(
ValidationState_t& _, const std::vector<const BasicBlock*>& postorder) { … }
spv_result_t StructuredControlFlowChecks(
ValidationState_t& _, Function* function,
const std::vector<std::pair<uint32_t, uint32_t>>& back_edges,
const std::vector<const BasicBlock*>& postorder) { … }
spv_result_t MaximalReconvergenceChecks(ValidationState_t& _) { … }
spv_result_t PerformCfgChecks(ValidationState_t& _) { … }
spv_result_t CfgPass(ValidationState_t& _, const Instruction* inst) { … }
void ReachabilityPass(ValidationState_t& _) { … }
spv_result_t ControlFlowPass(ValidationState_t& _, const Instruction* inst) { … }
}
}