Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/val/construct.cpp')
-rw-r--r--source/val/construct.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/source/val/construct.cpp b/source/val/construct.cpp
index 52e61d555..1b6a54f89 100644
--- a/source/val/construct.cpp
+++ b/source/val/construct.cpp
@@ -164,8 +164,8 @@ bool Construct::IsStructuredExit(ValidationState_t& _, BasicBlock* dest) const {
// ii. The immediate dominator of |block|.
auto NextBlock = [](const BasicBlock* block) -> const BasicBlock* {
for (auto& use : block->label()->uses()) {
- if ((use.first->opcode() == SpvOpLoopMerge ||
- use.first->opcode() == SpvOpSelectionMerge) &&
+ if ((use.first->opcode() == spv::Op::OpLoopMerge ||
+ use.first->opcode() == spv::Op::OpSelectionMerge) &&
use.second == 1 &&
use.first->block()->structurally_dominates(*block)) {
return use.first->block();
@@ -181,10 +181,10 @@ bool Construct::IsStructuredExit(ValidationState_t& _, BasicBlock* dest) const {
auto terminator = block->terminator();
auto index = terminator - &_.ordered_instructions()[0];
auto merge_inst = &_.ordered_instructions()[index - 1];
- if (merge_inst->opcode() == SpvOpLoopMerge ||
- (header->terminator()->opcode() != SpvOpSwitch &&
- merge_inst->opcode() == SpvOpSelectionMerge &&
- terminator->opcode() == SpvOpSwitch)) {
+ if (merge_inst->opcode() == spv::Op::OpLoopMerge ||
+ (header->terminator()->opcode() != spv::Op::OpSwitch &&
+ merge_inst->opcode() == spv::Op::OpSelectionMerge &&
+ terminator->opcode() == spv::Op::OpSwitch)) {
auto merge_target = merge_inst->GetOperandAs<uint32_t>(0u);
auto merge_block = merge_inst->function()->GetBlock(merge_target).first;
if (merge_block->structurally_dominates(*header)) {
@@ -192,22 +192,22 @@ bool Construct::IsStructuredExit(ValidationState_t& _, BasicBlock* dest) const {
continue;
}
- if ((!seen_switch || merge_inst->opcode() == SpvOpLoopMerge) &&
+ if ((!seen_switch || merge_inst->opcode() == spv::Op::OpLoopMerge) &&
dest->id() == merge_target) {
return true;
- } else if (merge_inst->opcode() == SpvOpLoopMerge) {
+ } else if (merge_inst->opcode() == spv::Op::OpLoopMerge) {
auto continue_target = merge_inst->GetOperandAs<uint32_t>(1u);
if (dest->id() == continue_target) {
return true;
}
}
- if (terminator->opcode() == SpvOpSwitch) {
+ if (terminator->opcode() == spv::Op::OpSwitch) {
seen_switch = true;
}
// Hit an enclosing loop and didn't break or continue.
- if (merge_inst->opcode() == SpvOpLoopMerge) return false;
+ if (merge_inst->opcode() == spv::Op::OpLoopMerge) return false;
}
block = NextBlock(block);