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

Method emitControlFlowEndBlock

GPCS4/Graphics/Gcn/GcnCompilerFlowControl.cpp:530–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

528 }
529
530 void GcnCompiler::emitControlFlowEndBlock(const GcnToken& token)
531 {
532 if (m_controlFlowStack.size() == 0 ||
533 m_controlFlowStack.back().type != GcnCfgBlockType::Loop)
534 {
535 Logger::exception("GcnCompiler: 'EndLoop' without 'Loop' found");
536 }
537
538 // Remove the block from the stack, it's closed
539 const GcnCfgBlock block = m_controlFlowStack.back();
540 m_controlFlowStack.pop_back();
541
542 // Declare the continue block
543 m_module.opBranch(block.b_loop.labelContinue);
544 m_module.opLabel(block.b_loop.labelContinue);
545
546 // Declare the merge block,
547 // we use do {} while(false); to implement a block,
548 m_module.opBranchConditional(m_module.constBool(false),
549 block.b_loop.labelHeader,
550 block.b_loop.labelBreak);
551 m_module.opLabel(block.b_loop.labelBreak);
552 }
553
554 void GcnCompiler::emitControlFlowBreak(const GcnToken& token)
555 {

Callers 1

compileTokenEndMethod · 0.95

Calls 8

exceptionFunction · 0.85
backMethod · 0.80
opBranchMethod · 0.80
opLabelMethod · 0.80
opBranchConditionalMethod · 0.80
constBoolMethod · 0.80
sizeMethod · 0.45
pop_backMethod · 0.45

Tested by

no test coverage detected