MCPcopy Create free account
hub / github.com/Inori/GPCS4 / emitControlFlowEndLoop

Method emitControlFlowEndLoop

GPCS4/Graphics/Gcn/GcnCompilerFlowControl.cpp:475–502  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

compileTokenEndMethod · 0.95

Calls 7

exceptionFunction · 0.85
backMethod · 0.80
opBranchMethod · 0.80
allocateIdMethod · 0.80
opLabelMethod · 0.80
sizeMethod · 0.45
pop_backMethod · 0.45

Tested by

no test coverage detected