| 473 | } |
| 474 | |
| 475 | void GcnCompiler::emitControlFlowEndLoop(const GcnToken& token) |
| 476 | { |
| 477 | if (m_controlFlowStack.size() == 0 || |
| 478 | m_controlFlowStack.back().type != GcnCfgBlockType::Loop) |
| 479 | { |
| 480 | Logger::exception("GcnCompiler: 'EndLoop' without 'Loop' found"); |
| 481 | } |
| 482 | |
| 483 | // Remove the block from the stack, it's closed |
| 484 | const GcnCfgBlock block = m_controlFlowStack.back(); |
| 485 | m_controlFlowStack.pop_back(); |
| 486 | |
| 487 | if (needBreakLoop(token)) |
| 488 | { |
| 489 | m_module.opBranch(block.b_loop.labelBreak); |
| 490 | // following OpBranch need a open block |
| 491 | uint32_t label = m_module.allocateId(); |
| 492 | m_module.opLabel(label); |
| 493 | } |
| 494 | |
| 495 | // Declare the continue block |
| 496 | m_module.opBranch(block.b_loop.labelContinue); |
| 497 | m_module.opLabel(block.b_loop.labelContinue); |
| 498 | |
| 499 | // Declare the merge block |
| 500 | m_module.opBranch(block.b_loop.labelHeader); |
| 501 | m_module.opLabel(block.b_loop.labelBreak); |
| 502 | } |
| 503 | |
| 504 | void GcnCompiler::emitControlFlowBlock(const GcnToken& token) |
| 505 | { |
no test coverage detected