| 1278 | } |
| 1279 | |
| 1280 | spv_result_t ControlFlowPass(ValidationState_t& _, const Instruction* inst) { |
| 1281 | switch (inst->opcode()) { |
| 1282 | case spv::Op::OpPhi: |
| 1283 | if (auto error = ValidatePhi(_, inst)) return error; |
| 1284 | break; |
| 1285 | case spv::Op::OpBranch: |
| 1286 | if (auto error = ValidateBranch(_, inst)) return error; |
| 1287 | break; |
| 1288 | case spv::Op::OpBranchConditional: |
| 1289 | if (auto error = ValidateBranchConditional(_, inst)) return error; |
| 1290 | break; |
| 1291 | case spv::Op::OpReturnValue: |
| 1292 | if (auto error = ValidateReturnValue(_, inst)) return error; |
| 1293 | break; |
| 1294 | case spv::Op::OpSwitch: |
| 1295 | if (auto error = ValidateSwitch(_, inst)) return error; |
| 1296 | break; |
| 1297 | case spv::Op::OpLoopMerge: |
| 1298 | if (auto error = ValidateLoopMerge(_, inst)) return error; |
| 1299 | break; |
| 1300 | case spv::Op::OpLifetimeStart: |
| 1301 | case spv::Op::OpLifetimeStop: |
| 1302 | if (auto error = ValidateLifetime(_, inst)) return error; |
| 1303 | break; |
| 1304 | default: |
| 1305 | break; |
| 1306 | } |
| 1307 | |
| 1308 | return SPV_SUCCESS; |
| 1309 | } |
| 1310 | |
| 1311 | } // namespace val |
| 1312 | } // namespace spvtools |
no test coverage detected